Controller
A controller is a software component that receives input or requests and coordinates other components or operations to produce a response or change application state.
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
- Uses controllers to organize HTTP API actions and produce machine-readable client responses.
- How deep it goes
- Explains controller setup, request handling, attribute routing, API conventions, and content negotiation through worked examples.
- Examples
- Demonstrates fruit-list and item endpoints, plus appointment actions sharing a URL with different HTTP verbs.
- What you can do after
- Apply web API controllers in ASP.NET Core to map actions and return data or HTTP error results.
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 and API requests, connecting request routes to views or reactive responses.
- How deep it goes
- Explains request mappings, component discovery, model and session use, and reactive return values; defers database-backed ingredient retrieval.
- Examples
- Uses a home page, a taco-design form with ingredient choices, and a recent-tacos API.
- What you can do after
- Apply it via Spring MVC or WebFlux to map requests and return a view or reactive data.
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.
Spring Start Here, Second Edition
A controller in Spring MVC is an application component that receives and handles web requests and produces responses.
- How it is used
- Connects a specific HTTP request to the page a Spring MVC web application returns.
- How deep it goes
- Defines controller annotations and a simple page-returning action, stopping short of adding request-specific logic.
- Examples
- Uses a MainController action mapped to /home that returns home.html, whose heading says “Welcome!”.
- What you can do after
- Build a minimal page flow by pairing a static HTML document with a mapped controller action.
Read how Spring Start Here, Second Edition explains controller →
Spring Microservices in Action
A class that handles incoming requests and maps them to application behavior.
- How it is used
- Maps incoming microservice requests to Java methods through exposed HTTP endpoints.
- How deep it goes
- Works through controller and GET endpoint mappings, while deferring an in-depth discussion of REST.
- Examples
- Uses a licensing controller with organization and license path variables and a sample License response.
- What you can do after
- Apply Spring Boot annotations to expose a GET endpoint and bind path variables.
Read how Spring Microservices in Action explains controller →
Test Driven: Practical TDD and Acceptance TDD for Java Developers
A controller handles user input and coordinates application behavior, including changes to the model and selection of a view.
- How it is used
- Coordinates browser HTTP traffic with application behavior and selects a view for the response.
- How deep it goes
- Explains MVC responsibilities and testing obstacles without detailing controller implementation internals.
- Examples
- Uses a United States-built car list to illustrate data flow and view preparation.
- What you can do after
- Apply test-first development to controller components while focusing tests on desired behavior.
Read how Test Driven: Practical TDD and Acceptance TDD for Java Developers explains controller →
Grokking Software Architecture
A controller is an application component that receives requests and coordinates processing between the user interface and application logic.
- How it is used
- Coordinates API communication by translating HTTP requests into service calls and returning HTTP responses.
- How deep it goes
- Defines the controller as a translator and works through a REST endpoint, leaving business decisions and SQL to other components.
- Examples
- Uses an order lookup endpoint that delegates to a service and returns either not-found or a JSON response.
- What you can do after
- Apply it by separating HTTP translation from business decisions and delegating work to a service.
Read how Grokking Software Architecture 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.
.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 →
Vibe Engineering
A controller is an application component that receives requests, coordinates application behavior, and returns responses at an interface boundary.
- How it is used
- Defines the REST boundary that accepts generation requests, delegates application behavior, and returns responses.
- 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 you can do after
- Build it from scratch by defining a request contract, mapping an endpoint, injecting a service, and testing the boundary independently.
Also covered in
- Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools
- Kafka Streams in Action, Second Edition
- Spring AI in Action
- Simple Object-Oriented Design: Create clean, maintainable applications
- Grokking Web Application Security
- Automating API Delivery
What to know first
- Model–view–controllerModel–view–controller is a software architectural pattern that separates application data and behavior, presentation, and interaction handling into model, view, and controller responsibilities.
- HTMLHTML is the standard markup language for structuring content and elements in documents on the web.
- JSONJSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
- web applicationA web application is software that provides functionality through web technologies and is accessed over a network, typically through a browser or other web client.
Related concepts
- Model–view–controllerpart of · Model–view–controller is a software architectural pattern that separates application data and behavior, presentation, and interaction handling into model, view, and controller responsibilities.
- ControllerBasekind of · ControllerBase is the ASP.NET Core MVC base class providing controller behavior and action-result helpers without view-specific functionality.
- componentkind of · A software component is a modular part of a software system that encapsulates related functionality and interacts with other parts through defined boundaries.
- RouteAttributeconfigured by · RouteAttribute is an ASP.NET Core attribute that associates a controller or action with a route template.
- minimal APIalternative to · A minimal API is an ASP.NET Core programming model for defining HTTP endpoints with minimal framework ceremony, without requiring controller classes.
- routinguses · Routing is the process of directing an item, request, or task to a destination or processing path according to relevant rules or characteristics.
Questions about controller
What is controller?
A controller is a software component that receives input or requests and coordinates other components or operations to produce a response or change application state.
Which Manning books explain controller?
ASP.NET Core in Action, 3e, Pro ASP.NET Core 7, Tenth Edition, Unit Testing Principles, Practices, and Patterns, Spring in Action, Sixth Edition, Building Web APIs with ASP.NET Core, Web Components in Action, Spring Start Here, Second Edition, Spring Microservices in Action and 5 more.
What should I know before learning controller?
Manning books that teach controller usually introduce Model–view–controller, HTML, JSON and web application first.
What is the difference between controller and minimal API?
A controller is a software component that receives input or requests and coordinates other components or operations to produce a response or change application state. A minimal API is an ASP.NET Core programming model for defining HTTP endpoints with minimal framework ceremony, without requiring controller classes.
What is controller a kind of?
Controller is a kind of ControllerBase. ControllerBase is the ASP.NET Core MVC base class providing controller behavior and action-result helpers without view-specific functionality.
What is controller part of?
Controller is part of Model–view–controller. Model–view–controller is a software architectural pattern that separates application data and behavior, presentation, and interaction handling into model, view, and controller responsibilities.
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.












