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]