General information
Title:
Including auxillary properties on Business Objects?
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only