Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What purpose using application object ?
Message
 
 
À
18/03/2006 13:26:16
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01105512
Message ID:
01105571
Vues:
29
>>>For instance, it can be a problem to have many global variables. (The application object is a single global variable, which stores, in its properties, many different things.)
>>
>>PMFJI,
>>
>>What type of kind of a problem you can have with many global/public variables? I do use public variables in my application and would like to know when (at how many of those) I should start changing from public variables to one object.
>
>The problem with global variables lies in any piece of code being able to change the content at any time, especially unexpectedly.
>
>An object can control the circumstances of property changes. Further, a class has property descriptions as well as the property name and value. This makes for self-documenting code. Safer than public variables and more descriptive means better in my opinion.

I understand that using object is better in terms of all the reasons you and Woodie mentioned. I thought Hilmar was pointing to a technical reason like draining memory or slowing down application when he said "problem with many public variables."

Thank you both for your input.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform