This is an old revision of the document!
POJO, POCO, POPO - WHEN ANEMIC DOMAIN MODEL IS PREFERRABLE?
By Djambong T. Hank-debaim (khdzhambongtenke@edu.hse.ru)
You may find the following reference useful in writing essay
Introduction
Software Engineering is the development of software products using “best practices”, “principles”, and methods. The focus of this essay is about what is considered “best” and “bad” practice. In the next few pages, we will take a quick look into the notion of design patterns, then we will make a critical analysis of the so called “Anemic Domain Model” (ADM). At that stage, we would assess why it is being labelled as “anti-pattern” by some. After that, we will consider the good aspects of ADM and why software engineers still use it. As conclusion, I will present my stance on when ADM usage is preferable.
Design patterns, DDD and ADM
Design patterns are sets of solutions to common design problems that occur over and over in development. They work as a solution template in which an abstract solution for a common problem is described and the user then applies it, adapting it to their problem. An anti-pattern is just the possible of a pattern. Implementing an anti-pattern within a program is going to affect system performance, security, scalability, and sustainability. During the years, multiple approaches have been created to help software engineers on developing complex systems. One of those approaches is Domain-Driven Development (DDD). DDD is an approach to software development that centers the development on programming a domain model that has a rich understanding of the processes and rules of a domain [1]. In DDD, the development process boils down to creating software abstractions called domain models, which are models of the domain that incorporates both behavior and data [3]. This clearly sets them apart from Entity Objects, which are object representations of only the data stored in a database, while the behavior is in separate classes instead. In theory, DDD seems logical and shall suit all complex enterprise solutions. However, most developers still do not apply it by its full extent. Rather, they use a “semi-version” of DDD, which lead to the so-called Anemic Domain Model (ADM). An ADM is a design approach using pure-data Entity Classes, with the behavior extracted to another layer, usually called “service layer”. In various programming languages, such classes bear well-known denominations and follow the naming pattern POXO (Plain Old X Object), where X represent the first letter of a specific programming language. For example, in Java they are called POJO, in CLR – POCO, in PHP – POPO, etc.
Conclusion
The last section should clearly state your grounded view on the topic
References
- provide 5-10 references to the sources
- these references should justify, support your analysis or provide alternative viewpoints
- use web links and bibliograpy-style references where applicable
- prefer peer-reviewed and published works