DTO w/ Complex Master/Child objects

Posts   
 
    
dtkujawski avatar
dtkujawski
User
Posts: 39
Joined: 05-Jul-2007
# Posted on: 05-Jul-2007 23:45:28   

I am evaluating this product for a large n-tiered implementation and have read a lot in the forums concerning using LLBL with DTO's (specifically: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=6261)

I got the DTO generation working fine with my eval. copy of LLBL, but this specific sample template only produced 1-level deep objects. Can the DTO template be expanded to support master/child objects the same as the entities support?

For instance, I have two fictional tables: Department Employee

With my tests on the entitites, when I load Employee I can access Employee.Department and that works fine. I would want the same capability across to the UI through a DTO.

Thoughts?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 06-Jul-2007 11:45:18   

What's the scope in which the DTO's are used? Typically, DTO's aren't hierarchical, as they just transfer data across. Do you need them for a webservice scenario or for UI purposes for example?

Frans Bouma | Lead developer LLBLGen Pro
dtkujawski avatar
dtkujawski
User
Posts: 39
Joined: 05-Jul-2007
# Posted on: 06-Jul-2007 15:57:59   

The UI and the BL are seperated through WebServices... The O/R model that I have created in LLBL for my test scenario works great on the BL, but I was wanting to extend the same model to the UI across the WebServices interface. Which is to say I don't want the UI to do too much work taking whatever data it gets back from the WebServices operations and transforming it into it's own unique O/R structure.

So, if I have a WebService operation called: "QueryEmployee" I would want to pass back the EmployeeEntityDTO which would also have a data from the "Department" table.

In this environment, it seems that a hierarchical object is the right solution - is there some other, more elegent solution, that I am overlooking here?

Thanks in advance!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 10-Jul-2007 10:48:13   

Why not returning the employee entity + department entity inside it? Why the extra work via the DTO's?

Frans Bouma | Lead developer LLBLGen Pro
dtkujawski avatar
dtkujawski
User
Posts: 39
Joined: 05-Jul-2007
# Posted on: 11-Jul-2007 16:54:37   

Yes, I think I agree at this point. Originally I wanted the DTO's for compatability with other Enterprise consumers of the WebService, but as we are the 800lb gorilla - I'm just going to make them conform to the Entity XML schema; it's really shouldn't be that bad for them.

Thanks...

jlozina
User
Posts: 17
Joined: 13-Mar-2008
# Posted on: 07-Apr-2008 01:55:34   

I'm wondering if their is a way to create hierarchical DTO's as you do with the entities. The reason I need this is because I am exposing public webservices to a flex client.