Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Public variables
Message
 
À
13/06/2002 13:20:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00667392
Message ID:
00668112
Vues:
26
Fernando,

The reason for not using PUBLIC vars is simple. The domain for a PUBLIC variable (what makes it different from a PRIVATE) is that it lives beyind the end of the routi9ne that creates it. Thius means that if you NEED a public var it is because something at a higher level in the calling stack is dependant on what occurs in the routine that "needs" a public. This si a violation of the basic programming principle of encapsulation, that is any routing should have everything it needs within it self or receive those things as parameters.

Plain and simple, PUBLIC variables violate an essential principle in "good" programming practices. BTW, Encapsulation is not just OOP it is structured programming as well. Encapsulation says that no routine should ever depend on another routine for its own proper functioning (except for arguments passed to it).

JimB
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform