Adapter Manager Templates

Posts   
 
    
jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 30-Jan-2007 16:40:04   

I just started experimenting with Template Studio. (Very cool btw) I tinkered with the AdapterEntity template to add the CreateValidator override.

After I figured that our I took a look at the manager templates for adapter. (3rd party download). I don't quite get there purpose. They seem to be a collection of static methods with simplified access points that can hide the adapter from the calling layer. GUI I presume.

The manager base does not protect or mark methods as virtual/abstract. the entity specific managers inherit the base manager, so all methods become available. This allows entity specific managers to mix & match with other entities. Example:

//define filter, sort, prefetch, adapter...
EntityCollection orders = new EntityCollection(newOrderEntityFactory());
CustomerManager.FetchCollection(orders, filter, sort, prefetch, adapter);

in essance your excuting commands that have nothing to do with a customer using the customer manager. I assumed this would go against the principle of the entity specific manager.

in some ways it seems the manager templates are a BLL like that of HND. The difference is HND business logic is specific to the project where the manager templates are generic and can be applied to multiple projects.

Does this seem right, or am i way off?

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 31-Jan-2007 07:14:33   

in some ways it seems the manager templates are a BLL

That's how I understand it too.

Manager classes should be used in the BL in case you don't want the GUI to directly call the DAL.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39776
Joined: 17-Aug-2003
# Posted on: 31-Jan-2007 10:47:59   

They are a 3rd party contribution and I never saw the necessity for them that much, though others found them very useful simple_smile . I think it depends on how you want to work, the templates generate a set of utility classes which help you fabricate prefetch paths/filters etc. more easily at least for a fixed set of occasions. (that's what I understood of the templates).

Frans Bouma | Lead developer LLBLGen Pro