Anemic Domain Model

Anemic Domain Model

The Anemic Domain Model is a pejorative term used to describe the use of a domain model where the business logic is implemented outside the domain objects. This pattern was first described by Martin Fowler who considers the practice an anti-pattern. With this pattern, logic is typically implemented in separate classes which transform the state of the domain objects. Fowler calls such external classes "transaction scripts". This pattern is a common approach in enterprise Java applications, possibly encouraged by technologies such as J2EE's Entity Beans, [http://www.martinfowler.com/bliki/AnemicDomainModel.html] as well as in .NET applications following the Three-Layered Services Application architecture where such objects fall into the category of "Business Entities" (though Business Entities may also contain behavior). [http://msdn2.microsoft.com/en-us/library/ms954595.aspx]

Benefits

* Encourages and enforces a clear separation of concerns between presentation layers, business layers, and resource access layers of an application.
* Allows for the development of a common object model which can be applied across an Enterprise while at the same time allowing for flexibility in the domain logic implementation used by differing applications.
* Enables auto-generation through modeling tools which may render a common object model in various languages used across an Enterprise.

Liabilities

* Necessitates a separate business layer to contain the logic otherwise located in a domain model. It also means that domain model's objects cannot guarantee their correctness any moment, because their validation and mutation logic is placed somewhere outside (most likely in multiple places).
* Necessitates a global access to internals of shared business entities increasing coupling and fragility.
* Facilitates code duplication among transactional scripts and similar use cases, reduces code reuse.
* Necessitates a service layer when sharing domain logic across differing consumers of an object model.
* Makes a model less expressive and harder to understand.

External links

* [http://www.martinfowler.com/bliki/AnemicDomainModel.html Anemic Domain Model] by Martin Fowler
* [http://msdn.microsoft.com/en-us/library/ms978689.aspx Three-Layered Services Application]
* [http://msdn2.microsoft.com/en-us/library/ms954595.aspx Application Architecture for .NET: Designing Applications and Services]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Business object — Business objects redirects here. For the software company, see Business Objects. A business object is a type of an intelligible entity being an actor inside the business layer in an n layered architecture of object oriented computer programs.… …   Wikipedia

  • Anti-pattern — For the book, see AntiPatterns. In software engineering, an anti pattern (or antipattern) is a pattern that may be commonly used but is ineffective and/or counterproductive in practice.[1][2] The term was coined in 1995 by Andrew Koenig,[3]… …   Wikipedia

  • Antipatrón de diseño — Saltar a navegación, búsqueda Un antipatrón de diseño es un patrón de diseño que invariablemente conduce a una mala solución para un problema. Al documentarse los antipatrones, además de los patrones de diseño, se dan argumentos a los diseñadores …   Wikipedia Español

  • United States — a republic in the N Western Hemisphere comprising 48 conterminous states, the District of Columbia, and Alaska in North America, and Hawaii in the N Pacific. 267,954,767; conterminous United States, 3,022,387 sq. mi. (7,827,982 sq. km); with… …   Universalium

  • japan — japanner, n. /jeuh pan /, n., adj., v., japanned, japanning. n. 1. any of various hard, durable, black varnishes, originally from Japan, for coating wood, metal, or other surfaces. 2. work varnished and figured in the Japanese manner. 3. Japans,… …   Universalium

  • Japan — /jeuh pan /, n. 1. a constitutional monarchy on a chain of islands off the E coast of Asia: main islands, Hokkaido, Honshu, Kyushu, and Shikoku. 125,716,637; 141,529 sq. mi. (366,560 sq. km). Cap.: Tokyo. Japanese, Nihon, Nippon. 2. Sea of, the… …   Universalium

  • china — /chuy neuh/, n. 1. a translucent ceramic material, biscuit fired at a high temperature, its glaze fired at a low temperature. 2. any porcelain ware. 3. plates, cups, saucers, etc., collectively. 4. figurines made of porcelain or ceramic material …   Universalium

  • China — /chuy neuh/, n. 1. People s Republic of, a country in E Asia. 1,221,591,778; 3,691,502 sq. mi. (9,560,990 sq. km). Cap.: Beijing. 2. Republic of. Also called Nationalist China. a republic consisting mainly of the island of Taiwan off the SE coast …   Universalium

  • Germany — /jerr meuh nee/, n. a republic in central Europe: after World War II divided into four zones, British, French, U.S., and Soviet, and in 1949 into East Germany and West Germany; East and West Germany were reunited in 1990. 84,068,216; 137,852 sq.… …   Universalium

  • Multifunction cardiogram — Multifunction CardioGramTM (MCGTM) is an FDA and AMA approved diagnostic tool used to diagnose myocardial ischemia due to Coronary Artery Disease (CAD). MCG records resting ECG data between the Myocardium and intra cardiac blood flow to… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”