I have a web application where I would like to pull user settings from a database and store them for Global access. Would it make more sense to store the data in a Singleton, or a Session object? What's the difference between the two?
Session object, definitely.
Singletons exist at the process level. This means that if you have 20 users accessing your site at any given moment, they're using the same singleton object. It's difficult to get used to this concept if you're not doing web development a lot.
Sessions exist at the user level. That means you can store data per user, not per process.
Ref:
http://stackoverflow.com/questions/2821941/session-vs-singleton-pattern
Subscribe to:
Post Comments (Atom)
Abstract Factory Vs Factory Method
Abstract Factory Provides an interface for creating families of related or dependent objects without specifying their concrete classes ...
-
Stored Procedures are pre-compile objects which are compiled for first time and its compiled format is saved which executes (compiled code) ...
-
Web API 1. This is the new framework for building HTTP services with easy and simple way. 2. Web API is open source an ideal ...
-
There are many technologies used to build .NET Web applications. To build effective application-level authentication and authorization s...
No comments:
Post a Comment