> In particular is it a deep copy of the object? ie. recursively copies all
> reference objects too?

I think there was good discussion on referances being stored in the session
and the implications of this a few days back. You can look at the archives
for details. It was pretty well discussed.

> ie. if I have an object reference that's stored in the session (the object
I
> assume) and I change some state.. If I ask for it out of the session again
> what state will it show?

If you changed the state of the object you stored in the session, then  you
will see the changed state.


> Is putting subtypes of types in the session discouraged?

I don't think it is discouraged .But you have to take care that you upcast
the value you get  to the right type.


>What I mean is not
> being consistent about the type of the object for the key and having no
> other indicator of the object other than instanceof?

You can use only a String object as the key while storing the values in a
session.
As for the values, all values are stored as objects and returned to you as
objects. It is up to you to upcast them to the proper type.


> I would feel much more comfortable using bit flags/state etc on a regular
> User type and just putting those in the sessions rather than assuming that
> under the key UESR in the session could be a User or AuthenticatedUser or
> AdminUser

If you have three different classes, which have no difference in the
functionality, but there just to diffrentiate the three types of users, then
in my opinion you do not need three seperate classes. You can just have one
class with a member variable for storing the type of the user. You can use
any other philosophy you are comfortable with.


regds
Gokul

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to