Primary port
A primary port is an application interface through which external actors or systems invoke the application’s operations or use cases.
Clean Applications with Hexagonal Architecture
An interface exposing an application operation that an external caller can invoke.
- How it is used
- Defines the core-owned public API through which external adapters invoke application capabilities.
- How deep it goes
- Develops interface contracts, handler implementation, typed failures, module placement, and automated interface checks.
- Examples
- Uses article creation and publishing, including a handler that reads, publishes, and saves an article.
- What you can do after
- Builds use-case interfaces and handlers with explicit typed errors and enforceable port boundaries.
Read how Clean Applications with Hexagonal Architecture explains primary port →
Grokking Software Architecture
An interface through which an external actor invokes an application's core functionality.
- How it is used
- Defines the application's callable operations for users, tests, and external systems entering through driving adapters.
- How deep it goes
- Defines ports as interfaces and illustrates order-service operations, but does not detail implementation or method design.
- Examples
- Uses IOrderService.PlaceOrder() and CancelOrder(), called by an OrderController after translating an HTTP request.
- What you can do after
- Apply it by defining an interface for application actions and having a driving adapter call it.
Read how Grokking Software Architecture explains primary port →
Also covered in
- Microservices Patterns, Second EditionIn early access (MEAP)
What to know first
- interfaceAn interface is a contract or boundary that specifies the operations, members, or data shape a type or component exposes, without prescribing its complete implementation.
- layered architectureLayered architecture is a software organization pattern that separates responsibilities into ordered layers with defined roles and constrained dependencies, typically from higher-level layers to lower-level ones.
- business logicBusiness logic is the domain-specific rules, computations, and decisions that determine how a software system processes operations and behaves.
- separation of concernsSeparation of concerns is a design principle that organizes a system into parts with distinct responsibilities and limited overlap.
Related concepts
- command handlerkind of · A command handler is a software component that receives and processes commands representing requested application actions or state changes.
- handlerimplemented by · A software component that responds to an input by performing the processing or platform-specific actions associated with it.
- outbound portcontrasts with · An outbound port is an application-facing interface that declares a service or resource the application requires from an external provider.
- REST controllerused by · A REST controller is a web component that handles HTTP requests for REST endpoints and dispatches them to application operations.
- portkind of · A port is a defined point of connection through which a system or component communicates with another system, service, or component.
Questions about primary port
What is primary port?
A primary port is an application interface through which external actors or systems invoke the application’s operations or use cases.
Which Manning books explain primary port?
Clean Applications with Hexagonal Architecture and Grokking Software Architecture.
What should I know before learning primary port?
Manning books that teach primary port usually introduce interface, layered architecture, business logic and separation of concerns first.
What is the difference between primary port and outbound port?
A primary port is an application interface through which external actors or systems invoke the application’s operations or use cases. An outbound port is an application-facing interface that declares a service or resource the application requires from an external provider.
What is primary port a kind of?
Primary port is a kind of command handler. A command handler is a software component that receives and processes commands representing requested application actions or state changes.
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.

