cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <>
Subject [cforms] refactoring questions (was Re: cvs commit: cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel
Date Tue, 20 Apr 2004 22:29:26 GMT wrote:

> mpo         2004/04/20 15:19:27
>   Modified:    src/blocks/forms/java/org/apache/cocoon/forms/formmodel
>   Log:
>   Another sweap in the cforms refactoring.
>   - Added javadoc here and there
>   - Realized that Repeater is not a container widget (it's rows are): 
>     we should split the aspect of containing multiple values (like multivalue) (these
are 'repeating' or 'iterating'
>     from the aspect of containing child-widgets (being 'composed' seems more appropriate)
>   - Removed confusing overloaded versions of generateSAXFragment from the Abstract(Container)Widget
>     --> this introduced getXMLElementName on all subclasses, and needs additional
>           (that should remove quite some load of copy-paste)

Sorry for the massive commit, however when walking around the code it 
only looked like the proverbial tip of the iceberg.

 >   - left quite some TODO markers for next sweaps

Maybe some of you have some suggestions on some of them, feel free to 
step in and comment:

1/ should getWidget(id) be removed from Widget? It is already on 
ContainerWidget (which is the true context that makes sense IMHO)

2/ should getNamespace() exist at all, it seems to return the same thing 
as getFullQualifiedId()? Maybe a historical idea waiting to get thrown out?

3/ can getId() ever return null or "" on a widget instance? Can't we 
carefully asume programming error and allow for the accidental NPE to be 

4/ same question on getDefinition()

5/ should we rename ContainerDelegate to simply WidgetList (and the 
ContainerDefintionDelegate to WidgetDefinitionList)

6/ union seems to generate fi:field in stead of fi:union this surprised 
me a bit, is that the goal?

7/ should validation stop as soon as possible or continue to allow all 
validation errors to be set?

8/ setParent() on abstractWidget should be write-once IMHO, possibly 
yielding RTE (IllegalState?) when someone tries to reset it

9/ should not all generateSAXFragments include the 
getDefinition.generateDisplayData() by default

-marc= (the happy cleaning lady, be warned: she'll be back :-))
Marc Portier                  
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                          

View raw message