Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
App Object Pros/Cons?
Message
 
À
19/10/2001 09:28:23
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00570766
Message ID:
00570803
Vues:
25
>>I have never used an application level class in my projects and
>>would like to know what are the pros and cons (if there are cons)
>>of doing so?
>>
>>Any article/thread you remember that would discuss this or give examples
>>would be appreciated.
>>
>>Thanks
>>
>>Pascal
>
>The idea is to have a single global variable (the application object), that store important information about your application. Important information is stored in the object's properties, including array properties.
>
>Information you might store in the application object might include:
>
>
  • Names and visibility of toolbars before entering the application (to restore them later.
    >
  • User login name.
    >
  • A list of open forms.
    >
  • The current language, for multi-lingual applications.
    >
  • The current data directory, and database.
    >
  • All sorts of global preferences, that apply to all forms: on delete, confirm save, etc.
    >
    >The global application class can also have methods that are application related, including login, logout/cleanup, Open Form (this will add the form to the MyApplication.Forms list), and many more.
    >
    >I see advantages, but no disadvantages (except for the initial effort in programming it).
    >
    >HTH, Hilmar.

    One disadvantage that at development time if you want to test your form (which relies on existence of the application object) separately, without running the whole application, you have to make sure that application object exists.
    As far as I know, many commercial frameworks include this ability into the framework environment. They customize the development environment to automate starting the application object when necessary. This applies to any other kind of necessary global objects too.
    Nick Neklioudov
    Universal Thread Consultant
    3 times Microsoft MVP - Visual FoxPro

    "I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
  • Précédent
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform