Adapter ate my collections?

Posts   
 
    
JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 20-Jan-2005 04:09:23   

Frans,

I have been working with self-servicing and tonight generated code to use the adaptor scenario for the first time. I'm using "Adapter Full/Safe VS Net 2003". A very strange thing results. I have collection classes! My two DAL projects compile ok, but all of the typed collection classes are completely missing.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Jan-2005 10:18:43   

Adapter doesnt have collection classes, just 1 generic EntityCollection class. You expected typed collection classes?

Frans Bouma | Lead developer LLBLGen Pro
JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 20-Jan-2005 13:52:22   

Otis wrote:

Adapter doesnt have collection classes, just 1 generic EntityCollection class. You expected typed collection classes?

Well, yes, actually...I must really be spoiled now by the self-servicing code. I am sure there is some obvious reason why we don't have them when using DataAdapters?

The client then will have to do some casting to specifc entity types when it is passed an EntityCollection instance of, say, OrderEntity objects. disappointed

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Jan-2005 14:31:28   

You could try the derived entity templates for adapter, available in the 3rd party section, These generate typed collections simple_smile

Frans Bouma | Lead developer LLBLGen Pro
JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 20-Jan-2005 14:47:53   

Also, I'm using Adapter because I'm doing a BLL with a manager class, and I assume that when I do this I should use adapter because I don't want the GUI calling .Save() on my entities, right?

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 20-Jan-2005 14:52:20   

Otis wrote:

You could try the derived entity templates for adapter, available in the 3rd party section, These generate typed collections simple_smile

Ok, I will look into this. Even if the Adapter must work with a generic collection, I would like to cast it to a typed collection before I pass to the GUI. But...tell me why the adapter can't work with typed collections? I'm sure it's something obvious.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Jan-2005 17:07:25   

JimFoye wrote:

Also, I'm using Adapter because I'm doing a BLL with a manager class, and I assume that when I do this I should use adapter because I don't want the GUI calling .Save() on my entities, right?

Correct. simple_smile

JimFoye wrote:

Otis wrote:

You could try the derived entity templates for adapter, available in the 3rd party section, These generate typed collections simple_smile

Ok, I will look into this. Even if the Adapter must work with a generic collection, I would like to cast it to a typed collection before I pass to the GUI. But...tell me why the adapter can't work with typed collections? I'm sure it's something obvious.

Because it was a huge burden when you extended the entity classes through inheritance. The main problem was that if you had customer.Orders, it contains 'OrderEntity' entities. But if you extend OrderEntity to MyOrderEntity, the typed collection also has to be updated and this is a true pain. (causes lots of code changes). Furthermore some clients wanted a more smaller codebase when generating code, without the typed collections they didn't use.

Frans Bouma | Lead developer LLBLGen Pro