Skip to main content

Layered Architecture

The layered architecture pattern defines a set of rules for how to structure your code. The rules are designed to help you build a system that is easy to understand, maintain, and extend. Components within the layered architecture pattern are organized into horizontal layers, each layer performing a specific role within the application. The three layers are called the domain layer, the application layer, and the infrastructure layer.

The layers are arranged in a hierarchy, with each layer depending on the layers below it, but not on the layers above it. This can be easily visualised as a set of concentric circles, with the innermost layer being enclosed by the outer layers. For example, where a service uses Domain Driven Design, the domain layer is the innermost layer, the infrastructure layer is the outermost layer, with the application layer in between:

Dependency Layers

Further Reading

External Resources