Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper Encapsulation Techniques?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00131613
Message ID:
00133200
Vues:
13
I've considered binding controls to bizobj properties rather than to fields. But, while this sounds like great object-oriented design, it seems this would be an incredible headache and a real speed cow. With this design you would need to update the properties for every record pointer move. Maintainance would also be problematical. Adding or modifying fields in your tables would require you to go back and update your bizobj structure.

>Michael,
>
>You have to separate the bizObjs properties from the fields in the tables. You data bind to the properties of the bizobj and then provide an Update method for updating the fields from the properties. In this scenario the interface controls are not directly altering the fields, they are altering properties of the bizobj, the buzobj will update the tables when its update method is called.
>
>In VFP6 I've used Assign methods to do this, in VFP5 my bizobj has a SetField() method that takes two arguments, the field name and the value to assign. I prefer this to the individual properties approach because a generic bizobj can hide a lot more of the functionality thus reducing the code added to each specific bizobj class definition.

Michael G. Emmons
memmons@nc.rr.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform