Hi everybody!

In my app, I am using DAOs/DTOs to perform CRUD operations on a legacy database packed with lots of triggers and stored procedures. Some of my DTOs are pretty complex, meaning, they have to be assembled from many tables.

A simple example:
Object a (loaded by aDAO) has a list of b objects (loaded by bDAO), which in turn has a list of c objects (loaded by cDAO)

The problem:
In my struts-based webapp, I want to display some a objects on a page (the objects won't be used after that anymore). I need a few attributes from related object b but nothing at all from the related c objects. When I use my aDAO to retrieve my a objects, this will cause a large number of sql queries (1 per object), resulting in lots of data I do not need.

The question:
Wouldn't it be more effecient to use a single query, that only loads the required data? This would mean though, that I cannot use my DTOs.

Any thoughts?

Regards,
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to