Re: Prevalence and Web Applications
Paul Bennett <[email protected]> Mon, 17 Dec 2012 08:28:37 -0500
| Newsgroups | gmane.comp.java.prevayler |
|---|---|
| Message-ID | <[email protected]> |
Elmar, Prevayler is built around the idea that all transformations on business objects are done by transactions - real objects that are submitted to Prevayler for execution. These contain all information needed to execute the transformation. Therefore, a web screen is often bound to a (new) transaction object, not a domain object. For an edit operation, this will often be the set of editable fields for the domain type, so often looks like a domain object - but it is not. It will also contain a domain reference to the object (to avoid the baptism problem) and should also contain consistency logic - e.g for an edit operation, a check that the object being edited has not been changed by someone else after this edit operation was started (and the object read), but before it was committed. This is directly analogous to multi-version concurrency control in a conventional database This can often be implemented generically, especially in a language that provides good meta-programming protocols (Groovy, Ruby, Smalltalk etc.). This removes the need for a specific edit transaction for each domain type Hope this helps, Paul Bennett On Dec 15, 2012, at 7:13 PM, Elmar Weber wrote: > Hi, > > I've a question how people use Prevalence or prevayler in web > applications. Here is a simple scenario and then the question where my > problem is: > > A simple multi user application to edit a shared data pool, e.g. a > customer management system where users can search for customers and then > edit single objects in a multi page form. > > How do you handle modifications to customer objects in the UI part of > the web application? Your typical Java web framework binds the UI fields > to your object and updates it continuously (e.g. via ajax requests) > until the user saves the changes and persists the object. > > The way I see it, it is not possible to do this with prevalence, i.e. I > cannot use the object I received from a query for a customer in the UI > because any changes would be saved in a snapshot since it is the same > instance. I either have to create a copy of the persisted object or have > a different set of objects for my UI. Both solutions seem like a > workaround to me. > > When solving this with classical ORM persistance, e.g. Hibernate and a > database, its easy to use the same objects and don't worry about > modifications until an explicit commit on the transaction. > > How do you solve this with web applications using prevalence? > > Thanks & ciao, > elm > > ------------------------------------------------------------------------------ > 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 -pb ------------------------------------------------------------------------------ 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