On Thu, 19 Jul 2001, Christian Haul wrote:

> On 19.Jul.2001 -- 11:06 PM, giacomo wrote:
> > I totally agree with you, Sylvain, and would encourage Christian to
> > remove the hole configuration part from the AbstractAction at all
> > because this forces new developer to think of using parameter
> > elements instead of better ones like <foo>bar</foo>.
>
> I found that actions could be easier to use when some parameters could
> be specified that are valid for all invocations. For example one might
> want to have all validator actions use the same descriptor file, or
> all database actions use the same connection, or ...

I can totally agree with you but I meant the AbstractAction was the
wrong place to add this. There are other abstract implementation
(AbstractDatabasAction IRC) which should have been extended with
concrete configure() implementation as you've explained. And IMHO
<parameter> is a bad name for a configuration item.

> Before, it was necessary to specify this for every invocation. I think
> that makes the sitemap less readable. Action sets are a solution to
> this only, if the success of an action is of no importance to the rest
> of the pipeline or this is communicated through side channels like
> modifying the request object.

No, no. I don't mean is is wrong to have configured Action instead of
parameterized one in the pipeline. My insisting was

1. don't use a <parameter> element for configuration
2. don't have a general configure() method/names in AbstractAction.
   Use others more suitable for this (ie. AbstractDatabaseAction)

> Hence, I believe that all actions should be able to receive the same
> configuration information for sitemap wide use that they take per
> invokation.

I don't get this. Do you mean we should be able to somehow say
<foo>bar</foo> and every single Action in the system should receive this
as configuration?

> If we can agree on this, it would be a duplication of effort to have
> every action implement parsing the configuration itself. This is the
> reason why I suggested to put this into AbstractAction.

I think it is not possible because different actions need different
configuration. And as said earlier the element <parameter> isn't very
elegant here.

> Would you prefer to have another abstract action, that contains some
> configuration support?

Yes, see above.

> Sylvain is right about the map:parameter part. We could modify the
> configuration method so that it takes every node name as key and the
> node value as er value.
>
> Example:
>   <map:action name="form-validator" 
>src="org.apache.cocoon.acting.FormValidatorAction">
>      <map:parameter name="descriptor" value="context://descriptor.xml"/>
>   </map:parameter>
>
> becomes
>   <map:action name="form-validator" 
>src="org.apache.cocoon.acting.FormValidatorAction">
>      <descriptor>context://descriptor.xml</descriptor>
>   </map:parameter>

This looks better to me.

Giacomo


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to