hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Stuart <bare...@gmail.com>
Subject Re: Anemic Domain Model
Date Thu, 21 Apr 2005 15:38:11 GMT
Right, which is basically how I do all my designs, with slight
variances of course. But that didn't sound like what the author of the
article posted was talking about. Maybe I just read it wrong or
something, but it didn't really make much, logical, sense to me.

-Nick

On 4/21/05, James Carman <james@carmanconsulting.com> wrote:
>  
> 
> Eric Evans (the author of Domain-Driven Design, which Fowler references)
> would not recommend that a User object knows how to store itself in a
> database.  He would recommend creating a UserRepository class which
> represents the "set" of all of the User objects in the system.  From the
> outside, the UserRepository should look and feel like an in-memory
> collection of User objects.  Now, that repository could be implemented as
> exactly that, an in-memory collection.  Or, more likely, it would be
> implemented using something like Hibernate (see my article at
> TheServerSide.com for an example of this), JDO, or just plain JDBC.  
> 
> 
> 
> -----Original Message-----
> From: Nick Stuart [mailto:baredok@gmail.com]
> Sent: Thursday, April 21, 2005 11:27 AM
> To: hivemind-user@jakarta.apache.org
> Subject: Re: Anemic Domain Model
> 
> 
> So basically  he is saying that the application layer should do nothing more
> then call the Domain Layer objects which do all the work? In other words,
> not only does the Uesr object store the data, but also knows how to do
> everything else with the user as well right? (save to the database, load,
> delete, etc)
> 
> I dont know, but that just feels wrong to me. The data is just that, data. I
> treat my simple POJO beans like that and everything seems to work out fine
> for me. My services are responisble for loading, saving, creating the data
> and thats it. What woud I gain by putting that in the User itself? He never
> mentions what you gain, just that you loose a lot of OO usuability (but
> never mentions specifics).
> 
> His so called anti-pattern goes against almost everything I've read or been
> taught. But thats just me.
> 
> -Nick
> 
> 
> On 4/19/05, Luke Renn <goseigen@comcast.net> wrote:
> > Hello List,
> >
> > I was just reading this:
> > http://www.martinfowler.com/bliki/AnemicDomainModel.html
> and was
> > wondering what Hivemind users think about it.
> >
> > Do you agree?  If not, what kinds of tasks to you leave for your
> > services, and what kind of logic do you reserve for your domain.
> >
> > --
> > Luke                 | PGP: 0xFBE7D8AF
> > goseigen@comcast.net | 2A44 9EB2 F541 C1F2 D969  56E3 8617 5B7F FBE7
> > D8AF
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> hivemind-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> hivemind-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> hivemind-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message