Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Including auxillary properties on Business Objects?
Message
From
07/07/2009 14:43:10
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Including auxillary properties on Business Objects?
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01410655
Message ID:
01410655
Views:
130
I've begun working more on the practice of creating a Busniess Object where I scatter properties of the current row onto a custom class which has some methods that can also be called to do things on the entity or return info about it.

For instance, I have a Job Business Object which will have a property for each field in the table (from scatter name ...) and some methods relating to working on that Job.

Now, There is therefore, by way of scatter, a property for the Customer Number, called CustNo. But I want to go ahead and create a CustomerName property on the Job object also so that I can just refer to that property on the Job object when displaying or reporting against it, and avoid having to otherwise resolve the Customer Name everwhere I need it. So, is this a good practice? Creating these "auxillary" properties on a Business Entity / Business Object like this? Oh yeah, then I might want the phone number too? Where will it end?

I'm sure the more pure OO/BO approach would be to go ahead and create an entire Customer object on the Job Object, and reference oJob.oCustomer.Name, right?

Is my first idea cheating or a lazy/beginner approach?
Next
Reply
Map
View

Click here to load this message in the networking platform