-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: dao or domain model
PostPosted: Thu Jun 03, 2004 5:45 am 
Newbie

Joined: Thu Sep 25, 2003 7:21 pm
Posts: 17
Hi I am trying to get my feet wet with OR mapping coming from a background of using straight sql.

Most people on this forum seem to suggest using hibernate with the DAO pattern. here's an excerpt from core j2ee patterns

"when there is little or no business logic in a business operation applications will typically let clients access business data in the data store. For example a presentation tier component can directly access a Data access object. In this scenario there is no notion of an object model in the business tier, Instead the application requirements are fullfilled by a procedural implementation"

does this mean most people choose to externalize the businesslogic from the domain objects and instead use a procedural implementation? Is this the recommended way to use hibernate,
what is the recommended way to add businesslogic to your domain objects?, not use dao's at all but straight calls to the hibernate api's in actions or facades..?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 5:47 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
If business logic is encapuslated in a domain model, that is, an object-oriented model of business entities, persistence is externalized to some "persistence manager" interface. This can be Hibernate directly or, if you prefer, hidden behind a DAO facade. Your business facade then calls this persistence layer to load, store and find objects.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: it depends...
PostPosted: Thu Jun 03, 2004 5:50 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
this is not easy decision.

I do not like to pollute my domain model with access control,
transaction settings etc. So, there is only some rudimentary
business logic inside ( ensure that child-partent relationship is set
properly and such )

Access control / transaction / more complex bysiness logic
goes into various DAOs ( ususally I have several of them for various puproses )

_________________
Got new hibernate xdoclet plugin? http://www.sourceforge.net/projects/xdoclet-plugins/
... Momentan auf der Suche nach neuen Projekt ode Festanstellung....


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.