Hello All,
I have researched previous discussions related to "pipe-aware selectors"
and XPath selectors within the pipeline. I realize that there are good
arguments for and against adjusting a pipeline based on its content However,
not being able to select a course of action based upon stream content limits
Cocoon's usefulness in some application areas.
It would be nice if I could pass a command handler in Coocon a snippet of
XML, and have it execute an arbitrary action based on its content. For
example, a master RPC handler that takes all RPC calls and routes them where
appropriate. This conceptually could make Cocoon polymorphic. Imagine
something where all RPC requests are passed to "rpchandler". This
"rpchandler" pipeline then peeks inside the request, and routes to a pipeline
called {1}/handler, where {1} is the URI that should handle the command
request.
Imagine sending Cocoon a command snippet in XML like this:
<rpc>
<uri>do/something</uri>
<body></body>
</rpc>
The snippet could be sent to a master handler and then that pipeline could
forward the XML package to cocoon://do/something/handler. That pipeline is
then responsible to dealing with the request, and returning whatever result
set was asked for... maybe it's a recipe for cookies, or an image, or a list
of songs. The real advantage is that all commands can be handled via the one
pipeline. Yes, we could solve the problem using many different matchers...
but really it would be more flexible in design if we pass all calls to the
one pipeline which delegates the tasks appropriately. Then any software
integrating with Cocoon just has to know the one URI for the request handler.
I cannot see any way to do something like this in Coocon currently. Please
let me know if there is a different approach. However something that could
peek inside the data content running through the pipeline would be greatly
beneficial.
Whenever I look at cocoon, I think to myself of OOP but using XML trees to
push data around into pipelines to process and return results. I know I'm
pushing the limits of what Coocon is really designed to do, but ideally
Cocoon could be a really neat way of tying many webservices together into one
program.
Thoughts?
AJ