-->
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.  [ 2 posts ] 
Author Message
 Post subject: Design Question?
PostPosted: Tue Sep 15, 2009 5:11 am 
Beginner
Beginner

Joined: Wed Dec 10, 2008 5:59 am
Posts: 47
I guess this is more a question of design, than it is of technicalities.

I've got the business objects Album, Track and Composer. All of these three objects are being used by Hibernate. However, I like to think that instance confinement is a good thing, thus avoiding objects "escaping" and being used in unwanted ways. Does anyone have any good ideas of how to achieve that?

1. I have been thinking of creating for instance a TrackModel class which implements create(Map values), update(int index, Map values), delete(int index), and thus confining the Track objects to that model. However, now i'm suddenly all dependent on a Map to retrieve and update the values of my Track objects (and, among other consequences, i'm loosing type safety). The TrackModel can easily be adapted to a TableModel, and thus display a list of Track objects in a table.

I'd love to hear any input you might have on this!


Top
 Profile  
 
 Post subject: Re: Design Question?
PostPosted: Tue Sep 15, 2009 8:15 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Sounds like an object assembler pattern or something. I like it. Aggregating objects is a good design pattern. Just don't over-design, and you're good!

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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