On Fri, 18 Jul 2003, Reinhard Pötz wrote:

> > From: Stephan Michels
> >
> > <map:initiate> -> select flow -> <map:flow>                     \\
> >                   -> select implementation -> <flow-processor>
> >
> > Ohh moment, what makes the flow component different from
> > other sitemap components? Nothing!
>
> >From a technical POV you are completly right but I share Stefano's idea
> that we should show our users that the flow component is different from
> the sitemap components. So I'm -1 on this.
>
> >
> > <map:components>
> >  <map:flow name="petshop" class=
> > "org.apache.cocoon.components.flow.javascript.JavaScriptInterpreter">
> >   <reload-scripts>true</reload-scripts>
> >   <check-time>4000</check-time>
> >   <script src="flow/PetStoreImpl.js"/>
> >   <script src="flow/petstore.js"/>
> >  </map:flow>
> > <map:components>
>
> ... so I like the new section <map:flows>...</map:flows> more. See the
> reasons above.

Oh yes, I mean

<map:components>
 <map:flows>
  <map:flow name="petshop" class=
 "org.apache.cocoon.components.flow.javascript.JavaScriptInterpreter">
   <reload-scripts>true</reload-scripts>
   <check-time>4000</check-time>
   <script src="flow/PetStoreImpl.js"/>
   <script src="flow/petstore.js"/>
  </map:flow>
 </map:flows>
<map:components>

like every other components.

> And I think it is FS to determine the implementation
> (org.apache.cocoon.components.flow.javascript.JavaScriptInterpreter) at
> sitemap level.
> Do you have a usecase which makes this necessary? I wrote a lot of JS
> flow scripts and haven't had a need for this yet.

1. Usecase: You don't want to use flows -> remove the flow section
2. Usecase: You have different flows in the same map.
3. Usecase: You use different implementations in the same map.

The fact, that specifying of components in the sitemap is in general
a bad pratice, is another point, but don't want to discuss
here(,perhaps later :))

> > <map:initiate type="petshop" start="addItem"/>
> > <map:continue type="petshop" id="{1}"/>
> >
> > Hey, I love this :)
>
> I think this obscures that a flow processor/engine is used. Of course
> this makes only sense in connection with <map:flows>...</map:flows>.
> Therefore I like following syntax more.
>
> <map:initiate flow="addItem" type="petshop" />
> <map:continue flow="{1}"     type="petshop" />
>
> Would you be fine with this?

I thought with @type to combine the implementation(Javascript) and
instance(petstore.js), which I see as practice, which already used
with the other components.

Another way could be

<map:initiate flow="addItem" type="petshop" src="flow/petstore.js/>
<map:continue flow="{1}"     type="petshop" src="flow/petstore.js/>

And the flow processor could cache the instance with @src
as key.

But nevertheless, I like most

<map:components>
 <map:flows>
  <map:flow name="petshop" class=
 "org.apache.cocoon.components.flow.javascript.JavaScriptInterpreter">
   <reload-scripts>true</reload-scripts>
   <check-time>4000</check-time>
   <script src="flow/PetStoreImpl.js"/>
   <script src="flow/petstore.js"/>
  </map:flow>
 </map:flows>
<map:components>

<map:pipeline>
 [...]
 <map:initiate type="petshop" start="addItem"/>
 [...]
</map:pipeline>

<map:pipeline>
 [...]
 <map:continue type="petshop" id="{1}"/>
 [...]
</map:pipeline>

This makes the concept really symmetric to the other
components, and can signal that the continuations
are the successor of the actions.

Stephan.5~

Reply via email to