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.  [ 1 post ] 
Author Message
 Post subject: Composite design pattern
PostPosted: Mon Jul 10, 2006 5:54 pm 
Newbie

Joined: Mon Jul 10, 2006 5:29 pm
Posts: 1
Hi,

I've searched online for discussions of the composite design pattern using NHibernate. I found one, but it focused on the tree nature of the pattern and I'm more interested on the shared interface between leaves and nodes. My application has a class that has several properties that can have zero, one or more values. Of course I could model this situation using collections and have empty or single element collections in some cases. But to me, using the composite pattern seems a more natural and OO approach. I'd define an interface with the common behaviour that leaves and nodes will share, the properties on the client class would be of this interface type and I'd use the builder pattern to instantiate either a leaf - for the single element case - or a real composite in case there are two or more elements. I'd also be using the "null object" pattern (http://www.cs.oberlin.edu/~jwalker/nullObjPattern/) when the property is empty. The question is, is this design possible using NHibernate to handle these objects persistence?

Thanks in advance,
Rodrigo A. Pantoja.-[/url]


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

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.