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 covered in Chapter 14, Layering and Clean Architecture, a layer groups classes together based on shared responsibilities. For example, classes containing data access code are part of the data access layer (or infrastructure).
As explored before, we represent layers using horizontal slices in diagrams like this:
Figure 16.1: Diagram representing layers as horizontal slices
The “vertical slice” in “Vertical Slice Architecture” comes from this: a vertical slice represents the part of each layer that creates a specific feature. So, instead of dividing the application into layers, we divide it into features. A feature manages its data access code, domain logic, and possibly even presentation code. The key is...