.NETGURU
Application vs. static state
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcache' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Dan Green (VIP)
In a previous thread, Mr. Rob Howard has done a superb job of talking
about the Application vs. Cache objects.

What about Application object vs. static fields. If we have a class
that needs encapsulated shared state, is there a reason to use the
Application or Cache objects instead of just static fields?

Dan Green
[ http://dotnetdan.com -- putting the dan in .net ]

[Original message clipped]

Reply to this message...
 
    
Rob Howard (VIP)
Hi Dan,

If the data is encapsulated within the class and you have no need for
dependency features, such as those available with the ASP.NET Cache,
static fields would be best.

Note, static fields are also faster to access than Application/Cache -
but not enough for you or I to notice a difference ;)

Thanks!
Rob

-----Original Message-----
From: Dan Green [mailto:Click here to reveal e-mail address]=20
Sent: Saturday, January 12, 2002 3:42 AM
To: aspngcache
Subject: [aspngcache] Application vs. static state

In a previous thread, Mr. Rob Howard has done a superb job of talking
about the Application vs. Cache objects.

What about Application object vs. static fields. If we have a class
that needs encapsulated shared state, is there a reason to use the
Application or Cache objects instead of just static fields?

Dan Green
[ http://dotnetdan.com -- putting the dan in .net ]=20

[Original message clipped]

| [aspngcache] member Click here to reveal e-mail address =3D YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp =3D JOIN/QUIT

Reply to this message...
 
    
Todd Carrico
You will still have to decide where to put your "object" (the one with the
static field), i.e. does the "data" need to be available across page
requests for a single user, or application wide for all users?

Same question, just a different object.

tc

-----Original Message-----
From: Rob Howard [mailto:Click here to reveal e-mail address]
Sent: Saturday, January 12, 2002 5:06 PM
To: aspngcache
Subject: [aspngcache] RE: Application vs. static state

Hi Dan,

If the data is encapsulated within the class and you have no need for
dependency features, such as those available with the ASP.NET Cache,
static fields would be best.

Note, static fields are also faster to access than Application/Cache -
but not enough for you or I to notice a difference ;)

Thanks!
Rob

-----Original Message-----
From: Dan Green [mailto:Click here to reveal e-mail address]
Sent: Saturday, January 12, 2002 3:42 AM
To: aspngcache
Subject: [aspngcache] Application vs. static state

In a previous thread, Mr. Rob Howard has done a superb job of talking
about the Application vs. Cache objects.

What about Application object vs. static fields. If we have a class
that needs encapsulated shared state, is there a reason to use the
Application or Cache objects instead of just static fields?

Dan Green
[ http://dotnetdan.com -- putting the dan in .net ]

[Original message clipped]

| [aspngcache] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp = JOIN/QUIT

| [aspngcache] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp = JOIN/QUIT

Reply to this message...
 
 
System.Data.DataSet
System.Windows.Forms.Application




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification