Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set and Get appl obj property good practice
Message
De
31/07/2009 17:02:23
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
31/07/2009 09:22:30
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01415630
Message ID:
01415724
Vues:
53
>As to get and set methods... I understand that in Java, for example, this is the recommended practice, to encapsulate (hide from other parts of the program) details about the internal workings of the class. However, in Visual FoxPro 6 and later there is another way to do this - access and assign methods. In other words, you may decide to store a value in an object property, which has a certain name, type, and data structure. But if you later decide to change the internal workings of the object, you can intercept calls to the object, from outside, with access and assign methods - and store the information in a completely different way - without having to change programs that call it.
>
>Now, I don't know whether this is a "recommended practice", but it does give you an alternative.

It is recommended, by me :).

To differ from those code-heavy tools, in VFP you don't need to write the Get and Set methods (aka _access and _assign), because you can make any property directly available without writing a single byte of code. But you can, if you want. So, the best of both worlds - available and not mandatory.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform