Information générale
Catégorie:
The Mere Mortals Framework
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement