swallace wrote:
Can you tell us a bit more about the purpose for this one? Did I miss a thread somewhere that explained it?
It's the template set which is described here: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=168
and in other threads as the 'new template set' Basicly it's a bit more advanced than the current template set which now has a name: 'SelfServicing' (because entities serve themselves).
You get 2 projects, a database generic one and a database specific one. The database generic one contains entities, factories, typed lists etc. but no database specific classes at all. Entities also don't have a save method or any logic which does anything with a data access object (DAO). All that information and logic is stored in the database specific project. There, the persistence information for each field and entity is stored plus a generic DAO object which can persist any entity and work with any set of entities and query. This DAO object can do a lot more than the current one, for example keep a connection open so you can perform multiple queries over the same connection (for example loading all data for a webpage or BL component), and it can accept a connection string and load config info from the .config file. What's also important is that the DAO object connects an entity with teh persistence info of its fields, which means that you can program against 1 database generic class set, and have 2 database specific projects: one for oracle and one for Sqlserver. It's the plan that it should be possible to for example load an entity from oracle and save it in sqlserver (just an example what's possible )
What's even better is that there will be a generic collection class. This has a big advantage over the selfservicing model, because now you can inherit from the generated entity classes and still use the collection class. With the selfservicing template set you can't, or at least you lose the typed indexer. The generic collection class is of course not equiped with a typed indexer, but contains a more generic property descriptor engine so your inherited classes with for example new (not persisting) properties will be handled correctly in a databinding environment.
This requires some refactoring of the ORM Support classes library, but the plan is that current code will be compatible with the new lib (the new template set gets new base classes)
Personally I'm happy with the design of this template set, as it offers more extensibility of the classes with for example a manager object which controls DAO objects and a cache object. It also is more down to earth so it will lack some 'ease of use' things like myCustomer.Orders[0].Products, because an entity doesn't know how to contact the database, however it will be possible to populate entities when they're fetched with all their direct related objects directly, using a DAO property. The Adapter DAO object will be extended in the coming months to get more functionality like easier fetching of related objects using a serie of related entities as 'join path'.