Does inheritence allows using overlappings' entities?

Posts   
 
    
Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 10-Nov-2005 07:42:31   

Hi,

Can I use overlapping entities, ie. is it possible, the one entity to be in more than one subtypes?

The typical example: The party has suppliers and customers subtypes. Is it possible, that the supplier is a customer too?

Thanks

Gabor

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 10-Nov-2005 09:36:43   

no, as that would be multiple inheritance (in a wicked way) which isn't supported. Inheritance is subtype inherits from supertype, it doesn't mean it inherits from sibling simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 10-Nov-2005 16:59:12   

Thanks Frans,

But this situation is easy to represent in relational datamodel:

Party supertype table with two child tables with one to one relationship to its subtypes tables: cutomer and supplier. (TargetPerEntity I think)

Each table contains only specific attributes, and the supertype contains the common ones.

The subtypes not inherits one from another, only from parent, so why it should be multiple inheritence? The customer never had Organizational Tax No, but the supplier has, so only the supplier's table has this column, but the customer doesn't.

Both subtype's tables contain the same supertype key only, if the given party is in both subtypes. It's not clear for me, why LLBLGen can't implement this situation?

So how to implement this model simply with LLBLGenPro?

Thanks in advance

Gabor

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 11-Nov-2005 11:51:17   

Gabor wrote:

Thanks Frans,

But this situation is easy to represent in relational datamodel:

Party supertype table with two child tables with one to one relationship to its subtypes tables: cutomer and supplier. (TargetPerEntity I think)

Each table contains only specific attributes, and the supertype contains the common ones.

The subtypes not inherits one from another, only from parent, so why it should be multiple inheritence? The customer never had Organizational Tax No, but the supplier has, so only the supplier's table has this column, but the customer doesn't.

Both subtype's tables contain the same supertype key only, if the given party is in both subtypes. It's not clear for me, why LLBLGen can't implement this situation?

So how to implement this model simply with LLBLGenPro?

But that's not what you explained in the startpost.

In the model you describe here you have a supertype 'Party' and a subtype Customer and a subtype Supplier. In such a setup, customer can never be a supplier, because customer doesn't derive from supplier. Create the classes in .NET and try , you can't cast customer to supplier and vice versa.

Frans Bouma | Lead developer LLBLGen Pro
Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 11-Nov-2005 12:38:26   

Thanks Frans,

Your' right, but the above mentioned model easily implementable in datamodel, if we include the supertype's ID into both subtypes.

How to realize them on object model?

Gabor

Gabor
User
Posts: 97
Joined: 29-Jan-2005
# Posted on: 11-Nov-2005 13:22:48   

Read the help, please ignore confused