Jonas Ekstedt wrote:
On Thu, 2004-10-28 at 12:50, Reinhard Poetz wrote:
After reading it once, one question: Do you see any way to integrate your ideas into Cocoon Forms?
One part that I believe could be incorporated into CForms would be how
the view model is populated.
That's the "ugly" I was mentioning in my previous post : this is a very dangerous approach, similar to the now defunct XMLForm (see [1], "mapping to the application data model"). Having a direct and live mapping from the form to the data model is an open door to inconsistent business data in case validation fails.
Furthermore, just like XMLForm, your approach doesn't allow smart convertors to be defined, taking into account formats, locale, etc. And validation occurs on strings, which is just why we rejected the use of Commons Validator, as CForms widgets have strongly typed values.
However, there are some good points in your approach, namely the reduction of the number of files: separation of form model and business data is a must have for robustness and security, but needs some additional work.
Reducing this work could be achieved by specialized widget types, e.g. a "BeanWidget" that would be a container that automatically creates child fields for all or part of a JavaBean's properties, and similarily implements the binding.
For the wizard thing, the upcoming widget states [3] (I know, I'm late on this...) will give an immediate solution, as building a wizard will simply consist in changing the state of container widgets and choosing template parts depending on that state.
Sylvain
[1] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=105881304808076&w=2 [2] http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=109765913421574&w=2 [3] http://issues.apache.org/bugzilla/show_bug.cgi?id=31647
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
