Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One to One Entity
Message
 
To
12/06/2006 12:23:17
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01128468
Message ID:
01128567
Views:
20
Darrell,

>I am using an existing DB. There are two tables that have a one to one relationship. The second table contains extended information from the first table. What is the best way to take advantage of the MM framework. Create two Business Objects and make the second a child (thus using the built-in functions such as savedataset) or create one Business Object and override the savedataset functionality?

You can do it either way, but you will probably end up writing less custom code if you create two business objects. You can morph them into one object by having one object "own" the other, and instantiate it as needed. For example, your "owning" business object could have a lazy-loaded property to reference the other business object like this:
public MyOtherBusinessObject OtherBusinessObject
{
   get 
   {
      if (this._otherBusinessObject == null)
      {
         this._otherBusinessObject = new MyOtherBusinessObject();
      }
      return this._otherBusinessObject;
   }
}
private MyOtherBusinessObject _otherBusinessObject;
Best 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