A high-level overview of Vertical Slice Architecture
Before starting, let's look at the end goal of this chapter and the next. This way, it should be easier to follow the progress toward that goal throughout the chapter.
As we just covered in the chapter on layering, a layer groups classes together based on shared responsibility. So, classes that contain data access code are part of the data access layer (or infrastructure). In diagrams, layers are often represented by horizontal slices, like this:
The name "vertical slice" comes from that; a vertical slice represents the part of each layer that creates a specific feature. So, instead of dividing the application into layers, we are dividing it by feature. A feature manages its data access code, its domain logic, and possibly even its presentation code. By doing this, we are decoupling the features from one another but keeping...