Defining layers and features
We have introduced the concept of three layers to our architecture: data, domain, and presentation. We have seen a possible distribution of our existing files related to the cart feature, but that’s just one isolated feature. Now we will review how to distribute our files when there are many features, since several approaches exist. Let’s start with the simpler approach.
Implementing layer-first architecture
The first approach is known as the layer-first approach, also referred to as the vertical approach. The idea is to focus on the architecture layers first and then distribute the features inside those layers. Before we dive into the practical implementation, let’s discuss the domain.
The domain layer is the most crucial layer in defining the application architecture. It remains independent of the UI (presentation) and data implementation details. Instead, it defines the model based on your business concepts, essentially...