On 08/04/2004 12:24 Adam Hardy wrote:
I've got a design issue re nested beans and DTOs from EJB, the classical (if that's not stretching it) monkeys-bunches-bananas situation.
I was wondering how people solve the issue of putting the nested beans together from the data in the database.
I am creating my DTOs from a CMP-EJB layer using xdoclet-generated classes, which is ideal up to this point.
I want to nest my bananas in my bunches in my monkey, basically, but all these classes are xdoclet-generated, so I can't modify them to contain an arraylist of child objects.
I'm thinking of subclassing them so the subclass can hold the arraylist of child beans.
That seems ugly to me though when constructing the data set, because I can get arraylists of the seperate classes but I then have to loop through them putting the child beans in the parents.
Anybody got a better way?
Probably not better but I've has to overcome the same problem and found that something like
public class Monkey { MonkeyDTO ... Bunch[] ... }
public class Bunch { BunchDTO .... BananaDTO[] .... }
with appropriate getters/setters works for me.
--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for Business |
| Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]