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.
The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral
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).