Creating the layers
Layering is one implementation that is inevitable when applying domain-driven development. There is a dependency between layers that, sometimes, might pose problems when fixing bugs during development. But what are important in layered architectures are the concepts, structures, categories, functionalities, and roles that layering can create, which helps in understanding the specification of the application. Figure 4.5 shows the models, repositories, services, and controllers of the sub-applications:
Figure 4.5 – Layered architecture
The most crucial layer is the models
layer, which consists of the domain model classes that describe the domain and business processes involved in the application.