|
|||||
|
|||||
Nuts vs Anemic Domain Model
There is recently a thread on theserverside: Spring 2.0 vs. the Anemic Domain Model The thread discusses the solution presented by Spring 2.0 to resolve the Anemic Domain Model anti-pattern. The spring solution basically uses AspectJ and Java 5 annotation to weave the dependencies in. Therefore, clients can call "new DomainObject()" directly with the dependencies auto-magically injected from Spring. Nuts presents 2 solutions, with and without AspectJ:
Both solutions work with Java 1.4. Depending on the project needs, the AspectJ solution is prefered if a large number of domain objects are involved and relying on AspectJ is not a concern; while the pure Object Oriented solution can typically be used with a small set of domain objects to construct a more conventional and flexible design that's independent of AspectJ. |
|||||
|
Copyright 2003-2006 - The Codehaus. All rights reserved unless otherwise noted.
Powered by Atlassian Confluence
|
|||||