StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



BO inheritanceExpand / Collapse
Author
Message
Posted 01/09/2008 4:50:54 AM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 05/30/2008 10:52:28 AM
Posts: 72, Visits: 251
I have asked about this again in the past, but now I come again with new data.

The question is about beeing able to implement inheritance between BOs. For instance there is the Contact BO which is the parent, and the there are the Customer BO, the Employee BO, the Supplier BO etc. which are all Contacts. Meaning that have all the properties and functionality of a Contact, and add more properties and methods of their own.

Trying to accomblish this I have found that (besides some warning of hidden method members), it is not possible for a the child object (Customer) to keep the properties of its parent (Contact) and add some more of its own. This is because of some DataColumn objects and Descriptors that are created and added to a list by the *.Designer code. For instance, no matter if you override the CreateTableSchema method in the Customer, the Contact DataColumns will not be added because the method in the Designer code does not call its base. And even if I modify this, the next partial build will overwrite the code.

Thus in general the child object cannot add properties of its own. Am I correct in this? Has anyone managed to accomblish inheritance?

So the next thing is to actually have two BOs in a single form, and different controls in the form to bind in different BOs.

I am asking all these as a general discussion because I am trying to establish some code standards, and I am trying to find out what I can and cannot do with the framework.

Thanks

Post #13311
Posted 01/09/2008 9:21:07 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 10/21/2008 9:20:58 AM
Posts: 2,685, Visits: 1,887
The recommended way of supporting this through StrataFrame is to create a view that inner joins the super table and subtable (Contacts and Employees).  The business object would then be constructed from this view within the BOMapper.  You would then implement stored procedures for CRUD procedures (i.e. an INSERT would first insert a record into Contact and then use the PK for the value of the PK in Employees, an UPDATE would update both tables, and a DELETE would delete the record from both tables).  In order to share business logic between the subtype busienss objects (Employees and Customers that are both subtables of the supertable Contacts), you would need to place the business logic in a shared (static) location and call the methods from the sub business objects.


www.bungie.net
Post #13320
Posted 01/18/2008 12:07:46 PM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 10/26/2008 7:09:11 AM
Posts: 72, Visits: 234
In this particular design I believe that Contacts are a Many >> One relationship between Customer, Supplier, etc and not a descendent of them.  It makes it very narrow and the data is not normalized.   

Just my .02 cents.

Richard

Post #13567
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 10:02am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 11 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.