Port
A port is a defined point of connection through which a system or component communicates with another system, service, or component.
Grokking Software Architecture
A port is an application-facing interface in hexagonal architecture that defines operations used to interact with the application core.
- How it is used
- Protects business logic from outside technologies by defining the application's interaction boundaries.
- How deep it goes
- Explains driving and driven ports, adapter wiring, testing, design pitfalls, and migration; defers detailed external API design.
- Examples
- Uses order service and repository interfaces, a server alert port with fake adapter, and a crypto portfolio refactoring exercise.
- What you can do after
- Apply ports to separate core logic from external dependencies and test behavior with fake adapters.
AI-Powered Developer: Build software with ChatGPT and Copilot
A port is an interface defining a contract between an application’s domain model and an external system.
- How it is used
- Separates a REST API from AssetManager through an interface and delegating adapter.
- How deep it goes
- Defines port roles and works through an abstract CRUD interface, adapter implementation, and controller update.
- Examples
- Uses an IT asset-management REST controller, AssetRestPort, AssetRestAdapter, and CRUD asset operations.
- What you can do after
- Build it from scratch by defining a port, implementing an adapter, and redirecting controller calls through it.
Read how AI-Powered Developer: Build software with ChatGPT and Copilot explains port →
Grokking AI Applications
A port is a typed connector on a workflow component through which data, models, variables, or other resources enter or leave the component.
- How it is used
- Connects workflow components into processes that pass data, models, variables, and other resources between stages.
- How deep it goes
- Explains port direction, color-coded data types, linked parameters, and practical drag-and-drop connections.
- Examples
- Uses a Chat Input-to-OpenAI connection and a KNIME node anatomy diagram to demonstrate port usage.
- What you can do after
- Operate/configure workflows by identifying compatible ports and connecting component outputs to downstream inputs.
Clean Applications with Hexagonal Architecture
An application boundary interface through which external actors or technologies interact with the application core.
- How it is used
- Defines core-owned interaction boundaries that protect business logic from external technology changes.
- How deep it goes
- Explains input and output responsibilities, dependency direction, Java interfaces, and incremental migration steps.
- Examples
- Uses article creation, a JPA repository adapter, and REST and Kafka entry points to illustrate port roles and reuse.
- What you can do after
- Apply ports by extracting core interfaces, refactoring handlers, wrapping existing infrastructure, and testing boundaries.
Read how Clean Applications with Hexagonal Architecture explains port →
Acing the Frontend Interview
A port is an interface defining a communication boundary through which an application exposes capabilities or accesses an external dependency.
- How it is used
- Frames communication boundaries between application capabilities, architectural layers, and external services.
- How deep it goes
- Defines ports and names inbound and outbound forms, then demonstrates adjacent proxy mechanics without detailing port implementation.
- Examples
- Uses a React fetch call, Vite proxy configuration, Express CORS headers, and curl preflight output.
- What you can do after
- Apply it via a named tool or library by explaining and configuring Vite proxy communication between frontend and external API.
gRPC Microservices in Go
A network port is a numbered communication endpoint that identifies a service or process on a networked host.
- How it is used
- Defines contracts between an Order service’s business logic and its incoming requests or outgoing dependencies.
- How deep it goes
- Works through Go interface signatures, adapter placement, and startup wiring; does not examine network-port protocol internals.
- Examples
- Uses PlaceOrder, database Get and Save contracts, and a payment Charge contract in an Order service.
- What you can do after
- Build it from scratch as Go interfaces, inject matching adapters, and substitute mocks when testing dependent operations.
Also covered in
- Grokking Concurrency
- Microservices Patterns, Second EditionIn early access (MEAP)
- Build Python Web Apps with Streamlit
- Effective Behavior-Driven DevelopmentIn early access (MEAP)
- Fundamentals of CybersecurityIn early access (MEAP)
- Spring Microservices in Action
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.
- business logicBusiness logic is the domain-specific rules, computations, and decisions that determine how a software system processes operations and behaves.
- dependency injectionDependency injection is a software design technique in which a component receives its dependencies from outside rather than creating or locating them internally.
- domain modelA domain model is a software representation of the concepts, entities, relationships, rules, and behavior of a problem domain.
Related concepts
- interfacekind of · An interface is a contract or boundary that specifies the operations, members, or data shape a type or component exposes, without prescribing its complete implementation.
- @Mock annotationused by · The Mockito @Mock annotation marks a field or parameter for initialization as a mock object used in testing.
- adapterimplemented by · An adapter is a software component that translates between interfaces or representations so otherwise incompatible components can work together.
- hexagonal architectureused by · Hexagonal architecture is a software architecture pattern that isolates an application's core logic behind ports and connects external systems through adapters.
- primary portincludes · A primary port is an application interface through which external actors or systems invoke the application’s operations or use cases.
- contractkind of · A contract is an agreed specification of the conditions, expectations, rights, or obligations that govern behavior or interactions between parties or software components.
Questions about port
What is port?
A port is a defined point of connection through which a system or component communicates with another system, service, or component.
Which Manning books explain port?
Grokking Software Architecture, AI-Powered Developer: Build software with ChatGPT and Copilot, Grokking AI Applications, Clean Applications with Hexagonal Architecture, Acing the Frontend Interview and gRPC Microservices in Go.
What should I know before learning port?
Manning books that teach port usually introduce interface, business logic, dependency injection and domain model first.
What kinds of port are there?
Kinds of port include primary port.
What is port a kind of?
Port is a kind of interface. An interface is a contract or boundary that specifies the operations, members, or data shape a type or component exposes, without prescribing its complete implementation.
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.





