cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Knecht <fel...@apache.org>
Subject Re: Springifying CForms
Date Thu, 27 Sep 2007 07:05:27 GMT
Giacomo Pati schrieb:
> I'm done with it :-)

Great, I'm looking forward to make my first experiences with it :-)

>  but need an advice on a special case:
>
> There are some special 'custom' stuff which had been referenced in form definitions/bindings
by the
> mentioned 'class' attribute which is now replaced by a 'ref' attribute and must be a
Spring bean.
> Those classes were handled by LifecycleHelper as Avalon Components (which I've eliminated
in that
> block). Those custom classes could have implemented the Avalon Configurable interface
to get access
> to the XML snippet in the definition/binding file as a Avalon Configuration object. So
how should
> that be handled now as they are all managed by Spring?
>
> I have 2 possibilities:
>
> a) check the custom class/bean whether it has a 'setConfiguration' method by reflection
and pass
>    the DOM snipped to it
>
> b) extend the base interfaces (WidgetValidator, etc) to a ie. ConfigurableWidgetValidator,
etc.)
>    that has that setConfiguration method to pass the DOM snipped to.
>
> So, a) could be said being black magic, and b) could be said being overdesigned.
>   

I'd preferre b) because it's more obvious how to implement your own
WidgetValidator when having a look at the JavaDocs Package API. You can
see the 2 Interfaces what should make you more sensible about the
difference/choice you have to make.
With a) it'll be probably 'hidden' somewhere in the documentation and
therefore less obvious how to implement your own WidgetValidator.



Felix

Mime
View raw message