cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: A widget framework (long)
Date Thu, 28 Oct 2004 13:06:07 GMT
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 Wallez                                  Anyware Technologies 
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }

View raw message