The domain model pattern

An object model of the domain that incorporates both behaviour and data.
-by Martin Fowler: Patterns of Enterprise Application Architecture

A domain model is an object that has behavior and data, so, the behavior defines the business logic of the enterprise application, and data is information about the business's output. A domain model combines data and process. In an enterprise application, data model lies under the business layer to insert the business logic, and it returns data from the business behaviors. Let's see the following diagram for more clarity on this:

As you can see in the preceding diagram, we have defined two domain models in our application as per as our business requirements. Business behavior for transferring money from one account to another account has been defined in the TransferService class. The classes TransferService and AccountService come under the domain model pattern in the enterprise application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset