I think something needs to be done so that the same user object stays with a
session when going from an anonymous state to a logged in state.  The user
should probably be dumped at logout, but this would be application
dependent.

Here is my proposed solution.
1.  TurbineUser retrieveFromStorage method should return this, a reference
to itself.
2.   The doSelect method in TurbineUserPeer should add an argument User.  (A
new method with the original signature will pass a null user to the
doSelect(Criteria, User).)
3.  The new doSelect method will check for a non-null User and can either
throw an exception or just proceed and use the given user as the first
element in the event that multiple users are retrieved.
4. The basic assumption being that one User's info is being retrieved and
the supplied User object should be populated.
5.  TurbineUser retrieveFromStorage would use the new doSelect method
passing in a reference to itself.

This is one way that would allow information (stored in the temp hash, for
example,) to survive the login process.  Another simpler solution would be
to just copy the temp hash from the anonymous user to the logged in user,
but I do not favor this method.

Does this accomplish your goal?

----- Original Message -----
From: Chris Kimpton <[EMAIL PROTECTED]>
To: turbine mailing list <[EMAIL PROTECTED]>
Sent: Wednesday, May 10, 2000 6:05 AM
Subject: Anonymous User - UserFactory.getUser() - why?


>
> Would it be valid to split this into 2 methods, getShellUser() for the
peer case, which works as per the current getUser and returns a new one each
time and getAnonymousUser() for the login/logout scenario, that returns a
fixed known anonymous user (ie a singleton - set the first time its called
and returned upon subsequent calls - obviously in a threadsafe manner).
>
I cannot see a justification for making a User object a singleton, maybe you
can try making your case clearer.



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to