Re: Prevalence and Web Applications

Naveen Chawla <[email protected]> Sun, 16 Dec 2012 23:12:01 +0000
Newsgroups gmane.comp.java.prevayler
Message-ID <CAGs7EcX4K-=PKQjqqs=VBp7U_1DXMBWSU2a-EyBmimSKxCitOg@mail.gmail.com>
>From the sounds of it (since you said transient), it sounds like you don't
want to persist uncommitted data at all. In that case, as Klaus said, the
UI fields are your temp data. Editing them won't change the object unless
your software instructs it to. You can just commit the stuff in the UI
fields whenever you want (whether client or server side).

Even if you wanted to persist data upon keystrokes as "uncommitted" in
relation to your main data (like auto-saving "drafts" or something) you
still wouldn't need to clone anything. You'd literally just use the same
prevalent object and have e.g. a "drafts" part of each user. "Committing"
it then is simply a matter of transferring it within your prevalent object
- no cloning. And nothing transient.

Yeah you could use UI to object binding in Vaadin to accomplish either of
the above schemes. In the first one, just let it update the bound fields
when the user presses the appropriate button. In the second, let it update
the bound user's "draft" upon keystrokes, then when they press the
appropriate button, instruct to transfer that draft to the main part of
your prevalent object. All in Prevayler transactions. (Caveat I've never
used Vaadin)

On 16 December 2012 13:35, Elmar Weber <[email protected]> wrote:

> > But if you need whatever they type to be saved while they type it, on
> > the server-side, for later retrieval (maybe in case they want to log off
> > and come back again after a few days and see it?), just not in the
> > "main" data, you'd still put it in the prevalent object, just on a
> > "side" variable, with your own custom "commit()" method, for example, to
> > transfer it to the "main" bit when they want it there instead.
>
> So basically create a working copy of the object for an edit form? Since
> there are potentially multiple users woking on the same prevalent object
> one (transient) working copy of the values would not be enough.
>
> > If you're talking about simple data UI binding with server-side Java
> > objects itself, there are frameworks like Vaadin that offer that if you
> > haven't already committed to a platform. Although this is super-elegant,
> > it isn't really needed if you already have. I'm not using it (because I
> > want client-side flexibility).
>
> AFAIK Vaading also keeps the state on the server side? Although I do not
> know if it updates the objects on Ajax requests like JSF does.

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d

_______________________________________________
To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
_______________________________________________
"Databases in Memoriam" -- http://www.prevayler.org