This layer is called application, features or use case layer. It contains application specific features. It encapsulates and implements all of the use cases of the system, for example (1) showing a list of loans that a user might apply for, or (2) making and additional loan payment. The application layer is responsible for exposing application functions to the user interface, coordinate tasks, manage transactions and assert necessary security authorizations. The implemented use cases orchestrate the flow of data to and from the domain layer, and to and from the interface layer. This layer is not affected by changes to interface components such as a database, UI or Enterprise service. This layer also won't be affected when the domain layer is altered. Only when use case are changed it will have impact on the application layer.

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.