Thank you very much for your kind words.  

The Hibernate folks (Gavin King and Christian Bauer) would probably
recommend just using your domain entity classes to transfer the data between
tiers.  The only problem with that is that you need to "pre fetch" all of
the relationships you're going to need in the other tier, since Hibernate
wouldn't be in place to do the "lazy" fetching for you.  

If you do choose to use DTOs, however, I would create a package called
"hivemind.example.article.dto", since DTOs are not exactly part of the
domain model (IMHO).

Admittedly, my example does somewhat follow the "anemic domain model"
anti-pattern, since there is no real domain logic in the User class.  Given
the simplistic requirements, though, there wasn't any real logic that
belonged in that class.  I am used to programming in the usual "anemic" way
also.  I only just recently picked up Eric Evans book on the advice of a
friend/colleague of mine.  However, I really like how Mr. Evans prescribes
that you develop a domain model (factories, repositories, entities,
aggregates), at least as far as I've read.  I'm still learning and I'm no
expert in this new way of thinking (yet).  I still think HiveMind can be
useful when developing a "proper" domain model, though.


-----Original Message-----
From: Luke Renn [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 21, 2005 11:46 AM
To: [email protected]
Subject: Re: Anemic Domain Model


* James Carman <[EMAIL PROTECTED]> [2005-04-21 11:34:31 -0400]:

> implemented using something like Hibernate (see my article 
> <http://www.theserverside.com/articles/article.tss?l=HivemindBuzz> at 
> TheServerSide.com for an example of this), JDO, or just plain JDBC.

I agree %100, and infact, it was your article that made me start playing
with hivemind again.  I don't know how I stumbled onto that article, but it
was the fact that your sample seemed to follow this amnemic model that
prompted me to ask.  I loved the way you setup that sample project, and
thanks for the wonderful article.  It had the added bonus of teaching me how
to fetch dependencies without all the baggage of maven.

Ah, I remember what I was looking for.  In your domain directory you have
entity, factory, and repository.  I was wondering where you would place
transfer objects (not persisted, no business logic) in your directory
structure.  For example, if the EmailService took some hypothetical Message
object (and you didn't want to use an inner class).  Anyway, like I said,
the article teaches you more than just hivemind, thanks for that.

-- 
Luke                 | PGP: 0xFBE7D8AF
[EMAIL PROTECTED] | 2A44 9EB2 F541 C1F2 D969  56E3 8617 5B7F FBE7 D8AF

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to