Giacomo Pati wrote:
CFroms is utilizing lots of Avalon ServiceSelector and this hinders extensibility of it as adding new Widget types etc. is becomming a pain with config files in jars.

I've thought about a Spring version of a ServiceSelector to allow a more flexible configuration and extensibility with a class like

class SpringServiceSelector implements BeanFactoryAware, ServiceSelector

Eww :) Why do you need SpringServiceSelector? IMHO forms should be just modified to obtain necessary dependencies directly from manager:

  manager.lookup("o.a.c.f.f.WidgetDefinitionBuilder/form")

And get away completely from any service selectors. This is similar to what is done for flattening of sitemap components, isn't it?


Which uses the BeanFactory to fullfill the contracts of the ServiceSelector and thus flattens the configuration from having components inside a ServiceSelector config as whith Avalon to all beans at the same level and thus extensibility is for free than.

I was thinking of going from Avalon config

  <forms-formmanager logger="forms.model">
    <widgets>
<widget name="form" src="org.apache.cocoon.forms.formmodel.FormDefinitionBuilder"/>
      .....
    </widgets>
  </forms-formmanager>

to Spring config

  <bean id="ServiceSelector/forms-formmanager"
        class="SpringServiceSelector">
    <property name="role" value="o.a.c.f.f.WidgetDefinitionBuilder"
  </bean>

Don't like this...

  <bean id="o.a.c.f.f.WidgetDefinitionBuilder/form">
        class="org.apache.cocoon.forms.formmodel.FormDefinitionBuilder">
    ...
  </bean>

But completely agree with this.

Vadim


IIRC the SpringServiceSelector could lookup other beans by interfaces, right?

Anybody else think this is achievable and make sense?

Ciao

Reply via email to