Versions des environnements
Network:
Windows 2003 Server
Why not? What make you think otherwise?
I don't agree with adding a public property to the class. Why pollute the class with something that is used as a local variable? Public on top of that.
I understand that you want to limit the number of object instanciated, but you increase the chance of a side-effect. When recycling an old object, you need to be sure to reset all the properties to their original values. You may write your code now to do that, but if you (or someone else) add a new property to the class and forget to reinitialize this new property in the code, you may get a undesired side-effect. Much simplier to let the garbage collector do his job.
>I don't think the objective is to create a variable in each read.
>
>Alternatively we can create a public property site in the class declaration.
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