liveBook · Manning

Infrastructure layer

As explained in Unit Testing Principles, Practices, and Patterns

An application layer containing technical algorithms and code that communicates with external or out-of-process dependencies.

Groups technical algorithms and code that accesses out-of-process dependencies. In a backend system, it forms one of three useful layers alongside the domain model and application services layer. section 8.5

Keep the layer purposeful rather than multiplying indirection:

  • Prefer a small number of clear layers; excessive indirection produces low-value tests and weak resistance to refactoring. section 8.5
  • Break callbacks and other circular dependencies by returning a value object instead of making the callee notify the caller. section 8.8

How Unit Testing Principles, Practices, and Patterns covers it

How deep it goes
Defines responsibilities and examples, then relates layer count and dependency cycles to testing and maintainability.
Examples
Uses database repositories, ORM mappings, SMTP gateways, and callback-based report generation as concrete boundary examples.
What it assumes
Assumes familiarity with backend applications, domain models, controllers, and dependencies that execute outside the process.
What you can do after
Evaluate layer boundaries and refactor dependency cycles toward simpler, more testable application structures.
How it connects
Connects the domain model and application services layer with out-of-process dependencies, integration testing, and circular dependencies.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Unit Testing Principles, Practices, and Patterns. The section links point to the parts of the book it draws on.