Static Classes in Web Applications

T

thomson

Hi All,
Can any one tell me the demerits of using static classes in
Web Application,what is the scope of this kind of class


Thanks in Advance

Thomson
 
G

Gustavo Ringel

if you think about static classes like the Math class you can use it in all
your Web application if you need to. The same idea is for a Static class
that you can develop. There are no demerits for this...

In general i use static class for utilitary clasess like getting a
personalized Date Format, because I don't want to be creating instances of
this classes for a simple activity.

Gustavo.
 
E

Eliyahu Goldin

The application scope. Meaning multiple user sessions will be accessing the
same data.
 
O

Onwuka Emeka

some gotcha's though when using static classes and variables in ASP.net
http://onwuka.blogspot.com/2006/01/static-varibles-in-aspnet_28.html


Eliyahu Goldin said:
The application scope. Meaning multiple user sessions will be accessing
the same data.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


thomson said:
Hi All,
Can any one tell me the demerits of using static classes in
Web Application,what is the scope of this kind of class


Thanks in Advance

Thomson
 
T

thomson

Yeah application scope is Multiple users accessing the application, ok,
when i call a page in that i called a static class, so u trigger the
class to be in the heap [guess], so it wont be affected by any garbage.
So when another user access the same application whether we are
accessing the same


Onwuka said:
some gotcha's though when using static classes and variables in ASP.net
http://onwuka.blogspot.com/2006/01/static-varibles-in-aspnet_28.html


Eliyahu Goldin said:
The application scope. Meaning multiple user sessions will be accessing
the same data.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


thomson said:
Hi All,
Can any one tell me the demerits of using static classes in
Web Application,what is the scope of this kind of class


Thanks in Advance

Thomson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top