Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Session Environment
Message
De
19/06/1998 15:24:31
Bob Lucas
The WordWare Agency
Alberta, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00109703
Message ID:
00110050
Vues:
27
Kevin;

Going over the whole issue of session environments, I decided to revisit what I knew about how it is all working. In my own code I have updated the global session object with my global session settings for things like date, near etc. this is done in the object goApp.oEnvironment.oSessionEnvironment. I had assumed that these settings would be transferred to the form sessionenvironment when a new form instantiated. I think this is more appropriate behaviour rather than having to set the session values on each business object. Things like the date setting should be global.

Well, my assumption is wrong and there is no transfer of values. So I went about modifying the cSessionEnvironment subclass in a couple of ways. I added two new properties. lUseGlobalSession, and oGlobalSession. lUseGlobalSession is defaulted to true and oGlobalSession is initialized as a reference to goApp.oEnvironment.oSessionEnvironment. Then in the set method, if lUseGlobalSession is set to true and oGlobalSession is an Object, I use the property values from this object for setting, rather than the current object's property values. This allows setting the date format in once place and have it carry through to the data sessions by default.

Another point. I think a form only needs one sessionenvironment object and so this object deserves to be part of the cbaseform class and not in the business object (where the settings get set for every business object on the form!)

What are your thoughts on this?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform