Hi hertendreef,
If i were to make use of this feature (serialisation) then i would do following way ( just an example).
suppose, your web application has lots of configuration on web.config ,and there can be other session values which u need on most of the pages.
now i can make a class ( with serialisation support ) like this
class user
string stylesheet
string applicationpath
string fullname
string country
string city
int id
string Language
string dbconnectionstring
....
....
end class
i can create an object from the class, set all the values, some of those values comes from web.config and some of them come from database after user logs into the application successfully.
now when user navigate from one page to another, i need not retrieve those values from database again and again, i can serialise that object, save this on on session variable and use this again to create new object (deserialize) whenever i need those values. In that case there will be less stress on database , and save lots of coding time.
e.g. u can get those values by simply wrting objUser.stylesheet.
this process may not give full advantage if there is small number of user settings which application has to remember or retreived from database, but if there are large number of values which need to retreived from database, then it can be a big advantage.
this is just an example, there can be other situations, where exact object state need to memorized e.g shopping cart ( if you do not want to save all the visitors cart on database), user profiles on games application etc. in such cases Serializable feature will be very helpful.
hope this helps to you.
Regards
Bishnu Pokharel
[email protected]
http://www.bishnupokharel.com.np/