Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Referencing data elements through Biz Objects
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00948054
Message ID:
00948626
Views:
10
David,

>I have been evaluating MM for a couple days now and am having problems understanding the Business Object model and how it related to the data object. It appears that the mmBusinessObject inherits from the dataset, but I can find no way to reference individual column data. For example, if I have a BO called Category, then shouldn't I be able to reference the fields in the table as Category.CategoryID or Category.CategoryName in accordance with Object Oriented patterns?

You can actually do this now by adding properties to your business object that reference the underlying DataRow property. For example:
public int CategoryID
{
   get { return this.DataRow["CategoryID"]; }
   set { this.DataRow["CategoryID"] = value; }
}
Alternately, you can create enumerations for your database fields so you can use an integer to specify the column, rather than the name (which incurs a slight performance hit). For example:
public int CategoryID
{
   get { return this.DataRow[Category.CategoryID]; }
   set { this.DataRow[Category.CategoryID] = value; }
}
Regarding O/RM, it's the main feature we're working on after we finish incorporating Infragistics Windows controls into MM .NET. This is similar to Microsoft's ObjectSpaces technology...the nice part of O/RM is that it adds a layer of abstraction to data access. The down side is the performance hit you pay for this layer of abstraction. Using the data-centric approach MM .NET currently takes is definitely the fastest way to retrieve and bind data. That said, we do appreciate the value of abstraction and that's why we're adding this as an option for developers who are interested in O/RM.

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