Domain layer

The domain layer holds the business logic layer of a module. It typically does not contain resource-specific or database-specific information. Its primary functions include:

data-variant=success
data-slots=text
Best practice: Use service contracts to communicate with the domain layer by passing data types through strongly typed objects. This helps you avoid the need to replace presentation layer code when replacing business layer logic.

Models

Each domain-layer model contains a reference to a resource model, which it uses to retrieve data from the database with MySql calls. This resource model contains logic for connecting to the underlying database, typically MySQL. A model requires a resource model only if the model data must persist.

Accessing the domain layer

There are three primary ways of accessing a module's domain-layer code:

Your strategy for calling another module's domain-layer code is highly dependent upon the unique configuration and needs of your system.