Otis wrote:
Though, what's the start entity of the relation (e.g.: Start entity 1:n end entity ) ? If you say: the abstract base class without mapping, that's not true, because it can't be used as a relation for the entity.
The elements llblgen pro offers are for using the entities in the entity model, which are represented by containers in code and table/view definitions in the db (with inheritance eventually, see Object Role Modelling, http://www.orm.net). It thus doesn't make sense to define relations between entities in code, as the entities in code are containers for the entity data (== the entity).
[urldescription="Please read my essay about this here"]
http://weblogs.asp.net/fbouma/archive/2006/08/23/Essay_3A00_-The-Database-Model-is-the-Domain-Model.aspx[/url]
My motivation to have an abstract base class (without table) with concrete subclasses is to avoid the overhead of joins and multi-table updates in scenarios where the bulk of the operations are on the distinct concrete subclasses rather than the base class. E.g. customers and suppliers share many functional characteristics e.g. contacts, addresses etc. but are semantically very different and therefore polymorphic operations on them may be fairly rare. In such cases, it would be ideal to have a mechanism that allows the common functionality to be in one place (abstract base class) but the data management overhead to be optimised for non-polymorphic operations.
I read your essay and have to confess to being drawn toward the MDA camp that would like to model in uml and have the code and db generated from there. However, having used LLGLGen Pro for a (little) while I find the pragmatism and closeness to the database compelling and reassuring and the templating looks to be an excellent feature. As you say "there is no clear "this is how you do it" answer to that question". Do you think there may come a time when the LLBLGen design process can start with a class diagram instead of a database?