cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <giac...@apache.org>
Subject Re: [C2] <parameter> or <map:parameter> ?
Date Thu, 10 May 2001 17:50:12 GMT


On Thu, 10 May 2001, Sylvain Wallez wrote:

>
>
> Giacomo Pati a écrit :
> >
> > Quoting Sylvain Wallez <sylvain.wallez@anyware-tech.com>:
> >
> > >
> > >
> > > giacomo a écrit :
> > > >
> > > > On Wed, 9 May 2001, Donald Ball wrote:
> > > >
> > > > > On Wed, 9 May 2001, Davanum Srinivas wrote:
> > > > >
> > > > > > +1. Donald, would you like to take a shot?
> > > > >
> > > > > well, i'll await the results of the discussion. berin had dissented
> > > > > slightly. also, how about other non-namespaced elements:
> > > > >
> > > > >    <map:transformer     name="xslt"
> > > > > src="org.apache.cocoon.transformation.TraxTransformer">
> > > > >     <compile-stylesheets map:value="true"/>
> > > > >     <use-store map:value="false"/>
> > > > >    </map:transformer>
> > > > >
> > > > >    <map:serializer name="wap"    mime-type="text/vnd.wap.wml"
> > > > > src="org.apache.cocoon.serialization.XMLSerializer">
> > > > >     <doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public>
> > > > >
> > > > >
> > > <doctype-system>http://www.wapforum.org/DTD/wml_1.1.xml</doctype-system>
> > > > >    </map:serializer>
> > > > >
> > > > >   <map:selectors default="browser">
> > > > >    <map:selector name="browser"
> > > > > factory="org.apache.cocoon.selection.BrowserSelectorFactory">
> > > > >     <browser name="explorer" useragent="MSIE"/>
> > > > >     <browser name="pocketexplorer" useragent="MSPIE"/>
> > > > >
> > > > > any reason that all of these configuration elements don't belong
in
> > > the
> > > > > map namespace?
> > > >
> > > > Yes :)
> > > >
> > > > IMHO they don't belong to the map namespace because they don't have a
> > > > meaning to the sitemap. The sitemap only passes them along to the
> > > > components as is either to configure or parameterize the component
> > > > (because the components can/should not read the sitemap).
> > > >
> > > > Giacomo
> > > >
> > > It seems like I started a hot discussion ;-)
> > >
> > > I was only talking about <parameter> and not configuration elements :
> > >
> > > - IMO, parameters are a sitemap concern : they are used to pass
> > > parameters from the sitemap to its components using
> > > SitemapModelComponent.setup().
> > >
> > > - Configuration elements should not be in the sitemap namespace :
> > > they're a Configurable concern (and not all SitemapModelComponent are
> > > configurable), included in the sitemap for component configuration, and
> > > as such should stay non-namespaced, as all configurations are.
> >
> > Which sitemap components are not configurable? Generators, Transformers,
> > Serializers, Matchers, Selectors, Actions, all are configurable. And why is
> > there a difference of passing data once in the lifetime of a component and
> > passing it once per request?
> >
> Mmmh... many sitemap components *aren't* configurable : all generators
> and all transformers but TraxTransformer for example. The Configuration
> object passed to load_component() is silently ignored by
> DefaultComponentFactory in excalibur.

From the view point of the sitemap *all* component can be configured. No
matter. It depends on the component not on the sitemap.

> Also, the "name", "src" and "label" attributes put in the Configuration
> object by the sitemap seem to be useless : "name" and "src" are
> parameters of load_component() and "label" is used for code generation.
> I'll try to remove them and see if this breaks something.
>
> > > Also, having parameters in the sitemap namespace will ease their
> > > distinction from configurations if parameters are mixed with
> > > configurations (AFAIK it's not possible for now, but maybe it could
> > > arise in future evolutions).
> >
> > I don't see the distinction from parameters and configuration (except the life
> > cycle aspect)
> >
> But that *is* the difference : a component is configured once for all in
> its lifetime, while the parameters represent the variables that identify
> the current request and go through the sitemap "{variable}" substitution
> mechanism.
>
> I consider Configuration to be a set of immutable properties that set up
> the component before it is usable, and Parameters to be the invokation
> parameters of a method that can be called several times during the
> component life with different values for these parameters. And this
> makes the difference.

No, I disagree. Configuration and Parameters are the same for different
life time scopes.

>
> > Giacomo
> >
>
> Sorry for starting this hot thread, but I'm digging deeper and deeper in
> C2, and when I don't understand something, I ask. Just tell me if I
> shouldn't...

No problem :) go ahead if you like it hot :)

Giacomo


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message