Layered Architecture
In the previous pages, we decomposed a software product horizontally into use cases. In this page, we look at a second, complementary form of decomposition: layering.
Use cases answer the question: “What business responsibilities does the product implement?”
Layers answer a different question: “What type of work is being performed?”
Layered architecture does not introduce new responsibilities. It organizes existing responsibilities so they can evolve independently.
A single use case typically requires several different kinds of work:
If these responsibilities are mixed inside the same components, the use case becomes hard to maintain and hard to test. Changes in one concern create unintended effects in others.
Layering separates responsibilities by their nature. It keeps each type of work in its own conceptual place.
In this book, the functional architecture of a business software product naturally forms four logic layers:
The diagram below illustrates these layers and the direction in which responsibilities flow.
Layered architecture is not only about grouping code. It is also about keeping dependencies under control.
A simple and useful rule is:
This rule prevents circular dependencies and protects business behavior from being entangled with infrastructure details.
Use cases and layers do not compete. They stack.
This means a single use case may contain components from multiple layers. At the same time, a single layer may contain components belonging to many use cases.
The intersection of these two decompositions is what forms a practical software architecture.
When use cases are isolated and layers are respected:
Layering is therefore not a stylistic preference. It is a structural technique that preserves clarity as systems grow.
Table of Content Software Architecture Previous: Use Cases Architecture Next: Functional Architecture