Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form objects tied to Business Objects or Data?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00399801
Message ID:
00399866
Vues:
22
Hi Kevin,

There are two schools of thought on this one: the purists and the functionalists.

The purist approach is that tier separation should be absolute, therefore they will say that what you're saying is the right way to do things.

VFP, however, is MUCH faster dealing with cursors (data) than with an object's properties, so the functionalists (me included) will say that the business object's duties do not include actually handling the data, but just bringing the appropriate cursors on board and navigating, or deleting or creating new records. Besides, tier segregation is achieved anyway because the form doesn't have to know where the data came from. The data is placed on a particular view by the bizobj and that's all you need to know at design time.

Quoting a bit from the MereMortals framework manual, to address field values through properties in a business object falls apart in two areas: 1. You can't assing the value of a GENERAL field to a property. 2. How do you deal with multiple records (i.e. a busobject that feeds a combo box)?

If you use msde or sql server, things may change a bit: Jim Duffy's DataClass2000 (for sql server/msde based databases) does its magic the way you mentioned: fields in a table become properties of the business object. YET, when it has to deal with a group of child records related to a parent record brought up by the bizobj, he does it through cursors.


>Hello,
>
>I just starting reading Markus Egger's book on OOP and VFP and it got me thinking about my own designs. I think I am doing pretty well on OOP in UI, but I am a little weak on the Business Object side of things. Now for the question:
>
>I have data entry forms whose data fields' controlsources are directly tied to buffered VFP views that are set up in the DataEnvironment. According to proper OOP design (or n-tier type design), should these data fields be tied to business object properties and then the business object communicates with the data via getdata(), savedata() type methods? If so, doesn't the whole dataenvironment thing seem to be an impediment to separating the UI/business objects/data?
>
>Oh well, I just started chapter two, so I am sure these questions will be answered.
>
>Kevin
Low-carb diet not working? Try the Low-food diet instead!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform