Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inherited Business Objects
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00807500
Message ID:
00808123
Views:
10
Brian,

>The problem I'm facing is this: because business objects in MM have their own defined table and primary key, it's a problem trying to inherit one business object from another, where each business object must deal with it's own table. For example, if I create business object "A" which deals table "TableA", and then inherit from "A" to create "B", where "B" deals with "TableB", the TableName property will remain "A" unless I change it to "B". That is, I need "A" to continue to deal with "TableA", and "B" deals with "TableB". Perhaps an inheritance model is not appropriate for this kind of relationship...

In addition to what others have said (and if I understand you correctly), to answer your basic question about having a subclass specify a different default table name, you can simply set a different default table name in the constructor of the subclass. In .NET, constructors fire from the top down, so your parent (base) business object's constructor fires first, then your subclass fires afterward, overriding the parent's table name setting.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform