main logo
Subject: Re: business objects
Author: Bob Archer
Posted: 2001/10/25 09:53:14
 
View Entire Thread
New Search


<i><font color="#663300">
I could not totally agree that it is a real world representation. It is a representation of a Customer, but it is normally a representation of part of an invoice either the header or the line items. Even Then it may need more than one bizobj to update line items as you would very likely have an intermediary table e.g ProductParts.
</font></i>

Well, you are thinking Data, with the BizObj being a class to manage that data.

I prefer to think objects, the Customer Class has attributes and responsiblities. The tables are just a means to store that object.

In the case of an Invoice, on of it's attributes is a 'collection' of line items. Which, in codebook is implemented as another BizObj Class. But, that is the implementation. Having a LineItems bizobj which can't really stand alone.

Also, in the Use Case of Customer, the object could be stored in two tables, a people table which contains person_id, name, age, dob, etc. Then a customer table with cust_id, person_id, credit limit, etc. If you think Objectivly, Customer is a 'subclass' (a specialized version of a person) of Person. Yes, to implement Customer in codebook, you would have to create a view that joins Person to Customer on person_id in each table. Also, the Codebook/VFP implementation only allows you to update one view.

Wouldn't it be preferable if you could do something like...

oCustomer = creatobj('customerbizobj')

With oCustomer
.GetByName('john smith')
.CreditLimit = 1000
.MiddleName = 'boy'
EndWith

oCustomer = null

Above, you changed two attributes which are stored in differnt tables. When you create the cust bizobj you told it that MiddleName was mapped to the Person table, and Credit Limit was mapped to the Customer table. You also told it those tables are joined by person_id.

So, on the destroy of the object, it sees that two attributes have been modififed, so the UPDATE statements are generated by the persistence layer (that is the parent class of the bizobj) and sent to the appropriate data store.

So, when you describe the bizobj as a way to manipulate the data I don't think that is the purpose of a bizobj. That is the implmentation of a bizobj in Codebook.

BOb

 
©2001 Bob Archer
<-- Prior Message New Search Next Message -->