Splendour and misery of the domain area

RU / Day 1 / 14:00 / Track 1

Martin Fowler in the book "Patterns of Enterprise Application Architecture" describes the "Domain Model" as a complex approach to organizing business logic. The method consists in the consciousness of classes corresponding to domain model objects both in terms of data structure and behavior. At the same time, technical aspects such as data storage, authentication, and authorization, transaction management are taken out of the business logic.

The pattern is implemented in two ways: 1) Rich model — data and behavior are encapsulated inside of domain objects. 2) Anemic model — only data is encapsulated in the objects of the domain model, the behavior is transferred to a separate layer of services.

Fowler and Evans consider the anemic model to be an antipattern. However, a lot of codebases the speaker has worked with are implemented in the style of "anemic" model. This talk is dedicated to the comparison of strong and weak sides of both approaches and non-obvious details of each implementation of the domain model in the OOP paradigm and the functional style.


Download presentation