An application service coordinates application operations between a domain model and the external world. It provides an entry point for clients, retrieves and materializes domain objects, invokes domain behavior, persists results, and coordinates side effects. section 5.3 section 6.4
In hexagonal architecture, the application service sits above the domain layer. Dependencies flow toward the domain: domain classes contain business logic and remain independent of databases, message buses, filesystems, and other out-of-process systems. External applications connect through interfaces maintained by the application-services layer. section 5.5 section 7.2
Keep the service orchestral rather than computational:
- Load the required data through persistence or gateway collaborators. section 5.3
- Pass domain objects and plain values to domain operations; move complex reconstruction and business rules into factories or domain classes. section 7.2
- Persist changed domain state and trigger external effects only when the use case requires them. section 5.3 section 7.2
- Prefer tests that verify the use case through observable outputs or boundary effects; mocking intra-system calls couples tests to implementation details. section 5.5 section 6.4
Gluing a functional core to a mutable shell
An audit application separates the decision from filesystem effects. AuditManager receives FileContent values and returns a FileUpdate; Persister reads files and applies that update. ApplicationService reads the directory, passes the files and visitor record to AuditManager, then asks Persister to apply the result. The service remains a thin use-case entry point, while output-based tests can assert the selected filename and content without filesystem mocks. section 6.4
Figure 5.8. A typical application consists of a domain layer and an application services layer. The domain layer contains the application’s business logic; application services tie that logic to business use cases.
Use the layered diagram to distinguish domain business logic from the application-services layer that ties it to business use cases. section 5.3

