On Jan 5, 2008 5:15 AM, Dan Kaplan <[EMAIL PROTECTED]> wrote:
> Yeah that makes sense. Since we're sorta on the topic, I thought I would
> ask this question. As the User object goes from being initially registered
> to its profile being edited, how does one update the User in the session and
> the db simultaneously?
>
> Here's a scenario: A user registers with your website and later adds a
> signature that is to show up on every post he makes.
>
> Do you add an instance of a UserService to your WebSession and then have
> this in it:
>
> private User user;
>
> public synchronized void setUser(User updatedUser) {
> userService.updateUser(updatedUser);
> this.user = updatedUser;
> }
>
> public synchronized User getUser() {
> return this.user;
> }
>
> ? Cause I've been doing something like that. Is there a better way to go
> about this?
Looks fine to me.
Eelco
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]