Dataviews, Datatables or objects between PL and BL?

Posts   
 
    
Posts: 6
Joined: 02-Jan-2007
# Posted on: 04-Jan-2007 15:31:08   

Hi!

I'm quite new to LLBLGEN but it's a great product. My scenario is like this, we are about to develop a traditional application with three layers, DAL, BL and PL.

My friend developed an OR mapper a couple of years ago and for him the words, datatable, dataview and especially datasets are words of satan because he doesn't think database schemas is needed in the PL :-) His solution is more like hibernate, he uses reflection and at the end he returns arrays of objects. I downloaded the HnD application and noticed that they had a function converting EntityCollections to datatables which they returned to PL. My question is, is there a simple way of converting EntityCollections and Entites to arrays of object? How do you all communicate to the PL?

/Magnus

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 04-Jan-2007 16:05:27   

If you need Read_Only object in the PL use TypedLists & DynamicLists (which are subTypes of DataTable), you can also project an EntityView of an EntityCollection to a DataTable.

If you need a Read/Write objects, use EntityCollections (that's my recommendation). If you use the Adapter model, the Database schema will be hidden, they are available only in the DatabaseSpecific project which can be referenced in your BL or DAL only.

Posts: 6
Joined: 02-Jan-2007
# Posted on: 04-Jan-2007 16:33:01   

Hi!

Thanks for your answer. So you mean by returning a TypedList to the PL I can cast it into a datatable?

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 04-Jan-2007 16:47:12   

TypedList is a DataTable

Posts: 6
Joined: 02-Jan-2007
# Posted on: 05-Jan-2007 09:40:31   

Sorry was a little bit tired yesterday simple_smile

Posts: 6
Joined: 02-Jan-2007
# Posted on: 12-Jan-2007 12:52:13   

Hi again!

So you mean if I want to receive a single Customer for example CustomerEntity and pass it out to PL I should use TypedList or??

Walaa avatar
Walaa
Support Team
Posts: 14983
Joined: 21-Aug-2005
# Posted on: 12-Jan-2007 15:35:37   

It's up to you.

You can use a TypedList (dataTable of one row), an entity or even pass the data as parameters or in a struct or any other DTO (Data Transfer Object).