Re: State Management

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John M Deal (johndeal_at_necessitysoftware.com)
Date: 11/09/04


Date: Tue, 09 Nov 2004 10:42:41 -0800

The only issue to be aware of (in your collection scenario) is
serialization. If the collection that you put the objects is not
serializable you'll get an exception if someone decides to activate SQL
or Out-Of-Process session state as these session storage methods
serialize the object across process boundaries when storing and
retrieving the data. Of course this assumes that you use session to
temporarily store state.

You mentioned other ways of storing the user data each has its own
issues. You don't want to use the application level storage for
handling the storage of user specific data as you're giving every user
potential access to every other user's data, not to mention that the
data will stick around in memory until the application ends or you take
pains to shut it down. If you are looking at cookies you'll need to
make a call on how much data you want to store and transmit across the
line between the user and the server.

We've found that on the whole using serializable data containers to
store data in Session seems to be the most flexible and manageable
solution to temporary storage of state. We usually abstract the calls
to state storage in a wrapper class so that we can change the storage
methodology as our needs dictate (i.e. custom storage repository,
security requirements...).

Have A Better One!

John M Deal, MCP
Necessity Software

Richard wrote:
> Can collection classes be used to store session data? In a couple of books on
> ASP.Net where they discuss state management (to capture a user's input data),
> they talk about session and application objects, cookies, statebag, etc.
>
> But if I have a checkboxlist, can't I just iterate through the selected
> items and store them in a collection class for use in later pages in the web
> app? Would there be implications of doing it this way?
>
> Thank you,
> Richard



Relevant Pages

  • Re: State Management
    ... John, ... > serialization. ... > temporarily store state. ... > handling the storage of user specific data as you're giving every user ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: nullreferenceexception for Private Object Variables
    ... In process session state can store the object as is in memory, ... serialization. ... > actually store objects themselves, or just XML representations of them? ... >> |> I have created a class which contains some private object variables, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Storing objects in Session variables
    ... "If you are using InProc mode, objects stored in session state are ... and so you can store whatever object you have ... framework serialization functionality or through any other serialization ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Serialization in asp.net
    ... Application never uses serialization as it just a reference to the object. ... >> When you store your object in the Session or the Application I'm ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Passing objects between HMTL pages
    ... When the user navigates to another section ... Some form of serialization ... Use a session to store it (which will store it in a file in a folder, ...
    (alt.php)