liveBook · Manning

Controller

As explained in Vibe Engineering

A controller is an application component that receives requests, coordinates application behavior, and returns responses at an interface boundary.

A controller defines an interface boundary: it receives an HTTP request, coordinates application behavior through a service, and returns a response. Keep business logic behind a service contract so the REST layer does not become coupled to an LLM provider or implementation choice. section 6.1.2

A disciplined controller should:

  • Delegate generation to a service and return its response rather than embedding provider-specific logic. section 6.1.2

Isolated SQL-generation endpoint

A controller receives a request asking for total sales by customer, passes it to SqlGeneratorService, and returns generated SQL. A web-layer test supplies sales and customers tables while mocking the service response. section 6.1.2

How Vibe Engineering covers it

How deep it goes
Explains routes, contracts, delegation, and isolated testing, but defers business logic to the service implementation.
Examples
Uses a SQL-generation endpoint, table metadata requests, generated SQL responses, and a mocked controller test.
What it assumes
Assumes familiarity with HTTP requests and responses while making service separation and controller isolation explicit.
What you can do after
Build it from scratch by defining a request contract, mapping an endpoint, injecting a service, and testing the boundary independently.
How it connects
Connects REST APIs with request validation, service contracts, dependency injection, and web-layer testing.

Also explained in

Compare how 13 books explain controller →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.