Versions des environnements
Hi,
>>I think to do that you'd need to make a 'deep-copy' (cloning just gives a shallow copy). It's possible to do that by serializing an object and deserializing to a new object - but all contained objects also need to be serializable so, for a complex object, it can easily become too complicated and time consuming.
>>
>>Did you consider the suggestion of using a class scoped to the request?
>
>Not yet, I would prefer to wait until the last minute, assuming no other way. I also need to avoid making that too complicated as I am something workable now.
>
>Rick mentioned that I could scope the properties with static. What do you think about that?
The real gain would be in using static constructors to initialize the Framework. It would certainly help with handling the global level properties - static constructors would, as Rick says, only run once (the very first time the framework is instantiated) - subseguent instantiations would have those properties already set - and that might reduce the initialization overhead enough to make using new Framework objects on each page hit acceptable ?
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