G
Guest
If I am going to create an instance of an object and only use it in one place
(in a button click event handler), should I just create an instance of the
object in the handler and use it's method, or create it in the page_load and
put it into Session, retrieving it when the page loads each time?
The object does not retain any information, just performs a calculation and
returns the result.
What are the advantages of one over the other?
I could make this one method shared and not even have to create an instance
of the object, but would like to get an idea as to the mechanism of web pages
and objects.
(in a button click event handler), should I just create an instance of the
object in the handler and use it's method, or create it in the page_load and
put it into Session, retrieving it when the page loads each time?
The object does not retain any information, just performs a calculation and
returns the result.
What are the advantages of one over the other?
I could make this one method shared and not even have to create an instance
of the object, but would like to get an idea as to the mechanism of web pages
and objects.