SgDotNet
Singapore Professional .NET User Group -For Cool Developers

Avoid use of Application object

rated by 0 users
This post has 1 Reply | 2 Followers

Top 10 Contributor
Posts 2,284
icelava Posted: 05-19-2005 4:56 PM
 Shunjie wrote:
Example, like keeping a collection of objects which is going to be the same to all user, so like what I did in my previous code, create a single instance of the class, and save it to a Application session.

It is important to note that the instrinsic Application object remains in ASP.NET purely for backward compatibility with classic ASP, and should be superceded with the use of the Cache object/API. The Cache API provides a whole lot more levels of granular control over the life of the items stored, and avoiding the STA (Single-Threaded Apartment) model the Application object is slaved to (thus no locking).

The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral

Top 25 Contributor
Posts 485
 icelava wrote:
 Shunjie wrote:
Example, like keeping a collection of objects which is going to be the same to all user, so like what I did in my previous code, create a single instance of the class, and save it to a Application session.

It is important to note that the instrinsic Application object remains in ASP.NET purely for backward compatibility with classic ASP, and should be superceded with the use of the Cache object/API. The Cache API provides a whole lot more levels of granular control over the life of the items stored, and avoiding the STA (Single-Threaded Apartment) model the Application object is slaved to (thus no locking).


I always thought that both of them (Cache and Application) serve different purposes. Thanks for enlightening me Big Smile [:D]
Yes, another version, another round of headaches. But that's progress.
Page 1 of 1 (2 items) | RSS
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems