Some elements in the application layer are
- Implements use cases/tasks for users/systems exposed by the interface layer. These use cases define the behavior of the application. E.g., what pages to show in what order to the end user for a subsidy application.
- Cross cutting concerns such Security, Exception handling and logging.
- Only knows state of progress of tasks within a use case.
Studio uses the following elements for the domain layer:
You may also use business rules or service calls in this layer to manage application specific logic, but these are omitted here as they are not typical for this layer.
Patterns
Distinguish domain, application and interface attributes
When also creating entities and attributes that are used for the other layers, make a clear distinction between Attributes used by the domain, application and/or interface layer. If you do not do this, then it is unclear at a later point what each attribute is for. For example by introducing a new entity or clear post- or prefix names. A commonly used name is Control for any attributes that belong to the application layer and not in the Domain Layer. Any attribute of the Control entity is used for steering your application, but should not be used in any business logic.
When you understand all the layers, go to 3. Clean Architecture in practice or have a look at Business Rules and the Clean Architecture.