liveBook · Manning

Controller

A controller is a software component or architectural role that receives inputs or requests and coordinates their handling by other parts of an application.

How 8 Manning books explain it

ASP.NET Core in Action, 3e

A web API controller is an ASP.NET Core controller that handles HTTP API requests through action methods and produces machine-readable responses.

How it is used
Handles HTTP API requests through grouped actions that return machine-readable data or status codes to client applications.
How deep it goes
Works through project setup, an example controller, action results, routing, and API conventions; compares controllers with minimal APIs.
Examples
Uses a fruit-list API with an item lookup and separate GET and POST appointment actions.
What you can do after
Build it from scratch using the ASP.NET Core Web API template, AddControllers(), MapControllers(), and attributed actions.

Read how ASP.NET Core in Action, 3e explains controller →

Pro ASP.NET Core 7, Tenth Edition

A controller is an ASP.NET Core MVC component that receives requests and coordinates processing to produce responses, including responses rendered from views.

How it is used
Groups actions that handle HTTP requests for web services or view-rendered HTML applications.
How deep it goes
Works through discovery, base classes, routing, services, model binding, and view results with controller listings.
Examples
Uses product-service GET actions, a product-backed HTML view, and an RSVP form reached through a browser URL.
What you can do after
Build it from scratch: create a controller with routed actions and return either product data or a rendered view.

Read how Pro ASP.NET Core 7, Tenth Edition explains controller →

Unit Testing Principles, Practices, and Patterns

A controller is a software component that coordinates work between other components without itself implementing substantial complex or business-critical logic.

How it is used
Coordinates domain logic and external communication while keeping business decisions outside orchestration code.
How deep it goes
Classifies controllers by complexity and collaborators, then refactors overcomplicated code into orchestration and business-logic components.
Examples
Uses fat controllers, email uniqueness, external failures, and CRM component communications to illustrate orchestration boundaries.
What you can do after
Refactor overcomplicated code, choose integration tests for controllers, and place mocks at unmanaged system boundaries.

Read how Unit Testing Principles, Practices, and Patterns explains controller →

Spring in Action, Sixth Edition

A controller class is a web-application component that receives and handles client requests.

How it is used
Handles browser requests by supplying a view, and handles API requests by returning data.
How deep it goes
Works through a minimal GET handler and a mapped, session-aware controller, then compares reactive return types; defers database-backed ingredients.
Examples
Uses a home-page GET handler, a taco-design page with ingredients, and a reactive recent-tacos API handler.
What you can do after
Build it from scratch as a Spring MVC GET controller, then recognize the corresponding annotation-based WebFlux pattern.

Read how Spring in Action, Sixth Edition explains controller →

Building Web APIs with ASP.NET Core

An ASP.NET Core controller is a component that handles web requests through action methods and framework-supported conventions.

How it is used
Groups related HTTP actions into a web API endpoint class.
How deep it goes
Walks through a sample controller, its route and GET action, and a replacement project endpoint; defers database-backed retrieval.
Examples
Uses a sample GET/DELETE controller, a weather-forecast template, and a board-game GET endpoint returning JSON.
What you can do after
Build it from scratch: replace a template controller with a board-game controller and verify its JSON response.

Read how Building Web APIs with ASP.NET Core explains controller →

Web Components in Action

In Model-View-Controller architecture, the coordination layer that handles input and mediates updates between the view and model.

How it is used
Coordinates Web Component events with centralized application data while keeping presentation and data storage separate.
How deep it goes
Defines MVC roles and demonstrates event-to-model calls, but stops short of a comprehensive controller architecture.
Examples
Uses workout-plan save, load, clear, and exercise-click handlers as concrete controller interactions.
What you can do after
Apply it via event listeners that delegate application changes to a centralized data model.

Read how Web Components in Action explains controller →

Django in Action

The MVC controller is the component responsible for handling interactions with application data and coordinating application behavior.

How it is used
Frames how dynamic Django applications connect user input, data, application logic, and rendered responses.
How deep it goes
Defines the controller and traces URL routing to views, while stopping short of prescribing a separate Django controller component.
Examples
Uses static-versus-dynamic websites, urls.py, urlpatterns, path objects, Django views, and request-response handling.
What you can do after
Understand how Django routes a browser request and where controller responsibilities appear within its view-centered architecture.

Read how Django in Action explains controller →

.NET in Action, Second Edition

An MVC controller is the component that receives requests or user input and coordinates the model and view used to produce a response.

How it is used
Coordinates HTTP requests or user input with models, views, actions, and response results in ASP.NET Core applications.
How deep it goes
Defines responsibilities and runtime flow, then contrasts controller classes with Razor pages and minimal APIs without detailing controller implementation.
Examples
Uses an MVC request-flow diagram, Razor Index.cshtml, an invalid-font 404 endpoint, and controller-based CRUD with SwaggerUI testing.
What you can do after
Apply it via ASP.NET Core by distinguishing controller actions, Razor page handlers, and minimal-API endpoints.

Read how .NET in Action, Second Edition explains controller →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.