Introducing layering
Now that we’ve explored a few design patterns and played with ASP.NET Core a little, it is time to jump into layering. In most computer systems, there are layers. Why? Because it is an efficient way to partition and organize units of logic together. We could conceptually represent layers as horizontal chunks of software, each encapsulating a concern.
Classic layering model
Let’s start by examining a classic three-layer application design:
Figure 12.1: A classic three-layer application design
The presentation layer represents any user interface that a user can interact with to reach the domain. In our case, it could be an ASP.NET Core web application. However, anything from WPF to WinForms to Android could be a valid non-web presentation layer alternative.
The domain layer represents the core logic driven by the business rules; this is the solution to the application’s problem. The domain layer is also called the business...