--- [EMAIL PROTECTED] wrote: > > -----Original Message----- > > From: Charlene Mitchell > [mailto:charlene_ml@;yahoo.co.uk] > > > > That's a good suggestion which I didn't think of, > > though I'm wondering how you could then get deeper > > relations; I can only visualise it working for > > something 2 levels deep. > > > > For example if I want to query on a Department and > get > > all Employees and their Addresses, I would do the > > following (simplified here): > > > > 1. DepartmentLocal.getDepartmentNormalValue(); > > 2. DepartmentNormal.getEmployeeLightValue(); > > 3. EmployeeLight.getAddresses??How2GetValue??(); > > You can certainly mix and match light and normal > value objects. > > For instance, an Address doesn't really need a > conotation of Normal becuase > it is atomic. That is to say, Address is probably a > member of alot of > unidirectional relationships and therefore doesn't > really have any > relationships that it knows about. Even if it does, > you don't have to > include them in the Address value object. > > So, Address could probably just have one value > object, AddressValue. Then > Employee Light and Normal value objects could both > retrieve Address. > > The situation that I was referring to was more along > the lines of a pure > tree structure between the same EntityBean. Like, > Type<----->*Type. Where > every Type may have a parent Type, and every Type > can have n subTypes. > > You could see how on Type.getNormal() would try to > retrieve the entire tree > because he would try to get his parent's Normal, > which would get all the > that parent's Normal, which would get that parent's > Normal, plus every > parent's children, etc... and that is where > reentrancy becomes a problem.
Hello again! You are indeed right, an Address might not need a back link to an Employee - but it also might (e.g. if I wanted to find all Employees that lived in a certain town). Though the problem is how to get the Addresses in the first place. Because, in order to avoid the re-entrant problem I would have to get an EmployeeLight value object from the DepartmentNormal Value Object. And because it is Light it means that I have reached a dead-end in my relation tree (I cannot go any deeper). My application could have 4 related entities. I have a requirement to get all Addresses and MobileTelephone numbers for all Employees that work in a certain Department!!! Is it possible using Value Objects in this way? Thanks Charlene __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com ------------------------------------------------------- This sf.net email is sponsored by: To learn the basics of securing your web site with SSL, click here to get a FREE TRIAL of a Thawte Server Certificate: http://www.gothawte.com/rd524.html _______________________________________________ Xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
