Introduction to layering
Now that we've explored a few design patterns and played with ASP.NET Core 5 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.
Let's start by examining 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 5 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 problem that the application should be solving. The domain layer is also...