Responsibilities of the common layers
In this section, we explore each of the most commonly used layers in more depth. We do not dig too deep into each one, but that overview should help you understand the essential ideas behind layering.
Presentation
The presentation layer is probably the easiest layer to understand because it is the only one we can see: the user interface. However, the presentation layer can also be the data contracts in case of a REST, OData, GraphQL, or other types of web service. The presentation layer is what the user uses to access your program. As another example, a CLI program can be a presentation layer. You write commands in a terminal, and the CLI dispatches those commands to its domain layer, which executes the required business logic.
The key of a maintainable presentation layer is to keep it as focused on displaying the user interface as possible with as little business logic as possible.
Now, let’s take a look at the domain layer...