You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stefano Mazzocchi <st...@apache.org> on 2002/03/06 13:04:16 UTC
Re: Pipe-aware Selectors
Michael Homeijer wrote:
>
> Hi Stefano,
>
> Could you please have another look at the solution described by Bruno Dumon
> in the mailing list and comment on it.
> I'd really like to know what you think about it.
>
> It seperates the small incoming parts of data from the outgoing flow,
> doesn't change any cocoon interfaces, and you will be able to integrate
> results from processing incoming data into the pipeline again.
Bruno wrote this example:
<map:act type="FetchAndStoreXml" src="cocoon:/something">
<map:parameter name="storeAs" value="foo">
</map:act>
<map:select type="XPathSelector"
<map:parameter name="xmlName" value="foo">
<map:when test="/some/node = 'xyz'">
<map:redirect-to uri="somewhere">
</map:when>
<map:otherwise>
<map:generate type="XSLTGenerator" src="stylesheetsource">
<map:parameter name="xmlName" value="foo">
</map:generate>
<map:serialize/>
</map:otherwise>
</map:select>
I have the feeling that this is a (admittedly brilliant!) hack.
If we believe that Selectors should have access to the pipe flow, we
must change the interfaces, not create hacks with what is already
there... otherwise the system will be torn apart by these hacks (the
maintenance cost of the above code is huge since it's hard to understand
what it does simply by looking at it!)
This is my perception.
What do others think about this?
C'mon, without input I won't change anything.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Pipe-aware Selectors
Posted by Nicola Ken Barozzi <ni...@apache.org>.
From: "Stefano Mazzocchi" <st...@apache.org>
...
> I see three solutions:
>
> 1) ignore the proposal (but we must find a way to implement the same
> functionality without hacks!)
> 2) change the Selector interface
> 3) add another pipeline-aware routing sitemap component
>
> Tough decision indeed!
Yup, I have the same feeling.
There is a real need, and it seems that the envisioned solutions don't fit
that cleanly in the global picture yet.
This makes me think of the (apparent?) dichotomy in Cocoon between Event and
Stream pipelines.
Cocoon uses XML internally, but has to interface to a request coming in and
a result to give, all *not* as SAX events.
IMHO it could be possible (but not necessarily desirable) to achieve all
that Cocoon does now with Event+Stream pipelines only using Stream
pipelines, and this is what I've seen many do.
For example, you can check for authorization to see parts of a file in the
event part, with an Action and XSP tags that show-hide parts of content; but
you can also pipe the request in SAX and have a Transformer or even simple
XSL filter the stream based on the stream content itself. Should the Stream
contain only content, or also content metadata that shapes the content
itself? Are there, semantically speaking, different types-levels of content?
It seems that the dual nature of the processing in Cocoon is starting to get
tested by sensible argumentations.
What do you think?
BTW, Java, an Object language, that has primitive types. A hack? I don't
have the answer.
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Pipe-aware Selectors
Posted by Stefano Mazzocchi <st...@apache.org>.
Nicola Ken Barozzi wrote:
>
> From: "Stefano Mazzocchi" <st...@apache.org>
>
> > Nicola Ken Barozzi wrote:
> >
> > > It seems that the dual nature of the processing in Cocoon is starting to
> get
> > > tested by sensible argumentations.
> >
> > I'm sorry, Ken, but I don't get your point about this 'dual nature', can
> > you elaborate more?
>
> Cocoon has
> Event Pipeline <-> Stream Pipeline
>
> IMHO it's not *stricly* necessary (as theory goes) to have an event
> pipeline, and the fact that Actions are not so "pure" stems from the fact
> that it makes the Event Components bleed into the original pure Pipeline
> arena.
>
> For example, instead of selecting between two pipelines and generating from
> the choosen one, I can generate from both and filter only the relevant tags.
> Not auspicable, but possible.
Ok
> You can use Actions to act on the request (event pipeline), or you can use
> the RequestGenerator and have a side-effects Transformer do the same action.
>
> You can use some sort of Dispatching instead of Matching.
>
> Since there is a possibility in Cocoon to do things in at least two ways
> because of this, sometimes it happens that it comes natural to think that
> there needs to be a pure duality between the two pipelines that now lacks.
>
> Selector : Redirection or Rerouting
> Action : Side-Effect-Transformer
> Matching: Dispatcher-Adapter
>
> It *seems* that one could build a Cocoon without the pure Event Components.
> Like one could write Java without primitive types, and use only objects.
Yes, exactly. But they were introduced for speed concern mainly.
Smalltalk didn't have them and it was slow so they perceived it as a way
to improve performance by lowering the OO abstractions and creating OO
encapsulation... but we all see this was kind a hack, expecially looking
at the Collection API, lack of generics and the layers of Reflections
that were added over the versions.
> But IMHO there is a big difference here.
> We have the opportunity of separating the flow (events) from the pipelines.
I don't see the reason for this. I feel that having two types of
component is a feature, not a bug and doesn't create an architectural
problem... rather the opposite: it makes it easier for people to choose
how to separate concerns between logic that works 'in the pipe' and
logic that works 'on the pipe'.
Until now, we didn't find the way of having pipe routing based on pipe
content, but just because there is some overlap between the two world in
this particular behavior, I don't think this creates a need to remove
the separation between the two classifications.
> How are these Pipe-aware Selectors, Dispatchers, Adapters and side-effect
> Transformers going to fit with the future Flowmap+Sitemap Cocoon?
Well, the more I think about it, the more I picture Flowmaps and
Sitemaps being two instances of a class implementing the behavior of
'pipeline control'. Both will be able to mount one inside the other.
The idea is to have something like this
/ -> sitemap
/webmail/ -> flowmap
/webmail/user/folder -> sitemap
So: you *mount* a sitemap where you have more publishing needs than
web-apps needs and you mount a flowmap when you have more web-app needs
than publishing needs.
Or better: you mount a sitemap where you perceive your environment more
declarative and user driven (publishing-oriented), you mount a flowmap
where you perceive your environment more procedural and use is
server-side logic driven (web-app oriented).
If I were to describe it with java pseudo-syntax, I would use something
like this:
interface PipelineController {
this is the part that accepts the request and generate the response;
}
abstract class AbstractPipelineController {
allows other AbstractPipelineController to be mount
in the managed URI space in a cascading way
}
class Sitemap implements PipelineController extends
AbstractPipelineController {
implements the behavior using a declarative-style XML syntax mostly
oriented at stateless operations
}
class Sitemap implements PipelineController extends
AbstractPipelineController {
implements the behavior using a procecural-style code-like syntax
mostly
oriented at stateful operations, providing transparent state control
}
so it doesn't really matter how many components we add to the sitemap
because this is a polymorphic behavior and concerns are completely
separated between the two PipelineController implementations.
Sure, some overlap will remain and uses will have to find what they like
the best to implement the functionality, but at least we'll give the two
flavors that they need.
No, please, stop it right there: I know what you guys are thinking:
let's make this pluggable so that everybody makes its own
PipelineController implementation.
Berin proposed this a while ago and I still think that we should not get
into this direction until we are happy with the sitemap and the flowmap
and this will take a while.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Pipe-aware Selectors
Posted by Nicola Ken Barozzi <ni...@apache.org>.
From: "Stefano Mazzocchi" <st...@apache.org>
> Nicola Ken Barozzi wrote:
>
> > It seems that the dual nature of the processing in Cocoon is starting to
get
> > tested by sensible argumentations.
>
> I'm sorry, Ken, but I don't get your point about this 'dual nature', can
> you elaborate more?
Cocoon has
Event Pipeline <-> Stream Pipeline
IMHO it's not *stricly* necessary (as theory goes) to have an event
pipeline, and the fact that Actions are not so "pure" stems from the fact
that it makes the Event Components bleed into the original pure Pipeline
arena.
For example, instead of selecting between two pipelines and generating from
the choosen one, I can generate from both and filter only the relevant tags.
Not auspicable, but possible.
You can use Actions to act on the request (event pipeline), or you can use
the RequestGenerator and have a side-effects Transformer do the same action.
You can use some sort of Dispatching instead of Matching.
Since there is a possibility in Cocoon to do things in at least two ways
because of this, sometimes it happens that it comes natural to think that
there needs to be a pure duality between the two pipelines that now lacks.
Selector : Redirection or Rerouting
Action : Side-Effect-Transformer
Matching: Dispatcher-Adapter
It *seems* that one could build a Cocoon without the pure Event Components.
Like one could write Java without primitive types, and use only objects.
But IMHO there is a big difference here.
We have the opportunity of separating the flow (events) from the pipelines.
How are these Pipe-aware Selectors, Dispatchers, Adapters and side-effect
Transformers going to fit with the future Flowmap+Sitemap Cocoon?
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Pipe-aware Selectors
Posted by Stefano Mazzocchi <st...@apache.org>.
Nicola Ken Barozzi wrote:
> It seems that the dual nature of the processing in Cocoon is starting to get
> tested by sensible argumentations.
I'm sorry, Ken, but I don't get your point about this 'dual nature', can
you elaborate more?
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Pipe-aware Selectors
Posted by Nicola Ken Barozzi <ni...@apache.org>.
From: "Stefano Mazzocchi" <st...@apache.org>
...
> I see three solutions:
>
> 1) ignore the proposal (but we must find a way to implement the same
> functionality without hacks!)
> 2) change the Selector interface
> 3) add another pipeline-aware routing sitemap component
>
> Tough decision indeed!
Yup, I have the same feeling.
There is a real need, and it seems that the envisioned solutions don't fit
that cleanly in the global picture yet.
This makes me think of the (apparent?) dichotomy in Cocoon between Event and
Stream pipelines.
Cocoon uses XML internally, but has to interface to a request coming in and
a result to give, all *not* as SAX events.
IMHO it could be possible (but not necessarily desirable) to achieve all
that Cocoon does now with Event+Stream pipelines only using Stream
pipelines, and this is what I've seen many do.
For example, you can check for authorization to see parts of a file in the
event part, with an Action and XSP tags that show-hide parts of content; but
you can also pipe the request in SAX and have a Transformer or even simple
XSL filter the stream based on the stream content itself. Should the Stream
contain only content, or also content metadata that shapes the content
itself? Are there, semantically speaking, different types-levels of content?
It seems that the dual nature of the processing in Cocoon is starting to get
tested by sensible argumentations.
What do you think?
BTW, Java, an Object language, that has primitive types. A hack? I don't
have the answer.
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Pipe-aware Selectors
Posted by giacomo <gi...@apache.org>.
On Thu, 7 Mar 2002, Stefano Mazzocchi wrote:
> giacomo wrote:
>
> > In fact I don't think we can change the Selector interface as it is
> > clearly stated what a Selector is and how it works (read: not a pipeline
> > component). It doesn't mess with the SAX event in a pipeline (also for
> > backwards compatability).
>
> Yes, that's a good point, but the semantics looks so similar that might
> be misleading... hmmm, I still don't know if this is a good idea or not.
>
> > Maybe there needs to be other sematic in the sitemap to achieve what was
> > requested (honestly I have not had the need for such things so I don't
> > really care)
>
> Yes, I see three solutions:
>
> 1) ignore the proposal (but we must find a way to implement the same
> functionality without hacks!)
Easiest way.
> 2) change the Selector interface
-1
> 3) add another pipeline-aware routing sitemap component
I'm not sure it will be a good idea. It's more a gut feeling than
concrete concerns. I feel the control of the pipeline composition
will be put into content instead of the sitemap and thus giving dynamic
pipeline creation (which was abandoned from Cocoon 1).
> Tough decision indeed!
Sure.
Giacomo
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Pipe-aware Selectors
Posted by Stefano Mazzocchi <st...@apache.org>.
giacomo wrote:
> In fact I don't think we can change the Selector interface as it is
> clearly stated what a Selector is and how it works (read: not a pipeline
> component). It doesn't mess with the SAX event in a pipeline (also for
> backwards compatability).
Yes, that's a good point, but the semantics looks so similar that might
be misleading... hmmm, I still don't know if this is a good idea or not.
> Maybe there needs to be other sematic in the sitemap to achieve what was
> requested (honestly I have not had the need for such things so I don't
> really care)
Yes, I see three solutions:
1) ignore the proposal (but we must find a way to implement the same
functionality without hacks!)
2) change the Selector interface
3) add another pipeline-aware routing sitemap component
Tough decision indeed!
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Pipe-aware Selectors
Posted by Stefano Mazzocchi <st...@apache.org>.
Vadim Gritsenko wrote:
> > > What do others think about this?
>
> The more I read about "pipeline selectors" the less I like them (DOM
> tree building, re-streaming, ...)...
I know, I know, I have the exact same impression myself :/
> However, don't you think that there is some overlap between these
> "sitemap selectors" and recently proposed "multiplexer"?
Hmmm...
> Using DOM
> implementation of it (it is possible to have one), you will be able to
> evaluate XPath expressions and choose one of the several execution paths
> - or pipelines (follow the tail of "RE: is cocoon symmetry a holy
> grail?" for details about this "multiplexer").
>
> What do you think about this?
yeah, that might solve the issue completely with elegance....yeah...
> > > C'mon, without input I won't change anything.
> >
> > In fact I don't think we can change the Selector interface as it is
> > clearly stated what a Selector is and how it works (read: not a
> pipeline
> > component). It doesn't mess with the SAX event in a pipeline (also for
> > backwards compatability).
>
> I agree with Giacomo: let's leave Selectors as they are, messing with
> old and well-known interface does not feel right.
Ok, let's leave them as they are.
Ignoring the issue isn't nice.
So I think the only way is to go with Vadim's proposal and implement
xpath-reacting multiplexers
Vadim, would you mind incorporating this in your proposal and get back
to us with a clear description of the picture?
I honestly admit I don't remember the full details and I might need a
recontextualization.
--
Stefano Mazzocchi One must still have chaos in oneself to be
able to give birth to a dancing star.
<st...@apache.org> Friedrich Nietzsche
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Pipe-aware Selectors
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: giacomo [mailto:giacomo@apache.org]
>
> On Wed, 6 Mar 2002, Stefano Mazzocchi wrote:
>
> > Michael Homeijer wrote:
> > >
> > > Hi Stefano,
> > >
> > > Could you please have another look at the solution described by
Bruno
> > > Dumon
> > > in the mailing list and comment on it.
> > > I'd really like to know what you think about it.
> > >
> > > It seperates the small incoming parts of data from the outgoing
flow,
> > > doesn't change any cocoon interfaces, and you will be able to
integrate
> > > results from processing incoming data into the pipeline again.
> >
> > Bruno wrote this example:
> >
> > <map:act type="FetchAndStoreXml" src="cocoon:/something">
> > <map:parameter name="storeAs" value="foo">
> > </map:act>
> > <map:select type="XPathSelector"
> > <map:parameter name="xmlName" value="foo">
> > <map:when test="/some/node = 'xyz'">
> > <map:redirect-to uri="somewhere">
> > </map:when>
> > <map:otherwise>
> > <map:generate type="XSLTGenerator" src="stylesheetsource">
> > <map:parameter name="xmlName" value="foo">
> > </map:generate>
> > <map:serialize/>
> > </map:otherwise>
> > </map:select>
> >
> > I have the feeling that this is a (admittedly brilliant!) hack.
> >
> > If we believe that Selectors should have access to the pipe flow, we
> > must change the interfaces, not create hacks with what is already
> > there... otherwise the system will be torn apart by these hacks (the
> > maintenance cost of the above code is huge since it's hard to
understand
> > what it does simply by looking at it!)
> > This is my perception.
> >
> > What do others think about this?
The more I read about "pipeline selectors" the less I like them (DOM
tree building, re-streaming, ...)...
However, don't you think that there is some overlap between these
"sitemap selectors" and recently proposed "multiplexer"? Using DOM
implementation of it (it is possible to have one), you will be able to
evaluate XPath expressions and choose one of the several execution paths
- or pipelines (follow the tail of "RE: is cocoon symmetry a holy
grail?" for details about this "multiplexer").
What do you think about this?
> > C'mon, without input I won't change anything.
>
> In fact I don't think we can change the Selector interface as it is
> clearly stated what a Selector is and how it works (read: not a
pipeline
> component). It doesn't mess with the SAX event in a pipeline (also for
> backwards compatability).
I agree with Giacomo: let's leave Selectors as they are, messing with
old and well-known interface does not feel right.
Vadim
> Maybe there needs to be other sematic in the sitemap to achieve what
was
> requested (honestly I have not had the need for such things so I don't
> really care)
>
> Giacomo
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Pipe-aware Selectors
Posted by giacomo <gi...@apache.org>.
On Wed, 6 Mar 2002, Stefano Mazzocchi wrote:
> Michael Homeijer wrote:
> >
> > Hi Stefano,
> >
> > Could you please have another look at the solution described by Bruno Dumon
> > in the mailing list and comment on it.
> > I'd really like to know what you think about it.
> >
> > It seperates the small incoming parts of data from the outgoing flow,
> > doesn't change any cocoon interfaces, and you will be able to integrate
> > results from processing incoming data into the pipeline again.
>
> Bruno wrote this example:
>
> <map:act type="FetchAndStoreXml" src="cocoon:/something">
> <map:parameter name="storeAs" value="foo">
> </map:act>
> <map:select type="XPathSelector"
> <map:parameter name="xmlName" value="foo">
> <map:when test="/some/node = 'xyz'">
> <map:redirect-to uri="somewhere">
> </map:when>
> <map:otherwise>
> <map:generate type="XSLTGenerator" src="stylesheetsource">
> <map:parameter name="xmlName" value="foo">
> </map:generate>
> <map:serialize/>
> </map:otherwise>
> </map:select>
>
> I have the feeling that this is a (admittedly brilliant!) hack.
>
> If we believe that Selectors should have access to the pipe flow, we
> must change the interfaces, not create hacks with what is already
> there... otherwise the system will be torn apart by these hacks (the
> maintenance cost of the above code is huge since it's hard to understand
> what it does simply by looking at it!)
> This is my perception.
>
> What do others think about this?
>
> C'mon, without input I won't change anything.
In fact I don't think we can change the Selector interface as it is
clearly stated what a Selector is and how it works (read: not a pipeline
component). It doesn't mess with the SAX event in a pipeline (also for
backwards compatability).
Maybe there needs to be other sematic in the sitemap to achieve what was
requested (honestly I have not had the need for such things so I don't
really care)
Giacomo
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org