Responsibilities of the common layers
In this section, we will explore each of the most commonly used layers in more depth. We will not dig too deep into each one as there are countless resources online and other books covering these. However, I still want to overview each since hopefully, this will help you understand the essential ideas behind layering.
I've built a small project that explores the basic ideas behind layering, and I've ensured it is easy to follow. The project allows for the following:
- Listing products.
- Adding and removing stocks (inventory).
We will iterate on this project throughout this chapter and in the next two. Moreover, since we are exploring two types of domain model, the solution comprises the following projects (layers):
- A shared data layer at the bottom.
- An anemic domain layer and a presentation layer that depends on that domain layer.
- A rich domain layer and a presentation layer that depends on that domain...