-->
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.  [ 4 posts ] 
Author Message
 Post subject: Design Newbie- Entity POJO or persisted Domain Objects?
PostPosted: Tue Aug 02, 2005 6:12 am 
Newbie

Joined: Mon Aug 01, 2005 7:33 am
Posts: 18
Location: UK
Hibernate version:3.1

Name and version of the database you are using:Oracle 8i

Hi I have been asked to re-design our 'data-access layer' since we want to exploit the benefits of hibernate through Entity Manager. However I am having trouble (design is not my strong point) with deciding how to approach the concept - for example if a POJO using annotation can become a persisted entity bean should we simply make our domain objects persisted entities instead? Or should we continue to have domain objects that control business and logic and these couple with persisted POJOs via setters to store data? I can't really see in the beginners section any real idea on design. I understand that is probably because 'they' don't want to inhibit user's creative and implicit understanding of their own domains - but I am lacking any real direction. Could anyone give me some clues/direction/ideas please? Alternatively recommend some reading on the concept of design using hibernate (my hibernate books should have arrived by now but as I work away from home I will have to wait til the weekend to collect them!!) Doc needs to be in this Friday!!?

Regards
S


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 02, 2005 4:41 pm 
Beginner
Beginner

Joined: Tue Jun 21, 2005 3:15 pm
Posts: 29
Hi,
*read this as an opinion based on a few projects only* :)
We struggled with this issue as well. The first application we built we used DTO's as our "business objects" and hid the "entity objects" from the business logic. This required us to convert everything that came to and from the DL. It was a pain in the ass. The next project we decided to allow the "Entity Objects" to be our business objects and create DTO's on more of an as needed bases. This eliminated the translator. I am looking at this same issue as I build our third project.
Hope this helps,
B


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 02, 2005 7:20 pm 
Senior
Senior

Joined: Wed Jul 13, 2005 4:31 pm
Posts: 142
Location: Seattle, WA
*again read this as an opinion based on a few projects*

The conversion from 'business objects' to 'data objects' a lot of pain, and it was a lot easier to use the same business object and data object where possible. It is easy enough to diverge those later if neccesary. Lot harder to converge them.

There was one project for which, because of legacy API compliance, we could not use the data objects that were same as business objects. So, it really depends on the particulars of your project.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 03, 2005 4:16 am 
Newbie

Joined: Mon Aug 01, 2005 7:33 am
Posts: 18
Location: UK
Thanks peeps for giving me your opinions - they are most valuable. I am really going to try and steer away from separating BL and Entities with DTOs but the boss still seems to like that idea... we will see. Thanks anyway - I marked you both as helpful too ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.