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/11/02 01:12:09 UTC
[design] Cocoon Blocks 1.1
Cocoon Blocks
-------------
author: Stefano Mazzocchi
status: working draft
version: 1.1
(see the end of the document for changes from the previous version)
DISCLAIMER: This document must be considered as a working draft and may
be updated at any time.
+----------------------+
| Part 1: introduction |
+----------------------+
A step back: what are the problems we are trying to solve
---------------------------------------------------------
Cocoon is currently a framework implemented as an application.
A 'framework' is supposed to give services to entities included in it,
while an application is supposed to be executed by a containing
framework.
While the above might sound weird at first, this is a very common
situation: an operating system is a framework implemented as an
application run at boot time. At the same time, an application server is
a framework implemented as an application. But even a browser is a
framework implemented as an application.
So, there is no inherently bad design in this concept, *but* the
framework must be implemented in such a way that it's inherently *easy*
to deploy/install/plug-in/connect/attach/inject/link an internal
application that must be executed by the framework.
Cocoon lacks this.
Let me give you an example: I would like to be able to package my stuff
that I wrote to be run *by* cocoon and deploy it on Cocoon, maybe even
at runtime.
The parallel is easily made: servlets and WARs archives. The Servlet API
introduced in a later release the concept of a WAR (Web ARchive) package
that includes all the resources needed for the servlet/jsp-based web
application to run, including libraries, resources, files and
everything.
So, the parallel I want to draw is simple:
WAR (Web ARchive) -> tomcat (or other servlet container)
COB (COcoon Block) -> cocoon
so, a WAR package is for tomcat what a COB will be for Cocoon.
In very short terms: a way for you to deploy your stuff on Cocoon
without hassle (including special libraries, resources and what not).
Are we really cloning the servlet API?
--------------------------------------
Many people from the pure J2EE world (even Apache people) believe that
Cocoon is just an attempt to rewrite the servlet API for XML. In a sense
it's true: the servlet API wasn't designed for pipelines and the
deployment descriptor wasn't designed for serious URI space mapping.
So, while the Servlet API introduces components (servlets and filters)
that are based on streams of bytes/chars, Cocoon introduces components
designed to be part of a pipeline [since 1997 I thought about a way to
allow servlet chaining to be feasible, that is probably what triggered
the idea of pipeline components for Cocoon].
Anyway, looking at this parallel, Cocoon really lacks a way to make its
applications deployed easily within a 'naked' container that includes
only the basic and default machinery.
- o -
I'm pretty sure that if I stopped here and went on describing the schema
of the COB descriptor file and so on, people would love it, thank me,
run to their boss to tell them and blah blah.
Sure, we could stop here, we could clone the WAR concept inside Cocoon,
allow you to deploy your stuff and you won't be missing anything.
But there are two things that the servlet API architects didn't consider
(not even myself at that time since I was part of that group):
polymorphism and inheritance.
Applying Avalon COP philosophy over again
-----------------------------------------
If you ever worked with Avalon, you know the feeling: at first it doesn't
make any sense at all. It's a mess of stupid and very abstract
interfaces... but after a while, a pattern emerges and it sticks.
Some might think that Avalon (probably Cocoon itself) includes infecting
'memes' and I agree. [Look up the name on google if you don't know what
I'm talking about]
Once you start using COP (component oriented programming), it's very
hard to go back (so much so that many abuse it and over-componentize
their systems... even Cocoon itself suffers from this problem on some
parts).
COP is based on IoC (Inversion of Control) and SoC (Separation of
Concerns) [for those who still don't know about them!] and while the
servlet API makes extensive use of the IoC metapattern, SoC doesn't play
a clear and defined role (they tried to patch it with RequestDispatcher,
which is the biggest hack I ever seen, I even voted against it but I was
overruled).
Anyway, if the servlet API, internally, show use of IoC and SoC,
externally, from the WAR point of view, there is *absolutely* no notion
of it: a WAR is a package that includes a single and isolated
application.
Period. That's it. There are many mechanism that enforce the clear
separation between different WARs. So, they implement monolithic web
applications and this is *by design*.
Improvement #1: component-oriented deployment
---------------------------------------------
Let me give you a possible use-case scenario.
Let us suppose that we implement WAR-like package deployment on top of
Cocoon and that your application requires both PDF serialization and
SVG->PNG rasterization.
Then, you implement another cocoon web application and you still require
PDF generation.
Unfortunatley, since WAR-like installation isolates the packages and
their classloaders, you have to install the PDF serialization libraries
twice.
Thus the idea of blocks as units of deployable service. Here is a picture:
case 1: WAR-like deployment
+----------------+ +--------------------+
| +-------+| |+-----+ +-------+|
| | FOP || || FOP | | Batik ||
| +-------+| |+-----+ +-------+|
| | | |
| webapp1 | | webapp2 |
+----------------+ +--------------------+
case 2: block-like deployment
+-----+ +-------+
| FOP | | Batik |
+-----+ +-------+
| \ |
| \ |
+---------+ +---------+
| webapp1 | | webapp2 |
+---------+ +---------+
The second case allows:
- optimization of resources (libraries are not deployed more than needed)
- separate distributions (different packages can be prepared and
maintained by different groups independently, as long as the service
contracts remain the same)
Improvement #2: polymorphic behavior
------------------------------------
The above solution already improves on the WAR model, but we can do
better than this. Another use-case scenario:
In the previous scenario, your web application required PDF
serialization and, in fact, it mixes concerns if it depends *explicitly*
on FOP since, later on, you might want to use another library/service
that implements the same (for example iText or RenderX).
So, instead of depending on a particular *implementation* of a service
behavior, if we make blocks depending on *behaviors* directly
(considered as service contracts) we can implement polymorphic behavior
of blocks.
Again, let's visualize it:
case 1: dependency on implementation
+-----+ +-------+
| FOP | | Batik |
+-----+ +-------+
| \ |
| \ |
+---------+ +---------+
| webapp1 | | webapp2 |
+---------+ +---------+
case 2: dependency on behavior
+-----------+ +-----------+
| +-----+ | | +-------+ |
| | FOP | | | | Batik | |
| +-----+ | | +-------+ |
| FO->PDF | | SVG->PNG |
+-----------+ +-----------+
| \ |
| \ |
+---------+ +---------+
| webapp1 | | webapp2 |
+---------+ +---------+
Here, the webapp1 requires "fo-pdf" serialization services but it does
not care (nor should!) which implementation of this service is actually
located into the system.
It is, in fact, the installer's concern to indicate *what* block that
*implements* that behavior should be used in that system at that time.
Note that this allows several very intersting things:
1) versioning: it is possible install several different versions of the
same block and try them out (even at runtime) and roll-back if the
version creates incompatibilities without having to change anything in
the blocks, but only using the block manager (which is the part of
cocoon responsible for deployment and configuration of blocks in the
system).
2) polymorphism: I can have different implementations of the same
behavior and I can switch them simply by acting on the block manager,
without having to touch a single configuration line in any block. The
blocks are, in fact, sealed.
Improvement #3: block inheritance
---------------------------------
The third step is to allow blocks to extends other blocks.
The idea is to be able to wrap a block with another one, creating an
'overloading' mechanism similar to the one used by OOP inheritance where
methods are 'fall back' to the extended class if the extending class
doesn't implement them.
Let us supposed we have the following block (very simple):
block A implements http://mystuff.org/skin/1.1
/stylesheets/changes2document.xslt
/stylesheets/faq2document.xslt
/stylesheets/document2html.xslt
/resources/logo.gif
and let us suppose that we want to change the look and feel of that
block. The first two stylesheets provide simply a way to adapt from more
specific markup to the Document DTD. So, my block would need to change
only the last two resources 'document2html.xslt' and 'logo.gif'.
The best solution is to allow my block to explicitly "extend" that block
and inherits the resources that it doesn't contain.
block b extends block a
/stylesheets/document2html.xslt
/resources/logo.gif
but then block B still is considered implementing behavior
http://mystuff.org/skin/1.1 because the rest is inherited.
This mainly:
- reduces block development and maintanance costs because changes and
bugfixes are directly inherited by all the extending blocks, thus
allowing better SoC between the two groups mainaining the different blocks
- easy customization: blocks can be adapted for personal specific
needs simply with a wrapper around and without the need to repackaging.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+---------------------------+
| Part 2: technical details |
+---------------------------+
Ok. Now that we have described where we want to go, let's describe how.
Cocoon Blocks
-------------
A Cocoon block is a zipped archive, just like JARs and WARs.
The suggested extension of a cocoon block is ".cob" (for COcoon Block).
The suggested MIME type is "application/x-cocoon-block".
A Cocoon Block (COB from now on) includes a directory called
/BLOCK-INF
which contains all the block metadata and the resources that must not be
directly referentiable from other blocks (for example, jars, classes or
file resources made available thru the classloader). The directories
/BLOCK-INF/classes
/BLOCK-INF/jar
are used for classes and jar files. [This follows the WAR paradigm]
The main COB descriptor file is found at
/BLOCK-INF/block.xml
This file contains markup with a cob-specific namespace and will include
the following information:
1) block implementation metadata:
- unique URI identifier [this identifier will also be used as an
address on where to locate the block and how to download it from the
web!] (example: http://mystuff.org/dist/myblock-1.5.34.cob)
- version (1.5.34)
- short name (My Block)
- description
- author
- URI of license (http://mystuff.org/dist/license)
- URI of the distribution location
(http://mystuff/dist/latest/myblock.cob)
- ???
2) role(s):
the URI(s) of the behavioral role(s) this block implements
and exposes [optional]
3) dependencies:
the URI(s) of the behavioral roles this block expects,
along with the prefixes used by the block as shortcuts in protocol
resolving (see below for the meaning of this) [optional]
4) inheritance:
the URI of the block extended. [optional]
5) sitemap:
the location inside the block file space of the sitemap
[optional, if not found defaults to '/sitemap.xmap']
6) configurations:
the configurations required for this block to function [optional]
Also, the /BLOCK-INF/ directory contains the 'roles' file for Avalon
components:
/BLOCK-INF/roles.xml
Possible use-case scenario
--------------------------
Suppose you have your naked cocoon running in your favorite servlet
container, and you want to deploy myblock.cob. Here is a possible
sequence of actions on an hypotetical web interface on top of Cocoon
(a-la Tomcat Manager)
1) upload the myblock.cob to Cocoon
2) Cocoon scans /BLOCK-INF/, reads block.xml and finds out the
behaviors this block depends on as well as the block that it extends.
3) the block manager connects to the uber "Cocoon Block Librarian" web
service (hosted probably on cocoon.apache.org) and asks for the list of
blocks that exhibit that required behavior.
4) the librarian returns a list of those blocks, so the users chooses,
or the manager allows the user to deploy its own block that implements
the required behavior or to reuse those already deployed blocks that
implement the required behaviors.
5) Cocoon checks that all dependencies are met, then unpacks and
installs the blocks
6) For each block that exposes a sitemap, the deployment manager asks
the deploying user where he/she wants to *mount* that block in the
managed URI space or if he/she wants to keep them internal only (thus
only available to the other blocks, but not mounted on the public URI space)
7) for each block that requires installation-time configurations, the
block manager will present the user information on how to configure the
block.
8) If no collisions in the URI spaces are found, the blocks are made
available for servicing.
Resource dereferencing
----------------------
Security concerns aside, the above scenario shows one major issue:
blocks are managed, deployed and mounted by the container. There is (and
there should not be) a way for a block to directly access another block
because this would ruin IoC.
So, one block doesn't know where the blocks it depends on are located,
both on disk *and* on the URI space as well.
The proposed solution is to use block-specific protocols to identify the
dereferenced resources.
For example, the myblock.cob/sitemap.xmap file could contain a global
matcher which works like this:
<map:match pattern="**/*.html">
<map:generate src="{1}.xml"/>
<map:transform src="block:skin:/stylesheets/document2html.xslt"/>
<map:serialize/>
</map:match>
please note the
block:skin:/stylesheets/document2html.xslt
which indicates
block -> use the block protocol
skin -> use the 'skin' prefix to lookup the block behavior URI and thus
the block which implements it for this block (the block manager knows
this)
/stylesheets/document2html.xslt -> it will ask the sitemap of the skin
block to produce that resource.
Dereferencing navigation
------------------------
Not only a sitemap needs to connect to the resources contained in the
blocks on which the block depends on, but the resulting pages as well.
In fact, suppose you have a block that exposes a web service and another
one that exposes a web application that wraps that web service. For
sure, the generated web page will have to have a URI to connect to that
service, since it's the client's browser that makes the call (unless we
want to virtualize everything thru the sitemaps, but I wouldn't suggest
it).
So, a possible solution is to use the "block:" protocol in the pages as
well and have a URI-mapping transformer right before the serialization
stage.
For example, things like
<form action="block:web-service:/post">...</form>
is trasnformed into
<form action="/servizio-web/post"/>...</form>
Some design decision taken
--------------------------
o) NO BEHAVIOR VALIDATION:
I thought a lot about it but I think that having 'behavior description
languages' (such as the WSDL-equivalent for blocks) is going to be
terribly complicated, expensive to implement and hard to use and
enforce, even for simple blocks which don't expose a sitemap and are
just repositories for informations.
For this reason, there is no validation taking place: if a block
implements a particular behavior and exposes it thru its descriptor
file, Cocoon automatically assume it implements the behavior correctly.
In the future, we might think of adding a behavior description layer to
enforce a little more validation, but I fear the complexity (for
example) of validating stylesheets against a particular required
behavior.
IMO, only human try/fail and patching will allow interoperability.
o) VERSIONING AS PART OF THE BEHAVIOR URI
The behavior URI *MUST* terminate with a /x.y that indicates the
major.minor version of the behavior that a block implements.
On dependencies, each block must be able to specify the 'ranges' of
versioning that it is known to work with. For example
<block behavior="http://xml.apache.org/forrest/skin/1.x"
prefix="skin"/>
But I haven't really thought about the patterns that could be used for
this.
Please, help on this.
o) CROSS-BLOCK SECURITY
Even I don't think anybody is stupid enough to use a single Cocoon
instance to run a full ISP and ask for sandboxing of the single blocks,
cross-block security is a big concern, expecially since you might be
deploying components on the fly in a binary format.
So, first thing is to protect the /BLOCK-INF/ directory.
The second thing is to wrap each block with its own classloader,
connected to the block dependency map, so that each class discovery is
done only on the class space of the dependent blocks.
[NOTE: this doesn't prevent people from using blocks as trojans, but we
won't host blocks which don't come with the source code so we solve that
problem].
o) COCOON MANAGER SECURITY
The cocoon manager might be a block itself that connects to specific
cocoon internals and provides a web interface for it. So, it can be
removed or disabled when put on production.
Also, the feature of automatic discovery of blocks thru the 'cocoon
block library' can be turned off or substituted with its own (even the
'cocoon block library' could be a block, so you could have your own
block library on your system instead of connecting to the apache one).
o) OPTIONAL COP
The block.xml file makes it *optional* to expose behaviors or to depend
on them. This allows the COP model to nicely downgrade to the good old
single-archive WAR paradigm for those who don't care about block
polymorphism.
- o -
Conclusions
-----------
I think I have exposed a detailed plan on how to implement blocks and
solve a number of issues we are having:
1) allow users to 'compose' Cocoon only with those modules they need
2) allow users to easily deploy their stuff on cocoon
3) allow users to easily reuse web applications components without
sacrificing coherence, interoperability and easy extensibility
4) allow users to be helped by Cocoon to 'fill the gaps' and be
suggested on what components is best required and feed it automatically
(apt-get like)
5) allow the Cocoon communities to clearly separate concerns between
the core and the application-level stuff, thus allowing the cocoon
community to really scale by massive development parallelization
6) allows, for the first time in the history of the web, to use
polymorphism, inheritence and COP at a web application level.
THANKS
------
I would like to thank Giacomo Pati and Carsten Ziegler for their great
contribution and precious feedback.
Changes from version 1.0
------------------------
- added the concept of block inheritance
- wrote a scenario for introduction of the COB model as an evolution of
the WAR model.
- added configurations to blocks
- changed block.info and blocks.roles into block.xml and roles.xml
- removed issues already identified by the first round of design
TODO
----
1) blocks should allow to depend on 'ranges' of behavior versions.
Let's try to come up with a way to describe those ranges effectively.
2) the block manager should present the user with a form on how to
configure the block, thus the block should contain enough configuration
metadata (default values, valid entries, ect..) to tell the block
manager how to create the form to present. Should we use RDF for this or
schemas are good enough?
3) Which avalon container should we use since the one we currently use
(ECM) is not powerful enough? is there already a container which is
powerful enough to handle our needs as described here? if not, what do
we do? we implement our own or work with the avalon people to fix theirs
to meet our needs?
4) how do we implement the block manager? should it be a comman line
interface or a web interface, or both? what about security?
5) the 'uber library of cocoon blocks'. Where do we host it? how to we
manage it? How do we provide the block discovery web service? which
technology do we use: SOAP or REST?
6) should we "digitally sign" our blocks? if so, how?
--
Stefano Mazzocchi <st...@apache.org>
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1 (wiki page cleaned up)
Posted by Andreas Hochsteger <e9...@student.tuwien.ac.at>.
Hi!
I just removed the spaces after '{{{' which causes the ascii art to be screwed
up (at least with my browser). I thought I'd better let you know this,
because you explicitely mentioned, that this page should not be modified by
readers.
Bye,
Andreas
On Saturday 02 November 2002 12:36, Steven Noels wrote:
> Bertrand Delacretaz wrote:
> > On Saturday 02 November 2002 08:30, Steven Noels wrote:
> >> . . . please Bertrand, would you mind coming after me for cleanup?
> >> . . .
> >
> > Done. My kids are older, they don't run around this much anymore ;-)
>
> I gave them something todo and picked it up from where you left it :-)
>
> > There is still some text in square brackets to fix though, JSPWiki
> > tries to make links from it.
>
> The numbered lists are pretty awkward, too.
>
> Now I know why I prefer semantical markup :-D
>
> Stefano, could you take a look at it and see whether we captured the
> spirit inferred by you careful ASCII formatting?
>
> </Steven>
--
Bye,
Andreas Hochsteger
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1 (wiki page cleaned up)
Posted by Steven Noels <st...@outerthought.org>.
Bertrand Delacretaz wrote:
> On Saturday 02 November 2002 08:30, Steven Noels wrote:
>
>> . . . please Bertrand, would you mind coming after me for cleanup?
>> . . .
>
>
> Done. My kids are older, they don't run around this much anymore ;-)
I gave them something todo and picked it up from where you left it :-)
> There is still some text in square brackets to fix though, JSPWiki
> tries to make links from it.
The numbered lists are pretty awkward, too.
Now I know why I prefer semantical markup :-D
Stefano, could you take a look at it and see whether we captured the
spirit inferred by you careful ASCII formatting?
</Steven>
--
Steven Noels http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
stevenn@outerthought.org stevenn@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1 (wiki page cleaned up)
Posted by Bertrand Delacretaz <bd...@codeconsult.ch>.
On Saturday 02 November 2002 08:30, Steven Noels wrote:
>. . .
> please Bertrand, would you mind coming after me for cleanup?
>. . .
Done. My kids are older, they don't run around this much anymore ;-)
There is still some text in square brackets to fix though, JSPWiki tries to
make links from it.
-Bertrand
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Steven Noels <st...@outerthought.org>.
Stefano Mazzocchi wrote:
>
> Cocoon Blocks
To make sure that we don't loose this for documentation purposes, I
added it to the Wiki under
http://outerthought.net/wiki/Wiki.jsp?page=BlocksDefinition
Please keep the discussion on the list however!
It's a very rough Wiki codification (three kids running around me), so
please Bertrand, would you mind coming after me for cleanup?
</Steven>
--
Steven Noels http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
stevenn@outerthought.org stevenn@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Stefano Mazzocchi wrote:
> Sylvain Wallez wrote:
>
>> The contract of a block should be services identified by their URI,
>> and not files at well-known locations (even if these 'files' are in
>> fact produced by a pipeline).
>>
>> <snip/>
>>
>> By considering blocks as pipeline services, we really achieve true
>> polymorphism for blocks, because we totally abstract the way their
>> contracts are implemented.
>>
>> [note that all the above isn't in fact block-specific and can be made
>> today inside a single sitemap]
>>
> Gotcha!
>
> What can I say: I agree!
Cool ;-)
>> After this we had a long conversation about the semantics to be used
>> to identify which part of a pipeline we want the caller to use, which
>> unfortunately fell flat because I wasn't able to make you understand
>> my thoughts. I'd like someday to have the luck Carsten had recently
>> to meet you for real. Too bad the GetTogether is the same week as the
>> ApacheCon :-(
>
>
> Yeah :/ well, you know, you were next on my list anyway :)
Super-cool ;-))
> Ah, BTW, I'm going to be travelling a lot in the next month or so,
> I'll post a schedule so that if anybody is around and want to have a
> beer and talk geek, I'm game.
Ok, just tell us the "Stefano tour" locations ;-)
>> Anyway, let's forget for now these syntactic problems. The important
>> thing above is that a block should provide services by means of
>> pipeline URIs and not resources.
>
>
> Good, I like it. Care to edit the version 1.2 of that document to show
> us what you mean also syntactically? I think that would help a lot.
I won't be able to do it soon as I'm damn late for things I have to
prepare for the 3 coming weeks : Cocoon training next week, "Forum XML"
exhibition in Paris the week after (BTW, any people going there ?), and
GetTogether presentation still after. This leads to 20 november :-/
>> > The best solution is to allow my block to explicitly "extend" that
>> > block and inherits the resources that it doesn't contain.
>>
>> Side note : we must not forget to allow a block to call
>> services/resources of its parent block (like a "super" call in Java).
>
>
> How do you envision this to happen? Can you come up with a real need
> for such a thing? Just checking you are designing by parallel here. In
> fact, I added inheritance after I noticed that one of my customers I
> did consulting for had a problem that could be solved wonderfully with
> block inheritance (mostly, it was block personalization for different
> customers).
This came after thinking that a block could "extend" its parent services
or even resources by wrapping them. Imagine for example a skin block
that formats documents like its parent, but adds a legal notice at the
bottom of each page. There are certainly lots of good use cases for this.
> Also, how do you make this happening? something like
>
> <map:call resource="block:parent://whatever/service"/>
>
> would that be enough? could that be harmful or provide security concerns?
Well, I'm too tired at present for further thinking. Let's add it to the
todo list !
<snip what="discussion on version management"/>
>> Ok. I hope this time this notion of "pipeline services" will go
>> further and that we will solve the misunderstanding we had 4 months
>> ago...
>
>
> Yeah, I think it will. Last time you threw in the syntactic concern
> hoping that others understood the semantic concern underneath it, but
> this time is definately clearer :)
Hey, I just copy/pasted my 4 months old post :-)
But you're right : last time, my explanation failed because we each
understood something different through a syntactic construct. I'll try
differently this time... when I'll be able to find the time...
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.2 -> Iterative development is good
Posted by Ivelin Ivanov <iv...@apache.org>.
One more thing that I wanted to mention is that for the initial version of
Cocoon Blocks,
I would suggest that we go simple by following the approach of WARs and
EARs.
Let's discuss the long term design and vision, however try release an early
version,
which does not have some of the advanced features like inheritance and
dependencies.
Being able to deploy naked Cocoon and deploy/undeploy independent components
is the one
feature that has been requested a lot and we should deliver soon.
Offering a good componentizing mechanism is imperative to becoming a
respectable top level Apache project.
Ivelin
----- Original Message -----
From: "Ivelin Ivanov" <iv...@apache.org>
To: <co...@xml.apache.org>
Sent: Friday, November 08, 2002 11:20 PM
Subject: Re: [design] Cocoon Blocks 1.2 - Glorified Mount
>
> Along the way of following this discussion, I came up with the following
> suggestion:
>
> First of all, this is a good page:
> http://outerthought.net/wiki/Wiki.jsp?page=UnderstandingCocoonMounts
> It is the kind of HOWTO doc we need in the main docs.
>
>
>
>
>
> -====[ Extending <map:mount/> ]====-
>
>
>
>
>
> -============================-
> | Part I - the "jar" protocol |
> -============================-
>
>
> Let's set the base line with the following popular automount example:
>
> <map:match pattern="auto/*/**">
> <map:mount uri-prefix="auto/{1}/"
> src="http://hostname/cocoon/blocks/auto/{1}"/>
> </map:match>
>
>
>
> How about allowing the following alternatives for src (partially borrowed
> from Tomcat):
>
> src="jar:file:/absolute/path/to/a/block.cob"
> src="jar:http://hostname:port/path/to/a/block.cob"
>
> The jar protocol is of course the one handled by the standard JDK net
> library.
>
http://java.sun.com/products/jdk/1.2/docs/api/java/net/JarURLConnection.html
>
>
> Just like JBoss reads EARs from such urls and looks up META-INF/... and
> Tomcat reads WARs then looks up WEB-INF/..., we can write in the
> specification how Cocoon will read COBs and will look up BLOCK-INF/...
(lib,
> classes, .xconf, etc.)
>
> This will possibly allow us to borrow a lot from the J2EE specs in terms
of
> class loading, security, signatures, deployment, life cycle and other
> aspects.
>
>
>
> -0-0-0-
>
>
>
> -=================================-
> | Part II - the "service" protocol |
> -=================================-
>
>
> Now, we can also merge the WebServiceProxyGenerator and <map:mount/> into
> something like:
>
> <map:match pattern="auto/*/**">
> <map:mount uri-prefix="auto/{1}/"
> src="service:http://hostname/cocoon/blocks/auto/{1}"/>
> </map:match>
>
>
> Where the src is prefixed with a service protocol, which implies that
> requests which
> match pattern="auto/*/**" will be forwarded(proxied) to the URL after
> service: and the
> output will be available to the parent sitemap, just like with regular
> mount.
>
> This will allow remote hosting of services/blocks, while to the users of
the
> current applications it will appear like everything is served by it
> directly.
> To clarify, as far as the service protocol is concerned, it doesn't matter
> what runs the remote site.
> It can be any web server, including Cocoon. See the following demo for
> example of remote service hosted by Amazon and OpenWiki:
> http://www.cocoonhive.org/portal/home
>
>
> With this in place we can get rid of the current WebServiceProxyGenerator
> and replace it with a simple file generator, which uses the cocoon
protocol.
> In other words, what used to be:
>
>
> <map:match ...
> <map:generate type="wsproxy" src=http://host123/some/service...
>
>
> will become:
>
>
> <map:match
> <map:generate src="cocoon:some/service"
>
> <map:match "some/service"
> <map:mount src="service:http://host123/some/service/...
>
>
>
> In addition to sitemap simplicity, the offered approach will also allow
the
> remote call to return any content type, not necessarily XML. Therefore it
> would be possible to refer to it from readers and any other component
which
> uses the Avalon source resolver.
>
> One more added value is that a site can start simple by using remote
> services and then as user demand increases, it will be able to move a
Cocoon
> block locally by making one simple change, which is replacing the mount
src
> from service:... to jar:... .
>
>
> One apparent difficulty with the service protocol is propagating all the
> sitemap information normally available to locally mounted sitemaps.
> I think that this information should be generally unavailable to remote
> services.
> However explicit parameters could be passed on. For example:
>
>
> <map:match "some/service"
> <map:mount src="service:http://host123/some/service/...
> <map:parameter name="request-parameter-to-service-1"
> value="{local-sitemap-param-A}"/>
> <map:parameter name="request-parameter-to-service-2"
> value="{local-sitemap-param-B}"/>
> </map:mount>
>
>
>
>
> -0-0-0-
>
>
>
> -===[ End of Proposal ]===-
>
>
>
> Thoughts?
>
>
> Ivelin
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.2 - Glorified Mount
Posted by Ivelin Ivanov <iv...@apache.org>.
Along the way of following this discussion, I came up with the following
suggestion:
First of all, this is a good page:
http://outerthought.net/wiki/Wiki.jsp?page=UnderstandingCocoonMounts
It is the kind of HOWTO doc we need in the main docs.
-====[ Extending <map:mount/> ]====-
-============================-
| Part I - the "jar" protocol |
-============================-
Let's set the base line with the following popular automount example:
<map:match pattern="auto/*/**">
<map:mount uri-prefix="auto/{1}/"
src="http://hostname/cocoon/blocks/auto/{1}"/>
</map:match>
How about allowing the following alternatives for src (partially borrowed
from Tomcat):
src="jar:file:/absolute/path/to/a/block.cob"
src="jar:http://hostname:port/path/to/a/block.cob"
The jar protocol is of course the one handled by the standard JDK net
library.
http://java.sun.com/products/jdk/1.2/docs/api/java/net/JarURLConnection.html
Just like JBoss reads EARs from such urls and looks up META-INF/... and
Tomcat reads WARs then looks up WEB-INF/..., we can write in the
specification how Cocoon will read COBs and will look up BLOCK-INF/... (lib,
classes, .xconf, etc.)
This will possibly allow us to borrow a lot from the J2EE specs in terms of
class loading, security, signatures, deployment, life cycle and other
aspects.
-0-0-0-
-=================================-
| Part II - the "service" protocol |
-=================================-
Now, we can also merge the WebServiceProxyGenerator and <map:mount/> into
something like:
<map:match pattern="auto/*/**">
<map:mount uri-prefix="auto/{1}/"
src="service:http://hostname/cocoon/blocks/auto/{1}"/>
</map:match>
Where the src is prefixed with a service protocol, which implies that
requests which
match pattern="auto/*/**" will be forwarded(proxied) to the URL after
service: and the
output will be available to the parent sitemap, just like with regular
mount.
This will allow remote hosting of services/blocks, while to the users of the
current applications it will appear like everything is served by it
directly.
To clarify, as far as the service protocol is concerned, it doesn't matter
what runs the remote site.
It can be any web server, including Cocoon. See the following demo for
example of remote service hosted by Amazon and OpenWiki:
http://www.cocoonhive.org/portal/home
With this in place we can get rid of the current WebServiceProxyGenerator
and replace it with a simple file generator, which uses the cocoon protocol.
In other words, what used to be:
<map:match ...
<map:generate type="wsproxy" src=http://host123/some/service...
will become:
<map:match
<map:generate src="cocoon:some/service"
<map:match "some/service"
<map:mount src="service:http://host123/some/service/...
In addition to sitemap simplicity, the offered approach will also allow the
remote call to return any content type, not necessarily XML. Therefore it
would be possible to refer to it from readers and any other component which
uses the Avalon source resolver.
One more added value is that a site can start simple by using remote
services and then as user demand increases, it will be able to move a Cocoon
block locally by making one simple change, which is replacing the mount src
from service:... to jar:... .
One apparent difficulty with the service protocol is propagating all the
sitemap information normally available to locally mounted sitemaps.
I think that this information should be generally unavailable to remote
services.
However explicit parameters could be passed on. For example:
<map:match "some/service"
<map:mount src="service:http://host123/some/service/...
<map:parameter name="request-parameter-to-service-1"
value="{local-sitemap-param-A}"/>
<map:parameter name="request-parameter-to-service-2"
value="{local-sitemap-param-B}"/>
</map:mount>
-0-0-0-
-===[ End of Proposal ]===-
Thoughts?
Ivelin
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Ivelin Ivanov <iv...@apache.org>.
With this syntax how would you say that compatibility is guaranteed
from version 1.1.0 through 1.3.5 ?
Isn't the standard Java versioning mechanism for JARs good enough?
It has 2 separate versioning conepts: Specification Version and
Implementation version.
http://java.sun.com/j2se/1.4/docs/guide/versioning/spec/VersioningSpecificat
ion.html#PackageVersioning
Ivelin
----- Original Message -----
From: "Stefano Mazzocchi" <st...@apache.org>
To: <co...@xml.apache.org>
Sent: Sunday, November 03, 2002 7:56 AM
Subject: Re: [design] Cocoon Blocks 1.1
> Sylvain Wallez wrote:
>
> > The contract of a block should be services identified by their URI,
> > and not files at well-known locations (even if these 'files' are in
> > fact produced by a pipeline).
> >
> > <snip/>
> >
> > By considering blocks as pipeline services, we really achieve true
> > polymorphism for blocks, because we totally abstract the way their
> > contracts are implemented.
> >
> > [note that all the above isn't in fact block-specific and can be made
> > today inside a single sitemap]
> >
> Gotcha!
>
> What can I say: I agree!
>
> >
> >
> > After this we had a long conversation about the semantics to be used
> > to identify which part of a pipeline we want the caller to use, which
> > unfortunately fell flat because I wasn't able to make you understand
> > my thoughts. I'd like someday to have the luck Carsten had recently to
> > meet you for real. Too bad the GetTogether is the same week as the
> > ApacheCon :-(
>
> Yeah :/ well, you know, you were next on my list anyway :)
>
> Ah, BTW, I'm going to be travelling a lot in the next month or so, I'll
> post a schedule so that if anybody is around and want to have a beer and
> talk geek, I'm game.
>
> > Anyway, let's forget for now these syntactic problems. The important
> > thing above is that a block should provide services by means of
> > pipeline URIs and not resources.
>
> Good, I like it. Care to edit the version 1.2 of that document to show
> us what you mean also syntactically? I think that would help a lot.
>
> > > The best solution is to allow my block to explicitly "extend" that
> > > block and inherits the resources that it doesn't contain.
> >
> > Side note : we must not forget to allow a block to call
> > services/resources of its parent block (like a "super" call in Java).
>
> How do you envision this to happen? Can you come up with a real need for
> such a thing? Just checking you are designing by parallel here. In fact,
> I added inheritance after I noticed that one of my customers I did
> consulting for had a problem that could be solved wonderfully with block
> inheritance (mostly, it was block personalization for different
customers).
>
> Also, how do you make this happening? something like
>
> <map:call resource="block:parent://whatever/service"/>
>
> would that be enough? could that be harmful or provide security concerns?
>
> > > TODO
> > > ----
> > >
> > > 1) blocks should allow to depend on 'ranges' of behavior versions.
> > > Let's try to come up with a way to describe those ranges effectively.
> >
> > IIRC, there's something in Avalon to handle this.
>
> Hmmm, not sure.
>
> Here is a possible syntax for versioning ranges of block behaviors:
>
> 1.3 -> matches version 1.3 only
> 1.x -> matches all minor versions of the first major version
> 1.(3-8) -> matches from version 1.3 to 1.8 included
> 1.(3-x) -> matches all versions higher than 1.3 and lower than 2.0
>
> which can also be applied to block versions
>
> 1.3.340 -> matches bugfix 130 of minor version 3 and major version 1
> 1.3.(48-x) -> matches from bugfix 48 on
>
> NOTE: multiple ranges are semantically meaningless, for example
>
> (2-3).(3-x)
>
> since there is no semantic correlation between the same minor versions
> if done on different major generations. Or, at least, there should be
none.
>
> So, if you say:
>
> this block implements http://myblocks.org/pdf/2.(3-x)
>
> you are infact indicating that your block implements all 2.x versions of
> the behavior starting from 2.3 and up to 3.0 excluded.
>
> > Ok. I hope this time this notion of "pipeline services" will go
> > further and that we will solve the misunderstanding we had 4 months
ago...
>
> Yeah, I think it will. Last time you threw in the syntactic concern
> hoping that others understood the semantic concern underneath it, but
> this time is definately clearer :)
>
> --
> Stefano Mazzocchi <st...@apache.org>
> --------------------------------------------------------------------
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stefano Mazzocchi <st...@apache.org>.
Sylvain Wallez wrote:
> The contract of a block should be services identified by their URI,
> and not files at well-known locations (even if these 'files' are in
> fact produced by a pipeline).
>
> <snip/>
>
> By considering blocks as pipeline services, we really achieve true
> polymorphism for blocks, because we totally abstract the way their
> contracts are implemented.
>
> [note that all the above isn't in fact block-specific and can be made
> today inside a single sitemap]
>
Gotcha!
What can I say: I agree!
>
>
> After this we had a long conversation about the semantics to be used
> to identify which part of a pipeline we want the caller to use, which
> unfortunately fell flat because I wasn't able to make you understand
> my thoughts. I'd like someday to have the luck Carsten had recently to
> meet you for real. Too bad the GetTogether is the same week as the
> ApacheCon :-(
Yeah :/ well, you know, you were next on my list anyway :)
Ah, BTW, I'm going to be travelling a lot in the next month or so, I'll
post a schedule so that if anybody is around and want to have a beer and
talk geek, I'm game.
> Anyway, let's forget for now these syntactic problems. The important
> thing above is that a block should provide services by means of
> pipeline URIs and not resources.
Good, I like it. Care to edit the version 1.2 of that document to show
us what you mean also syntactically? I think that would help a lot.
> > The best solution is to allow my block to explicitly "extend" that
> > block and inherits the resources that it doesn't contain.
>
> Side note : we must not forget to allow a block to call
> services/resources of its parent block (like a "super" call in Java).
How do you envision this to happen? Can you come up with a real need for
such a thing? Just checking you are designing by parallel here. In fact,
I added inheritance after I noticed that one of my customers I did
consulting for had a problem that could be solved wonderfully with block
inheritance (mostly, it was block personalization for different customers).
Also, how do you make this happening? something like
<map:call resource="block:parent://whatever/service"/>
would that be enough? could that be harmful or provide security concerns?
> > TODO
> > ----
> >
> > 1) blocks should allow to depend on 'ranges' of behavior versions.
> > Let's try to come up with a way to describe those ranges effectively.
>
> IIRC, there's something in Avalon to handle this.
Hmmm, not sure.
Here is a possible syntax for versioning ranges of block behaviors:
1.3 -> matches version 1.3 only
1.x -> matches all minor versions of the first major version
1.(3-8) -> matches from version 1.3 to 1.8 included
1.(3-x) -> matches all versions higher than 1.3 and lower than 2.0
which can also be applied to block versions
1.3.340 -> matches bugfix 130 of minor version 3 and major version 1
1.3.(48-x) -> matches from bugfix 48 on
NOTE: multiple ranges are semantically meaningless, for example
(2-3).(3-x)
since there is no semantic correlation between the same minor versions
if done on different major generations. Or, at least, there should be none.
So, if you say:
this block implements http://myblocks.org/pdf/2.(3-x)
you are infact indicating that your block implements all 2.x versions of
the behavior starting from 2.3 and up to 3.0 excluded.
> Ok. I hope this time this notion of "pipeline services" will go
> further and that we will solve the misunderstanding we had 4 months ago...
Yeah, I think it will. Last time you threw in the syntactic concern
hoping that others understood the semantic concern underneath it, but
this time is definately clearer :)
--
Stefano Mazzocchi <st...@apache.org>
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Michael Melhem <mi...@fztig938.bank.dresdner.net>.
On Sun, 3 Nov 2002, Sylvain Wallez wrote:
> Stefano Mazzocchi wrote:
>
> >
> > Cocoon Blocks
> > -------------
> >
> > author: Stefano Mazzocchi
> > status: working draft
> > version: 1.1
> >
>
> >please note the
> >
> > block:skin:/stylesheets/site2xhtml.xslt
> >
>
> IMHO, this example goes strongly against the benefits that blocks want
> to bring. The functionnality brought by the 'skin' block is... skinning.
> It's not an XSL stylesheet at a particular location. What if someone has
> written the killer skin for his site, but this skin requires a
> multi-stage pipeline that cannot be represented by a single stylesheet ?
>
> The contract of a block should be services identified by their URI, and
> not files at well-known locations (even if these 'files' are in fact
> produced by a pipeline).
>
> So what about something like :
> ...
> </map:aggregate>
> <map:call resource="block:skin:/site2xhtml"/>
> </map:match>
>
> This call "jumps" to a service provided by the block and its URI is part
> of the block's contract. We don't care (because we don't have to) if the
> service is implemented by an XSL or by the next-generation transformer.
>
> What the "jump" does is feed a pipeline in the block with the result of
> the current pipeline. The whole pipeline is terminated in the called block.
>
> But just as a pipeline can serialize or not depending on if it's an
> internal request or not (see SitemapSource), the same service could be
> used as a transformation. We could then write something like :
> ...
> </map:aggregate>
> <map:transform type="pipeline" src="block:skin:/site2xhtml"/>
Hmmm...I have question about this...
Why is the transfomer here of type "pipeline"? As far as I understand
its not the "pipeline-service" thats doing the transformation,
the "pipeline-service" simply builds the transformer src??
Shouldnt the transformer type be "xslt" or "xalan" in
this case? Or have I missed something :)
> <map:transform type="urlencoder"/>
> <map:serialize/>
> </map:match>
>
> By considering blocks as pipeline services, we really achieve true
> polymorphism for blocks, because we totally abstract the way their
> contracts are implemented.
While I totally agree that, for example, "application" blocks should be
considered as pipeline-services, its probably worth noting here (for the sake
of completion) that this is not imply that Blocks must define
"pipeline-sevices" Eg FOP Block.
Regards,
Michael Melhem
>
> [note that all the above isn't in fact block-specific and can be made
> today inside a single sitemap]
>
> </old-post-quote>
>
> --
> Sylvain Wallez Anyware Technologies
> http://www.apache.org/~sylvain http://www.anyware-tech.com
> { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stephen McConnell <mc...@apache.org>.
Carsten Ziegeler wrote:
>Stephen McConnell wrote:
>
>
>>>Do you mean this (I guess not ;) )?
>>>
>>>
>>>
>>I think we are saying the same thing.
>>
>>:-)
>>
>>
>>
>Great! ;)
>
>
>
>>Assuming that we don't want to expose blocks in a classloader to the
>>client - instead what we want is a expose of the services that a block
>>provides to the client. However, as pointed out in several of the
>>messages on this topic, there is a requirement for the overloading of
>>the result of URI based resource resolution. Given the principal of
>>seperation of the block (in terms of client accessibility), then a
>>service is needed against which resources can be resolved based on
>>supplied URIs (as distinct from classloader based access to resources).
>>
>>
>>
>Yes, that's right.
>
>
:-)
>Now, as we all agree...we only have to get 2.1 out of the doors...
>
>
Go, go, go...!
Cheers, Steve.
>Carsten
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
>For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [design] Cocoon Blocks 1.1
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Stephen McConnell wrote:
> >
> >Do you mean this (I guess not ;) )?
> >
>
> I think we are saying the same thing.
>
> :-)
>
Great! ;)
> Assuming that we don't want to expose blocks in a classloader to the
> client - instead what we want is a expose of the services that a block
> provides to the client. However, as pointed out in several of the
> messages on this topic, there is a requirement for the overloading of
> the result of URI based resource resolution. Given the principal of
> seperation of the block (in terms of client accessibility), then a
> service is needed against which resources can be resolved based on
> supplied URIs (as distinct from classloader based access to resources).
>
Yes, that's right.
Now, as we all agree...we only have to get 2.1 out of the doors...
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stephen McConnell <mc...@apache.org>.
Carsten Ziegeler wrote:
>Stephen McConnell wrote:
>
>
>>Carsten Ziegeler wrote:
>>
>>
>>
>>>a) I think a block should also be able to expose resources directly, e.g.
>>> images.
>>>
>>>
>>>
>>Carsten:
>>
>>Do you think it would be reasonable for access to a resource to be
>>expressed as a service. I.e. the client goes though an interface exposed
>>as a service to access the resource. This present the benefit that the
>>block (as the resource repository) does not need to be exposed to the
>>client. It also means that we are always dealing with the same
>>conceptual service access model.
>>
>>
>>
>Sorry, perhaps we are talking about the same thing, but I lost you here.
>I think, it makes sense to access resources (= files) via the block
>protocol, e.g.:
>
><map:read src="block:skin://images/logo.jpg"/>
>
>Now, we could say that "images/logo.jpg" is resolved using a sitemap
>and therefore implemented as a pipeline, so resources are not served
>directory.
>
>Do you mean this (I guess not ;) )?
>
I think we are saying the same thing.
:-)
Assuming that we don't want to expose blocks in a classloader to the
client - instead what we want is a expose of the services that a block
provides to the client. However, as pointed out in several of the
messages on this topic, there is a requirement for the overloading of
the result of URI based resource resolution. Given the principal of
seperation of the block (in terms of client accessibility), then a
service is needed against which resources can be resolved based on
supplied URIs (as distinct from classloader based access to resources).
Cheers, Steve.
>Carsten
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
>For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [design] Cocoon Blocks 1.1
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Stephen McConnell wrote:
>
>
> Carsten Ziegeler wrote:
>
> >a) I think a block should also be able to expose resources directly, e.g.
> > images.
> >
> Carsten:
>
> Do you think it would be reasonable for access to a resource to be
> expressed as a service. I.e. the client goes though an interface exposed
> as a service to access the resource. This present the benefit that the
> block (as the resource repository) does not need to be exposed to the
> client. It also means that we are always dealing with the same
> conceptual service access model.
>
Sorry, perhaps we are talking about the same thing, but I lost you here.
I think, it makes sense to access resources (= files) via the block
protocol, e.g.:
<map:read src="block:skin://images/logo.jpg"/>
Now, we could say that "images/logo.jpg" is resolved using a sitemap
and therefore implemented as a pipeline, so resources are not served
directory.
Do you mean this (I guess not ;) )?
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stephen McConnell <mc...@apache.org>.
Carsten Ziegeler wrote:
>Sylvain Wallez wrote:
>
>
>>IMHO, this example goes strongly against the benefits that blocks want
>>to bring. The functionnality brought by the 'skin' block is... skinning.
>>It's not an XSL stylesheet at a particular location. What if someone has
>>written the killer skin for his site, but this skin requires a
>>multi-stage pipeline that cannot be represented by a single stylesheet ?
>>
>>The contract of a block should be services identified by their URI, and
>>not files at well-known locations (even if these 'files' are in fact
>>produced by a pipeline).
>>
>>So what about something like :
>> ...
>> </map:aggregate>
>> <map:call resource="block:skin:/site2xhtml"/>
>></map:match>
>>
>>This call "jumps" to a service provided by the block and its URI is part
>>of the block's contract. We don't care (because we don't have to) if the
>>service is implemented by an XSL or by the next-generation transformer.
>>
>>What the "jump" does is feed a pipeline in the block with the result of
>>the current pipeline. The whole pipeline is terminated in the
>>called block.
>>
>>But just as a pipeline can serialize or not depending on if it's an
>>internal request or not (see SitemapSource), the same service could be
>>used as a transformation. We could then write something like :
>> ...
>> </map:aggregate>
>> <map:transform type="pipeline" src="block:skin:/site2xhtml"/>
>> <map:transform type="urlencoder"/>
>> <map:serialize/>
>></map:match>
>>
>>By considering blocks as pipeline services, we really achieve true
>>polymorphism for blocks, because we totally abstract the way their
>>contracts are implemented.
>>
>>
>>
>
>I absolutely agree with this, but I have two comments:
>
>a) I think a block should also be able to expose resources directly, e.g.
> images.
>
Carsten:
Do you think it would be reasonable for access to a resource to be
expressed as a service. I.e. the client goes though an interface exposed
as a service to access the resource. This present the benefit that the
block (as the resource repository) does not need to be exposed to the
client. It also means that we are always dealing with the same
conceptual service access model.
Cheers, Steve.
>b) Is it possible to unify map:call and map:transform? Does it make sense?
> Or is it better to have a different notation to emphasize the different
> usage?
>
>Carsten
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
>For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [design] Cocoon Blocks 1.1
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Sylvain Wallez wrote:
>
> IMHO, this example goes strongly against the benefits that blocks want
> to bring. The functionnality brought by the 'skin' block is... skinning.
> It's not an XSL stylesheet at a particular location. What if someone has
> written the killer skin for his site, but this skin requires a
> multi-stage pipeline that cannot be represented by a single stylesheet ?
>
> The contract of a block should be services identified by their URI, and
> not files at well-known locations (even if these 'files' are in fact
> produced by a pipeline).
>
> So what about something like :
> ...
> </map:aggregate>
> <map:call resource="block:skin:/site2xhtml"/>
> </map:match>
>
> This call "jumps" to a service provided by the block and its URI is part
> of the block's contract. We don't care (because we don't have to) if the
> service is implemented by an XSL or by the next-generation transformer.
>
> What the "jump" does is feed a pipeline in the block with the result of
> the current pipeline. The whole pipeline is terminated in the
> called block.
>
> But just as a pipeline can serialize or not depending on if it's an
> internal request or not (see SitemapSource), the same service could be
> used as a transformation. We could then write something like :
> ...
> </map:aggregate>
> <map:transform type="pipeline" src="block:skin:/site2xhtml"/>
> <map:transform type="urlencoder"/>
> <map:serialize/>
> </map:match>
>
> By considering blocks as pipeline services, we really achieve true
> polymorphism for blocks, because we totally abstract the way their
> contracts are implemented.
>
I absolutely agree with this, but I have two comments:
a) I think a block should also be able to expose resources directly, e.g.
images.
b) Is it possible to unify map:call and map:transform? Does it make sense?
Or is it better to have a different notation to emphasize the different
usage?
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stefano Mazzocchi <st...@apache.org>.
Ovidiu Predescu wrote:
> 1. I definitely agree with Sylvain's view of blocks as classes, not as
> instances. I think is important to expose pipelines and not individual
> resources. Sylvain explained to me why this is important when it came to
> the control flow layer, which now uses only pipelines and not resources.
Yes, I agree.
>
> 2. Another question is how are we dealing with flow scripts? Are we
> going to expose functions on a per-block level?
>
>
>
> Or we consider flows as resources of the block, hence hidden from the
> user, and accessible only through pipelines publicly exposed?
Yes, I like this one better as well.
>
> I would favor the latter, as it's in line with the pipelines idea
> Sylvain mentioned.
>
> 3. What is the relationship between libraries defined in a block and
> those defined in the container loading it? Are they loaded by the same
> classloader or by different classloaders?
Different classloaders, I would presume.
>
>
> I think the latter would help isolate contracts between different
> blocks, at the risk of duplicating libraries in the runtime system.
Yep, I'd like use a little more memory than having a bunch of class
versioning conflicts down the road. RAM is way cheaper than users's time
(and patience!)
> The
> impact should be minimal however in real life, with different blocks
> serving different purposes (FO generation etc.).
Yes, exactly. Also, the container should come with a minimal set of
libraries installed, and also we need separate classloaders because two
blocks could be using two different versions of the same block for bug
reasons.
>
> Coupled with the exposure of pipelines only, block contracts are then
> well defined and separated.
Yep.
--
Stefano Mazzocchi <st...@apache.org>
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Michael Melhem <mi...@fztig938.bank.dresdner.net>.
Hi Ovidiu
On Sun, 3 Nov 2002, Ovidiu Predescu wrote:
> 2. Another question is how are we dealing with flow scripts? Are we
> going to expose functions on a per-block level?
>
> <map:call function="block:user:login"/>
>
> Or we consider flows as resources of the block, hence hidden from the
> user, and accessible only through pipelines publicly exposed?
Im still coming to grips with "flow" but:
>From my point of view, flow methods should be considerd "private attributes" of
the sitemap (to borrow from the "class" analogy) and should not be available
directly from seperate blocks! As they should decrible the "flow" specific to
their local sitemap/block.
However it might make sense to have something like:
sendPage{block:uri}
If a particular flow depends on a certain "service" in a "dependend" block.
Regards
Michael Melhem
>
>
> --
> Ovidiu Predescu <ov...@apache.org>
> http://webweavertech.com/ovidiu/weblog/
>
> On Saturday, Nov 2, 2002, at 15:08 US/Pacific, Sylvain Wallez wrote:
>
> > Stefano Mazzocchi wrote:
> >
> >>
> >> Cocoon Blocks
> >> -------------
> >>
> >> author: Stefano Mazzocchi
> >> status: working draft
> >> version: 1.1
> >>
> >> (see the end of the document for changes from the previous version)
> >>
> >>
> >> DISCLAIMER: This document must be considered as a working draft and
> >> may be updated at any time.
> >
> >
> > OK. Let me throw in some material for version 1.2 ;-)
> >
> > Throughout this paper, examples show blocks providing "resources" to
> > their users (such as stylesheets of images), but the word "service" is
> > used several times to identify what is provided by a block, and IMO
> > services are more important to define a block contract than resources.
> >
> > Most of this was already stated after version 1.0, back in July. See
> > http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=102538716114027&w=2
> >
> > Here is the most relevant part :
> >
> > <old-post-quote>
> >
> >> please note the
> >>
> >> block:skin:/stylesheets/site2xhtml.xslt
> >>
> >
> > IMHO, this example goes strongly against the benefits that blocks want
> > to bring. The functionnality brought by the 'skin' block is...
> > skinning. It's not an XSL stylesheet at a particular location. What if
> > someone has written the killer skin for his site, but this skin
> > requires a multi-stage pipeline that cannot be represented by a single
> > stylesheet ?
> >
> > The contract of a block should be services identified by their URI,
> > and not files at well-known locations (even if these 'files' are in
> > fact produced by a pipeline).
> >
> > So what about something like :
> > ...
> > </map:aggregate>
> > <map:call resource="block:skin:/site2xhtml"/>
> > </map:match>
> >
> > This call "jumps" to a service provided by the block and its URI is
> > part of the block's contract. We don't care (because we don't have to)
> > if the service is implemented by an XSL or by the next-generation
> > transformer.
> >
> > What the "jump" does is feed a pipeline in the block with the result
> > of the current pipeline. The whole pipeline is terminated in the
> > called block.
> >
> > But just as a pipeline can serialize or not depending on if it's an
> > internal request or not (see SitemapSource), the same service could be
> > used as a transformation. We could then write something like :
> > ...
> > </map:aggregate>
> > <map:transform type="pipeline" src="block:skin:/site2xhtml"/>
> > <map:transform type="urlencoder"/>
> > <map:serialize/>
> > </map:match>
> >
> > By considering blocks as pipeline services, we really achieve true
> > polymorphism for blocks, because we totally abstract the way their
> > contracts are implemented.
> >
> > [note that all the above isn't in fact block-specific and can be made
> > today inside a single sitemap]
> >
> > </old-post-quote>
> >
> > After this we had a long conversation about the semantics to be used
> > to identify which part of a pipeline we want the caller to use, which
> > unfortunately fell flat because I wasn't able to make you understand
> > my thoughts. I'd like someday to have the luck Carsten had recently to
> > meet you for real. Too bad the GetTogether is the same week as the
> > ApacheCon :-(
> >
> > Anyway, let's forget for now these syntactic problems. The important
> > thing above is that a block should provide services by means of
> > pipeline URIs and not resources.
> >
> > If we were to compare a block with a Java class (not so silly, since
> > blocks now have inheritance), a pipeline service would be a method and
> > a resource would be an attribute. Is it good programming practice to
> > define a class contract by its attributes ? No, and the same applies
> > to blocks, if we want their contracts to be solid enough to accept
> > various implementations.
> >
> > I have kept below only parts that show the use of services :
> >
> > <snip/>
> >
> >> Improvement #1: component-oriented deployment
> >> ---------------------------------------------
> >>
> >> Let me give you a possible use-case scenario.
> >>
> >> Let us suppose that we implement WAR-like package deployment on top
> >> of Cocoon and that your application requires both PDF serialization
> >> and SVG->PNG rasterization.
> >>
> >> Then, you implement another cocoon web application and you still
> >> require PDF generation.
> >>
> >> Unfortunatley, since WAR-like installation isolates the packages and
> >> their classloaders, you have to install the PDF serialization
> >> libraries twice.
> >>
> >> Thus the idea of blocks as units of deployable service. Here is a
> >> picture:
> >
> >
> > So the main idea of blocks is about services. Great !
> >
> > <snip/>
> >
> >> Improvement #2: polymorphic behavior
> >> ------------------------------------
> >
> >
> > <snip/>
> >
> >> Here, the webapp1 requires "fo-pdf" serialization services but it
> >> does not care (nor should!) which implementation of this service is
> >> actually located into the system.
> >
> >
> > Sure : the "fo-pdf" _service_ can be implemented by a single
> > serializer, or by some transformations preceding another serializer.
> > This clearly cannot be a resource.
> >
> > <snip/>
> >
> >> Improvement #3: block inheritance
> >> ---------------------------------
> >
> >
> > <snip/>
> >
> >> The best solution is to allow my block to explicitly "extend" that
> >> block and inherits the resources that it doesn't contain.
> >
> >
> > Side note : we must not forget to allow a block to call
> > services/resources of its parent block (like a "super" call in Java).
> >
> > <snip/>
> >
> >> +---------------------------+
> >> | Part 2: technical details |
> >> +---------------------------+
> >
> >
> > <snip/>
> >
> >> Resource dereferencing
> >> ----------------------
> >
> >
> > <snip/>
> >
> >> For example, the myblock.cob/sitemap.xmap file could contain a global
> >> matcher which works like this:
> >>
> >> <map:match pattern="**/*.html">
> >> <map:generate src="{1}.xml"/>
> >> <map:transform src="block:skin:/stylesheets/document2html.xslt"/>
> >> <map:serialize/>
> >> </map:match>
> >>
> >> please note the
> >>
> >> block:skin:/stylesheets/document2html.xslt
> >
> >
> > Here is what triggered this idea of "pipeline services" ! This example
> > only shows publication of _resources_ (i.e. static files) by the block
> > !
> >
> > <snip/>
> >
> >> TODO
> >> ----
> >>
> >> 1) blocks should allow to depend on 'ranges' of behavior versions.
> >> Let's try to come up with a way to describe those ranges effectively.
> >
> >
> > IIRC, there's something in Avalon to handle this.
> >
> > <snip/>
> >
> > Ok. I hope this time this notion of "pipeline services" will go
> > further and that we will solve the misunderstanding we had 4 months
> > ago...
> >
> > Sylvain
> >
> > --
> > Sylvain Wallez Anyware Technologies
> > http://www.apache.org/~sylvain http://www.anyware-tech.com
> > { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Ovidiu Predescu <ov...@apache.org>.
1. I definitely agree with Sylvain's view of blocks as classes, not as
instances. I think is important to expose pipelines and not individual
resources. Sylvain explained to me why this is important when it came
to the control flow layer, which now uses only pipelines and not
resources.
2. Another question is how are we dealing with flow scripts? Are we
going to expose functions on a per-block level?
<map:call function="block:user:login"/>
Or we consider flows as resources of the block, hence hidden from the
user, and accessible only through pipelines publicly exposed?
I would favor the latter, as it's in line with the pipelines idea
Sylvain mentioned.
3. What is the relationship between libraries defined in a block and
those defined in the container loading it? Are they loaded by the same
classloader or by different classloaders?
I think the latter would help isolate contracts between different
blocks, at the risk of duplicating libraries in the runtime system.
The impact should be minimal however in real life, with different
blocks serving different purposes (FO generation etc.).
Coupled with the exposure of pipelines only, block contracts are then
well defined and separated.
Regards,
--
Ovidiu Predescu <ov...@apache.org>
http://webweavertech.com/ovidiu/weblog/
On Saturday, Nov 2, 2002, at 15:08 US/Pacific, Sylvain Wallez wrote:
> Stefano Mazzocchi wrote:
>
>>
>> Cocoon Blocks
>> -------------
>>
>> author: Stefano Mazzocchi
>> status: working draft
>> version: 1.1
>>
>> (see the end of the document for changes from the previous version)
>>
>>
>> DISCLAIMER: This document must be considered as a working draft and
>> may be updated at any time.
>
>
> OK. Let me throw in some material for version 1.2 ;-)
>
> Throughout this paper, examples show blocks providing "resources" to
> their users (such as stylesheets of images), but the word "service" is
> used several times to identify what is provided by a block, and IMO
> services are more important to define a block contract than resources.
>
> Most of this was already stated after version 1.0, back in July. See
> http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=102538716114027&w=2
>
> Here is the most relevant part :
>
> <old-post-quote>
>
>> please note the
>>
>> block:skin:/stylesheets/site2xhtml.xslt
>>
>
> IMHO, this example goes strongly against the benefits that blocks want
> to bring. The functionnality brought by the 'skin' block is...
> skinning. It's not an XSL stylesheet at a particular location. What if
> someone has written the killer skin for his site, but this skin
> requires a multi-stage pipeline that cannot be represented by a single
> stylesheet ?
>
> The contract of a block should be services identified by their URI,
> and not files at well-known locations (even if these 'files' are in
> fact produced by a pipeline).
>
> So what about something like :
> ...
> </map:aggregate>
> <map:call resource="block:skin:/site2xhtml"/>
> </map:match>
>
> This call "jumps" to a service provided by the block and its URI is
> part of the block's contract. We don't care (because we don't have to)
> if the service is implemented by an XSL or by the next-generation
> transformer.
>
> What the "jump" does is feed a pipeline in the block with the result
> of the current pipeline. The whole pipeline is terminated in the
> called block.
>
> But just as a pipeline can serialize or not depending on if it's an
> internal request or not (see SitemapSource), the same service could be
> used as a transformation. We could then write something like :
> ...
> </map:aggregate>
> <map:transform type="pipeline" src="block:skin:/site2xhtml"/>
> <map:transform type="urlencoder"/>
> <map:serialize/>
> </map:match>
>
> By considering blocks as pipeline services, we really achieve true
> polymorphism for blocks, because we totally abstract the way their
> contracts are implemented.
>
> [note that all the above isn't in fact block-specific and can be made
> today inside a single sitemap]
>
> </old-post-quote>
>
> After this we had a long conversation about the semantics to be used
> to identify which part of a pipeline we want the caller to use, which
> unfortunately fell flat because I wasn't able to make you understand
> my thoughts. I'd like someday to have the luck Carsten had recently to
> meet you for real. Too bad the GetTogether is the same week as the
> ApacheCon :-(
>
> Anyway, let's forget for now these syntactic problems. The important
> thing above is that a block should provide services by means of
> pipeline URIs and not resources.
>
> If we were to compare a block with a Java class (not so silly, since
> blocks now have inheritance), a pipeline service would be a method and
> a resource would be an attribute. Is it good programming practice to
> define a class contract by its attributes ? No, and the same applies
> to blocks, if we want their contracts to be solid enough to accept
> various implementations.
>
> I have kept below only parts that show the use of services :
>
> <snip/>
>
>> Improvement #1: component-oriented deployment
>> ---------------------------------------------
>>
>> Let me give you a possible use-case scenario.
>>
>> Let us suppose that we implement WAR-like package deployment on top
>> of Cocoon and that your application requires both PDF serialization
>> and SVG->PNG rasterization.
>>
>> Then, you implement another cocoon web application and you still
>> require PDF generation.
>>
>> Unfortunatley, since WAR-like installation isolates the packages and
>> their classloaders, you have to install the PDF serialization
>> libraries twice.
>>
>> Thus the idea of blocks as units of deployable service. Here is a
>> picture:
>
>
> So the main idea of blocks is about services. Great !
>
> <snip/>
>
>> Improvement #2: polymorphic behavior
>> ------------------------------------
>
>
> <snip/>
>
>> Here, the webapp1 requires "fo-pdf" serialization services but it
>> does not care (nor should!) which implementation of this service is
>> actually located into the system.
>
>
> Sure : the "fo-pdf" _service_ can be implemented by a single
> serializer, or by some transformations preceding another serializer.
> This clearly cannot be a resource.
>
> <snip/>
>
>> Improvement #3: block inheritance
>> ---------------------------------
>
>
> <snip/>
>
>> The best solution is to allow my block to explicitly "extend" that
>> block and inherits the resources that it doesn't contain.
>
>
> Side note : we must not forget to allow a block to call
> services/resources of its parent block (like a "super" call in Java).
>
> <snip/>
>
>> +---------------------------+
>> | Part 2: technical details |
>> +---------------------------+
>
>
> <snip/>
>
>> Resource dereferencing
>> ----------------------
>
>
> <snip/>
>
>> For example, the myblock.cob/sitemap.xmap file could contain a global
>> matcher which works like this:
>>
>> <map:match pattern="**/*.html">
>> <map:generate src="{1}.xml"/>
>> <map:transform src="block:skin:/stylesheets/document2html.xslt"/>
>> <map:serialize/>
>> </map:match>
>>
>> please note the
>>
>> block:skin:/stylesheets/document2html.xslt
>
>
> Here is what triggered this idea of "pipeline services" ! This example
> only shows publication of _resources_ (i.e. static files) by the block
> !
>
> <snip/>
>
>> TODO
>> ----
>>
>> 1) blocks should allow to depend on 'ranges' of behavior versions.
>> Let's try to come up with a way to describe those ranges effectively.
>
>
> IIRC, there's something in Avalon to handle this.
>
> <snip/>
>
> Ok. I hope this time this notion of "pipeline services" will go
> further and that we will solve the misunderstanding we had 4 months
> ago...
>
> Sylvain
>
> --
> Sylvain Wallez Anyware Technologies
> http://www.apache.org/~sylvain http://www.anyware-tech.com
> { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Stefano Mazzocchi wrote:
>
> Cocoon Blocks
> -------------
>
> author: Stefano Mazzocchi
> status: working draft
> version: 1.1
>
> (see the end of the document for changes from the previous version)
>
>
> DISCLAIMER: This document must be considered as a working draft and
> may be updated at any time.
OK. Let me throw in some material for version 1.2 ;-)
Throughout this paper, examples show blocks providing "resources" to
their users (such as stylesheets of images), but the word "service" is
used several times to identify what is provided by a block, and IMO
services are more important to define a block contract than resources.
Most of this was already stated after version 1.0, back in July. See
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=102538716114027&w=2
Here is the most relevant part :
<old-post-quote>
>please note the
>
> block:skin:/stylesheets/site2xhtml.xslt
>
IMHO, this example goes strongly against the benefits that blocks want
to bring. The functionnality brought by the 'skin' block is... skinning.
It's not an XSL stylesheet at a particular location. What if someone has
written the killer skin for his site, but this skin requires a
multi-stage pipeline that cannot be represented by a single stylesheet ?
The contract of a block should be services identified by their URI, and
not files at well-known locations (even if these 'files' are in fact
produced by a pipeline).
So what about something like :
...
</map:aggregate>
<map:call resource="block:skin:/site2xhtml"/>
</map:match>
This call "jumps" to a service provided by the block and its URI is part
of the block's contract. We don't care (because we don't have to) if the
service is implemented by an XSL or by the next-generation transformer.
What the "jump" does is feed a pipeline in the block with the result of
the current pipeline. The whole pipeline is terminated in the called block.
But just as a pipeline can serialize or not depending on if it's an
internal request or not (see SitemapSource), the same service could be
used as a transformation. We could then write something like :
...
</map:aggregate>
<map:transform type="pipeline" src="block:skin:/site2xhtml"/>
<map:transform type="urlencoder"/>
<map:serialize/>
</map:match>
By considering blocks as pipeline services, we really achieve true
polymorphism for blocks, because we totally abstract the way their
contracts are implemented.
[note that all the above isn't in fact block-specific and can be made
today inside a single sitemap]
</old-post-quote>
After this we had a long conversation about the semantics to be used to
identify which part of a pipeline we want the caller to use, which
unfortunately fell flat because I wasn't able to make you understand my
thoughts. I'd like someday to have the luck Carsten had recently to meet
you for real. Too bad the GetTogether is the same week as the ApacheCon :-(
Anyway, let's forget for now these syntactic problems. The important
thing above is that a block should provide services by means of pipeline
URIs and not resources.
If we were to compare a block with a Java class (not so silly, since
blocks now have inheritance), a pipeline service would be a method and a
resource would be an attribute. Is it good programming practice to
define a class contract by its attributes ? No, and the same applies to
blocks, if we want their contracts to be solid enough to accept various
implementations.
I have kept below only parts that show the use of services :
<snip/>
> Improvement #1: component-oriented deployment
> ---------------------------------------------
>
> Let me give you a possible use-case scenario.
>
> Let us suppose that we implement WAR-like package deployment on top of
> Cocoon and that your application requires both PDF serialization and
> SVG->PNG rasterization.
>
> Then, you implement another cocoon web application and you still
> require PDF generation.
>
> Unfortunatley, since WAR-like installation isolates the packages and
> their classloaders, you have to install the PDF serialization
> libraries twice.
>
> Thus the idea of blocks as units of deployable service. Here is a
> picture:
So the main idea of blocks is about services. Great !
<snip/>
> Improvement #2: polymorphic behavior
> ------------------------------------
<snip/>
> Here, the webapp1 requires "fo-pdf" serialization services but it does
> not care (nor should!) which implementation of this service is
> actually located into the system.
Sure : the "fo-pdf" _service_ can be implemented by a single serializer,
or by some transformations preceding another serializer. This clearly
cannot be a resource.
<snip/>
> Improvement #3: block inheritance
> ---------------------------------
<snip/>
> The best solution is to allow my block to explicitly "extend" that
> block and inherits the resources that it doesn't contain.
Side note : we must not forget to allow a block to call
services/resources of its parent block (like a "super" call in Java).
<snip/>
> +---------------------------+
> | Part 2: technical details |
> +---------------------------+
<snip/>
> Resource dereferencing
> ----------------------
<snip/>
> For example, the myblock.cob/sitemap.xmap file could contain a global
> matcher which works like this:
>
> <map:match pattern="**/*.html">
> <map:generate src="{1}.xml"/>
> <map:transform src="block:skin:/stylesheets/document2html.xslt"/>
> <map:serialize/>
> </map:match>
>
> please note the
>
> block:skin:/stylesheets/document2html.xslt
Here is what triggered this idea of "pipeline services" ! This example
only shows publication of _resources_ (i.e. static files) by the block !
<snip/>
> TODO
> ----
>
> 1) blocks should allow to depend on 'ranges' of behavior versions.
> Let's try to come up with a way to describe those ranges effectively.
IIRC, there's something in Avalon to handle this.
<snip/>
Ok. I hope this time this notion of "pipeline services" will go further
and that we will solve the misunderstanding we had 4 months ago...
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stephen McConnell <mc...@apache.org>.
Stefano Mazzocchi wrote:
>
> Easy here. The difference between Avalon and Cocoon is that Cocoon has
> a bigger and more focused community. Avalon framework is great. But
> everything else, well, it's fragmented like hell. It's mostly a tons
> of one-man shows. I hate that.
Just for reference there is an active process to resolve the issue you
correctly refered in the above statement.
http://marc.theaimsgroup.com/?t=103691454800002&r=1&w=2
Cheers, Steve.
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Peter Donald <pe...@apache.org>.
Hi,
On Fri, 8 Nov 2002 00:12, Stefano Mazzocchi wrote:
> > I agree, ECM isn't powerful enough to handle all this. The 2 new
> > Avalon containers are Fortress and Merlin.
> >
> > It would be great if there was some synergy between Avalon & Cocoon
> > to develop/improve one/both of these containers to be suitable for
> > use in Cocoon, rather than implement our own.
>
> I think everybody agrees here. I also think it would be great to count
> also Phoenix into that, althought I'm not sure on the issues there.
> Peter, what do you think?
Phoenix is not really appropriate in its current form - neither is any of the
other containers unfortunately. There is a lot of code that can be reused
directly and a lot knowledge that can be mined from avalon - however besides
some of the utility toolkits there is not much else :)
I ran into almost exactly the same issues when I was active on the Ant
proposal. Funnily enough it almost has identical requirements as Cocoon from
a container.
Anyways I have a sort of old document that describes different approachs and
tradeoffs. I will forrestize it and send it to you. From memory it basically
describes things like;
* differences between deployable units (think .wars) and reusable units (think
.jars)
* Why you should use the Extension/Optional Package specification to define
packages, versioning, dependency evaluation etc.
* Different approaches for classloader construction (cloned trees for each
"inheritance" tree).
* How to cascade resource lookup (sorta of related to inheritance aswell)
* layout of archives
* descriptor partioning and structure
* installing vs deploying deployable units
* metadata definitions and how to actually get them used by developers
etc.
There is also a bunch of utility code that is being built at the moment to
handle this sort of stuff. A lot of it is being cleaned, unit tested and
moved back into Excalibur from Phoenix (though it will probably end up at
Commons@Apache). Theres other stuff that is under development that would also
be useful.
Anyways I will see if I can get that doc and send it on.
> Easy here. The difference between Avalon and Cocoon is that Cocoon has a
> bigger and more focused community. Avalon framework is great. But
> everything else, well, it's fragmented like hell. It's mostly a tons of
> one-man shows. I hate that.
agreed. ;(
> Until this situations remains, I don't feel confortable with moving more
> stuff over to Avalon even if this makes sense architecturally.
Move it to Commons@Apache when it goes live ! ;)
--
Cheers,
Peter Donald
He strains to hear a whisper who refuses to hear a shout.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Marcus Crafter <cr...@fztig938.bank.dresdner.net>.
Hi Stefano,
Thanks again for the clarification. I'll think about the
validation issue over the next few days.
So, what has to be done to keep this thing rolling ? Do you already
have a plan of attack ?
Cheers,
Marcus
On Thu, Nov 07, 2002 at 05:05:37PM +0100, Stefano Mazzocchi wrote:
> Marcus Crafter wrote:
> > hmm.. perhaps I missed something then. If I want to write a block
> > that implements a particular interface (eg. myskin block which
> > implements the skin block interface) where is that interface
> > described ?
>
> In the documentation of that block behavior.
>
> Consider this: a java compiler checks for method signatures to be
> compatible with the class that implements an interface. Great. But there
> is no validation on whether or not the class implements this interface
> *correctly*, that information is included in the javadocs and it's by
> run-time tests that you really find out if two classes the implement the
> same contract behave the same. There is no way to tell at compile time.
>
> For blocks we have the same problem: how can we describe a URI space?
> how can we know how a particular service works? staring with HTTP
> actions, parameters, session, cookies. Can you imagine the complexity of
> a descriptor file for such a thing? It's WSDL++++ and WSDL is a
> nightmare already.
>
> That's why I proposed we ignore the issue alltogether and just write in
> documentation what we need.
>
> I know it sucks and I know people will soon forget to document and
> things might fall apart without tools enforcing practices, but hey, I
> really don't know how we can solve this.
>
> If you have ideas I'm all ears.
--
.....
,,$$$$$$$$$, Marcus Crafter
;$' '$$$$: Computer Systems Engineer
$: $$$$: ManageSoft GmbH
$ o_)$$$: 82-84 Mainzer Landstrasse
;$, _/\ &&:' 60327 Frankfurt Germany
' /( &&&
\_&&&&'
&&&&.
&&&&&&&:
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stefano Mazzocchi <st...@apache.org>.
Marcus Crafter wrote:
>
> >Eh, that would be nice indeed, but the block interface is *JUST* a URI.
> >Nothing more. There is no contract descriptor and this paragraph
> >explains exactly why: because it would be too difficult to know where to
> >stop describing the contract!
>
>
> hmm.. perhaps I missed something then. If I want to write a block
> that implements a particular interface (eg. myskin block which
> implements the skin block interface) where is that interface
> described ?
>
In the documentation of that block behavior.
Consider this: a java compiler checks for method signatures to be
compatible with the class that implements an interface. Great. But there
is no validation on whether or not the class implements this interface
*correctly*, that information is included in the javadocs and it's by
run-time tests that you really find out if two classes the implement the
same contract behave the same. There is no way to tell at compile time.
For blocks we have the same problem: how can we describe a URI space?
how can we know how a particular service works? staring with HTTP
actions, parameters, session, cookies. Can you imagine the complexity of
a descriptor file for such a thing? It's WSDL++++ and WSDL is a
nightmare already.
That's why I proposed we ignore the issue alltogether and just write in
documentation what we need.
I know it sucks and I know people will soon forget to document and
things might fall apart without tools enforcing practices, but hey, I
really don't know how we can solve this.
If you have ideas I'm all ears.
>
> I would need to know what services are exposed so that my
> implementation is complete - and I thought perhaps we could have a
> tool that generates a skeleton block implementation based on the
> description of these services.
>
>
>
>
> >> It would be great if there was some synergy between Avalon & Cocoon
> >> to develop/improve one/both of these containers to be suitable for
> >> use in Cocoon, rather than implement our own.
> >>
> >
> >I think everybody agrees here. I also think it would be great to count
> >also Phoenix into that, althought I'm not sure on the issues there.
> >Peter, what do you think?
>
>
> Including Phoenix would be fine with me - I'm not as familiar with
> it as the other containers and will have to dig a bit deeper
> there - over to you Peter :)
>
>
> >> Merlin offers better support for the meta-info approach to
> >> managing components and container hierarchies, whereas Fortress
> >> offers
> >> better ECM style compatibility. Both don't yet handle package
> >> level dependancies but I don't see any problems adding that.
> >>
> >> The choice of container is important though as a lot of what you
> >> describe could be container concerns rather than application
> >> concerns
> >> (eg. package validation, versioning, classloader management, etc).
> >>
> >
> >I'm fully aware of that.
> >
> >
> >> Having most of that at the container level makes it much easier
> >> for Cocoon which would then become the essential core, blocks,
> >> and perhaps any required container extensions, etc.
> >>
> >> This is where 2.1 has suffered IMO, as the 2.1 codebase includes
> >> features that IMO should really be handled at the container level
> >> (eg. extra avalon lifecycles, configuration file monitoring,
> >> sitemap/subsitap -> container hierarchy management, etc).
> >>
> >> Perhaps we need to investigate a bit deeper into what the
> >> container should do for us. This will allow selection of which
> >> container to be a bit easier.
> >>
> >
> >Easy here. The difference between Avalon and Cocoon is that Cocoon has a
> >bigger and more focused community. Avalon framework is great. But
> >everything else, well, it's fragmented like hell. It's mostly a tons of
> >one-man shows. I hate that.
> >
> >Until this situations remains, I don't feel confortable with moving more
> >stuff over to Avalon even if this makes sense architecturally.
> >
> >Please understand that 'much easier' highly depends on the POV:
>
>
> Oh, no offense intended there, I see your point regarding the
> current situation Avalon is in. What I wrote above was just based
> purely on my looking through the current 2.1 codebase and my
> understanding of the newer Avalon containers. Nothing negative
> intended there.
>
> In fact, a lot of newer features implemented in these newer Avalon
> containers can probably be accredited to developments in Cocoon.
>
> My point (which I'm sure you're fully aware of) was more to outline
> that container migration could result in us decreasing parts of the
> core codebase because many things we've implemented in 2.1 that
> essentially extend ECM are natively available at the container
> level - if possible, and where it makes sense, I hope we can
> capitalize on that.
>
>
> >> Once I get our admin app up and running here at the bank I'd be
> >> happy to look deeper into this.
> >
> >Great! That would be *very* helpful!
>
>
> No problem. Once I get this admin app up and going (soon) I'll take a
> look at it.
>
> Cheers,
>
> Marcus
>
--
Stefano Mazzocchi <st...@apache.org>
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Marcus Crafter <cr...@fztig938.bank.dresdner.net>.
Hi Stefano,
Thanks for your clarifications on my questions. More comments below.
On Thu, Nov 07, 2002 at 02:12:19PM +0100, Stefano Mazzocchi wrote:
>
> > Similar to virtual-packages in Debian ?
<snip/>
> Yes. Exactly. But we will use unique identifiers to indicate those
> 'virtual-packages' to allow versioning of the contract itself. (virtual
> package is a pretty bad name for what is, in fact, a contract and not a
> real package).
Ok, sounds great.
> >>2) polymorphism: I can have different implementations of the same
> >>behavior and I can switch them simply by acting on the block manager,
> >>without having to touch a single configuration line in any block. The
> >>blocks are, in fact, sealed.
> >
> > Does the installer choose based on some policy which
> > implementation will be used, or will it require an admin to choose
> > it at install time ?
>
> It is an implementation detail. It will be up to how we want to
> implement this.
>
> Like you, I see the need for automatic deployment without human
> intervention (this is great for clustered environments). So, instead of
> installing a cob, we could install a description of the entire
> collection of cobs with all the right dependencies (much as Phoenix does
> with server description files).
Ok. This description file was what I was referring to as a profile
in my earlier email. A description of all cobs satisfying
dependancies would be great.
> > If its policy based, do you think it's worth having the possibility
> > to recommend a particular implementation due to other concerns outside
> > of functionality like performance ? defects ? etc ?
>
> I really can't see how we can do this without impacting severly on the
> neutrality of the system (and, therefore, on the communities behind
> those packages).
When I wrote the paragraph above, I was under the assumption that
block implementations were automatically selected by the installer.
Now that I understand you properly :) we wouldn't need a 'Recommands'
feature as the dependancies are satisfied by the deployment admin or
the description file you describe above, not by an automatic
installer.
<snip/>
> > Similarly if there are 2 blocks that implement the same block
> > interface, but one of them contains a known defect, being able to
> > 'Recommend' the other one might also be desirable, especially if
> > the blocks are hosted from a source the user has no direct
> > influence over.
>
> Hmmm, that would require a centralized database of all block
> implementations available worldwide! or am I missing something?
No, you didn't miss something - I misunderstood how the installer
operated. I think that's clear now.
<snip/>
> > With this approach, components are loaded and validated
> > automatically, and the container can tell you even before a client
> > requests the first component whether the request and use of the
> > component will succeed (as far as dependancies on other
> > components, context entries, component versions, etc, go).
>
> I'm in favor of any more modern solution than ECM roles, as long as this
> remains back compatible with what we have today.
Agreed.
<snip/>
> > For example, our application servers (16 of them) are restarted
> > daily
> > at 7am and it would be nice if the systems could come up
> > automatically
> > without requiring a deployment admin to answer/manually configure
> > each of the 16 systems at startup/installation time.
>
> Right. A deployment script is what you need. I would suggest the following:
>
> 1) you install things manually on one development machine
>
> 2) you test the system
>
> 3) when you are satisfied, you ask the block manager to replicate its
> status to a list of defined URIs. In this circumstance, the block
> manager of the cluster machine will act as a web service for the block
> manager of the development machine you are testing and complete
> replication can be performed transparently.
>
> But, again, these are just implementation details.
*nod*, thanks for the clarification there.
> > Will the block protocol also be networkable and allow blocks on
> > other
> > hosts to be mounted remotely ?
>
> AAHAHHHHHHHHHHHHHHHHHHHHHHGGGGGGGGGGGGGG! I knew it! I knew it!
>
> My anti-FS meter went out of scale! :)
*smile*, well, I guess someone had to ask the question :)
> >>Some design decision taken
> >>--------------------------
> >>
> >>o) NO BEHAVIOR VALIDATION:
> >>
> >>I thought a lot about it but I think that having 'behavior description
> >>languages' (such as the WSDL-equivalent for blocks) is going to be
> >>terribly complicated, expensive to implement and hard to use and
> >>enforce, even for simple blocks which don't expose a sitemap and are
> >>just repositories for informations.
> >>
> >>For this reason, there is no validation taking place: if a block
> >>implements a particular behavior and exposes it thru its descriptor
> >>file, Cocoon automatically assume it implements the behavior correctly.
> >>
> >>In the future, we might think of adding a behavior description layer to
> >>enforce a little more validation, but I fear the complexity (for
> >>example) of validating stylesheets against a particular required
> >>behavior.
> >>
> >>IMO, only human try/fail and patching will allow interoperability.
> >
> >
> > On a side subject, how about a tool that could generate a skeleton
> > block based on the block interfaces one wants to implement (ie.
> > the block.xml, sitemap.xmap, etc).
> >
> > That would make it a bit nicer for developers as the tool could
> > provide skeletons for what needs to be implemented for that block
> > to correctly implement particular block interfaces.
>
> Eh, that would be nice indeed, but the block interface is *JUST* a URI.
> Nothing more. There is no contract descriptor and this paragraph
> explains exactly why: because it would be too difficult to know where to
> stop describing the contract!
hmm.. perhaps I missed something then. If I want to write a block
that implements a particular interface (eg. myskin block which
implements the skin block interface) where is that interface
described ?
I would need to know what services are exposed so that my
implementation is complete - and I thought perhaps we could have a
tool that generates a skeleton block implementation based on the
description of these services.
<snip/>
> > It would be great if there was some synergy between Avalon & Cocoon
> > to develop/improve one/both of these containers to be suitable for
> > use in Cocoon, rather than implement our own.
> >
>
> I think everybody agrees here. I also think it would be great to count
> also Phoenix into that, althought I'm not sure on the issues there.
> Peter, what do you think?
Including Phoenix would be fine with me - I'm not as familiar with
it as the other containers and will have to dig a bit deeper
there - over to you Peter :)
> > Merlin offers better support for the meta-info approach to
> > managing components and container hierarchies, whereas Fortress
> > offers
> > better ECM style compatibility. Both don't yet handle package
> > level dependancies but I don't see any problems adding that.
> >
> > The choice of container is important though as a lot of what you
> > describe could be container concerns rather than application
> > concerns
> > (eg. package validation, versioning, classloader management, etc).
> >
>
> I'm fully aware of that.
>
> >
> > Having most of that at the container level makes it much easier
> > for Cocoon which would then become the essential core, blocks,
> > and perhaps any required container extensions, etc.
> >
> > This is where 2.1 has suffered IMO, as the 2.1 codebase includes
> > features that IMO should really be handled at the container level
> > (eg. extra avalon lifecycles, configuration file monitoring,
> > sitemap/subsitap -> container hierarchy management, etc).
> >
> > Perhaps we need to investigate a bit deeper into what the
> > container should do for us. This will allow selection of which
> > container to be a bit easier.
> >
>
> Easy here. The difference between Avalon and Cocoon is that Cocoon has a
> bigger and more focused community. Avalon framework is great. But
> everything else, well, it's fragmented like hell. It's mostly a tons of
> one-man shows. I hate that.
>
> Until this situations remains, I don't feel confortable with moving more
> stuff over to Avalon even if this makes sense architecturally.
>
> Please understand that 'much easier' highly depends on the POV:
Oh, no offense intended there, I see your point regarding the
current situation Avalon is in. What I wrote above was just based
purely on my looking through the current 2.1 codebase and my
understanding of the newer Avalon containers. Nothing negative
intended there.
In fact, a lot of newer features implemented in these newer Avalon
containers can probably be accredited to developments in Cocoon.
My point (which I'm sure you're fully aware of) was more to outline
that container migration could result in us decreasing parts of the
core codebase because many things we've implemented in 2.1 that
essentially extend ECM are natively available at the container
level - if possible, and where it makes sense, I hope we can
capitalize on that.
> > Once I get our admin app up and running here at the bank I'd be
> > happy to look deeper into this.
>
> Great! That would be *very* helpful!
No problem. Once I get this admin app up and going (soon) I'll take a
look at it.
Cheers,
Marcus
--
.....
,,$$$$$$$$$, Marcus Crafter
;$' '$$$$: Computer Systems Engineer
$: $$$$: ManageSoft GmbH
$ o_)$$$: 82-84 Mainzer Landstrasse
;$, _/\ &&:' 60327 Frankfurt Germany
' /( &&&
\_&&&&'
&&&&.
&&&&&&&:
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stefano Mazzocchi <st...@apache.org>.
Marcus Crafter wrote:
> Hi Stefano,
>
> Thanks for starting the ball here :)
>
My pleasure. If we don't implement this, Cocoon will simply collapse on
its own inertial weight in a few years.
> Similar to virtual-packages in Debian ?
>
> eg:
>
> exim; provides: mail-transport-agent
> sendmail; provides: mail-transport-agent
>
> mutt: depends: mail-transport-agent
>
> Which allows you to install any particular implementation of a
> virtual-package.
Yes. Exactly. But we will use unique identifiers to indicate those
'virtual-packages' to allow versioning of the contract itself. (virtual
package is a pretty bad name for what is, in fact, a contract and not a
real package).
> >2) polymorphism: I can have different implementations of the same
> >behavior and I can switch them simply by acting on the block manager,
> >without having to touch a single configuration line in any block. The
> >blocks are, in fact, sealed.
>
>
> Does the installer choose based on some policy which
> implementation will be used, or will it require an admin to choose
> it at install time ?
It is an implementation detail. It will be up to how we want to
implement this.
Like you, I see the need for automatic deployment without human
intervention (this is great for clustered environments). So, instead of
installing a cob, we could install a description of the entire
collection of cobs with all the right dependencies (much as Phoenix does
with server description files).
But I would like to have either manually choosen or hardcoded into a
descriptor file. Policy-based rules are heuristic and might not work as
expected.
> If its policy based, do you think it's worth having the possibility to
> recommend a particular implementation due to other concerns outside of
> functionality like performance ? defects ? etc ?
I really can't see how we can do this without impacting severly on the
neutrality of the system (and, therefore, on the communities behind
those packages).
>
>
> I'm not sure how FOP and iText compare in performance but if your
> application is really performance critical, and assuming both
> serializers are feature complete (as far as your report is concerned)
> being able to 'Recommend' (Debian talk) the faster one might be
> useful.
>
I would write that as a note into the block descriptor for humans to
read. I wouldn't go as far as creating an ontology of policies that the
block deployer will have to infer from. Sounds like a very slippery
slope to me.
>
> Similarly if there are 2 blocks that implement the same block
> interface, but one of them contains a known defect, being able to
> 'Recommend' the other one might also be desirable, especially if
> the blocks are hosted from a source the user has no direct
> influence over.
Hmmm, that would require a centralized database of all block
implementations available worldwide! or am I missing something?
>
> >
> > 2) role(s):
> > the URI(s) of the behavioral role(s) this block implements
> > and exposes [optional]
>
>
> Do you mean the specification of which 'virtual-block's this
> particular block implements, and/or extra services that are
> exposed as part of this Blocks API ?
>
In your terminology, I mean the 'virtual-blocks'
> >Also, the /BLOCK-INF/ directory contains the 'roles' file for Avalon
> >components:
> >
> > /BLOCK-INF/roles.xml
>
>
> After looking at the Merlin/etc oriented way of specifiying Avalon
> components, I'd be more inclined to use the x-files if possible (we
> could perhaps retain a roles.xml for ECM style compatibility reasons
> though).
>
> RoleManager just provides the ability to shortcut your
> configurations (and with the introduction of Fortress specify your
> component handler), whereas the x-files allow you to do full
> meta-info analysis of components which I presume would be a
> necessity in such a distributed system.
>
> Merlin style x-files are described at
> http://jakarta.apache.org/avalon/excalibur/merlin/assembly.html.
>
> Essentially for each Avalon Component there is a manifest entry
> identifying it as so, and a .xinfo & .xprofile file identifying
> role oriented and instance information of the component.
>
> With this approach, components are loaded and validated
> automatically, and the container can tell you even before a client
> requests the first component whether the request and use of the
> component will succeed (as far as dependancies on other
> components, context entries, component versions, etc, go).
I'm in favor of any more modern solution than ECM roles, as long as this
remains back compatible with what we have today.
>
> >Possible use-case scenario
> >--------------------------
> >
> >Suppose you have your naked cocoon running in your favorite servlet
> >container, and you want to deploy myblock.cob. Here is a possible
> >sequence of actions on an hypotetical web interface on top of Cocoon
> >(a-la Tomcat Manager)
> >
> > 1) upload the myblock.cob to Cocoon
> >
> > 2) Cocoon scans /BLOCK-INF/, reads block.xml and finds out the
> >behaviors this block depends on as well as the block that it extends.
> >
> > 3) the block manager connects to the uber "Cocoon Block Librarian" web
> >service (hosted probably on cocoon.apache.org) and asks for the list of
> >blocks that exhibit that required behavior.
> >
> > 4) the librarian returns a list of those blocks, so the users chooses,
> >or the manager allows the user to deploy its own block that implements
> >the required behavior or to reuse those already deployed blocks that
> >implement the required behaviors.
> >
> > 5) Cocoon checks that all dependencies are met, then unpacks and
> >installs the blocks
> >
> > 6) For each block that exposes a sitemap, the deployment manager asks
> >the deploying user where he/she wants to *mount* that block in the
> >managed URI space or if he/she wants to keep them internal only (thus
> >only available to the other blocks, but not mounted on the public URI
> space)
> >
> > 7) for each block that requires installation-time configurations, the
> >block manager will present the user information on how to configure the
> >block.
> >
> > 8) If no collisions in the URI spaces are found, the blocks are made
> >available for servicing.
>
>
> Sounds good to me, it would be also nice if the whole process could
> be automated in some way without manual intervention though. I
> think this is where my 'Recommends' comment way above comes from.
>
Instead of policy inference, I would think of providing some automation
descriptor files instead. I would personally be afraid of the server
making the wrong assumptions and installing something which is not what
I asked for.
>
> For example, our application servers (16 of them) are restarted daily
> at 7am and it would be nice if the systems could come up automatically
> without requiring a deployment admin to answer/manually configure
> each of the 16 systems at startup/installation time.
Right. A deployment script is what you need. I would suggest the following:
1) you install things manually on one development machine
2) you test the system
3) when you are satisfied, you ask the block manager to replicate its
status to a list of defined URIs. In this circumstance, the block
manager of the cluster machine will act as a web service for the block
manager of the development machine you are testing and complete
replication can be performed transparently.
But, again, these are just implementation details.
>
>
> Perhaps deployment configuration settings/profiles could be given
> to the deployment manager for automatic block deployment ? (...how
> many times can I use deployment in the once sentence!) :)
Yep
>
> Will the block protocol also be networkable and allow blocks on other
> hosts to be mounted remotely ?
AAHAHHHHHHHHHHHHHHHHHHHHHHGGGGGGGGGGGGGG! I knew it! I knew it!
My anti-FS meter went out of scale! :)
NO, cobs are cocoon services not web services.
If you want to connect to a remote service, and you want to implement
this as a block on that machine, fine. But entirely different is the
situation where the service lookup/discovery/trust/validation is done
over the network.
And, to be honest, I really don't see how this could be useful.
> >Some design decision taken
> >--------------------------
> >
> >o) NO BEHAVIOR VALIDATION:
> >
> >I thought a lot about it but I think that having 'behavior description
> >languages' (such as the WSDL-equivalent for blocks) is going to be
> >terribly complicated, expensive to implement and hard to use and
> >enforce, even for simple blocks which don't expose a sitemap and are
> >just repositories for informations.
> >
> >For this reason, there is no validation taking place: if a block
> >implements a particular behavior and exposes it thru its descriptor
> >file, Cocoon automatically assume it implements the behavior correctly.
> >
> >In the future, we might think of adding a behavior description layer to
> >enforce a little more validation, but I fear the complexity (for
> >example) of validating stylesheets against a particular required
> >behavior.
> >
> >IMO, only human try/fail and patching will allow interoperability.
>
>
> On a side subject, how about a tool that could generate a skeleton
> block based on the block interfaces one wants to implement (ie.
> the block.xml, sitemap.xmap, etc).
>
> That would make it a bit nicer for developers as the tool could
> provide skeletons for what needs to be implemented for that block
> to correctly implement particular block interfaces.
Eh, that would be nice indeed, but the block interface is *JUST* a URI.
Nothing more. There is no contract descriptor and this paragraph
explains exactly why: because it would be too difficult to know where to
stop describing the contract!
>
>
> >o) VERSIONING AS PART OF THE BEHAVIOR URI
>
>
>
>
> >o) CROSS-BLOCK SECURITY
>
>
>
>
> >o) COCOON MANAGER SECURITY
> >
> >The cocoon manager might be a block itself that connects to specific
> >cocoon internals and provides a web interface for it. So, it can be
> >removed or disabled when put on production.
> >
> >Also, the feature of automatic discovery of blocks thru the 'cocoon
> >block library' can be turned off or substituted with its own (even the
> >'cocoon block library' could be a block, so you could have your own
> >block library on your system instead of connecting to the apache one).
>
>
> +1, good idea. Perhaps automated block deployment could be done
> with a particular implementation of the 'automatic discovery' mechanism
> you describe above.
Yeah, that's another option.
>
>
> >o) OPTIONAL COP
>
>
>
>
> >TODO
> >----
> >
>
>
>
>
> > 3) Which avalon container should we use since the one we currently use
> >(ECM) is not powerful enough? is there already a container which is
> >powerful enough to handle our needs as described here? if not, what do
> >we do? we implement our own or work with the avalon people to fix theirs
> >to meet our needs?
>
>
> I agree, ECM isn't powerful enough to handle all this. The 2 new
> Avalon containers are Fortress and Merlin.
>
> It would be great if there was some synergy between Avalon & Cocoon
> to develop/improve one/both of these containers to be suitable for
> use in Cocoon, rather than implement our own.
>
I think everybody agrees here. I also think it would be great to count
also Phoenix into that, althought I'm not sure on the issues there.
Peter, what do you think?
>
> Merlin offers better support for the meta-info approach to
> managing components and container hierarchies, whereas Fortress offers
> better ECM style compatibility. Both don't yet handle package
> level dependancies but I don't see any problems adding that.
>
> The choice of container is important though as a lot of what you
> describe could be container concerns rather than application concerns
> (eg. package validation, versioning, classloader management, etc).
>
I'm fully aware of that.
>
> Having most of that at the container level makes it much easier
> for Cocoon which would then become the essential core, blocks,
> and perhaps any required container extensions, etc.
>
> This is where 2.1 has suffered IMO, as the 2.1 codebase includes
> features that IMO should really be handled at the container level
> (eg. extra avalon lifecycles, configuration file monitoring,
> sitemap/subsitap -> container hierarchy management, etc).
>
> Perhaps we need to investigate a bit deeper into what the
> container should do for us. This will allow selection of which
> container to be a bit easier.
>
Easy here. The difference between Avalon and Cocoon is that Cocoon has a
bigger and more focused community. Avalon framework is great. But
everything else, well, it's fragmented like hell. It's mostly a tons of
one-man shows. I hate that.
Until this situations remains, I don't feel confortable with moving more
stuff over to Avalon even if this makes sense architecturally.
Please understand that 'much easier' highly depends on the POV:
>
> Once I get our admin app up and running here at the bank I'd be
> happy to look deeper into this.
>
>
Great! That would be *very* helpful!
--
Stefano Mazzocchi <st...@apache.org>
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Marcus Crafter <cr...@fztig938.bank.dresdner.net>.
Hi Stefano,
Thanks for starting the ball here :)
On Sat, Nov 02, 2002 at 01:12:09AM +0100, Stefano Mazzocchi wrote:
>
> A step back: what are the problems we are trying to solve
> ---------------------------------------------------------
>
<snip/>
> Are we really cloning the servlet API?
> --------------------------------------
>
<snip/>
> Anyway, looking at this parallel, Cocoon really lacks a way to make its
> applications deployed easily within a 'naked' container that includes
> only the basic and default machinery.
Yes, I think we all agree here.
> Applying Avalon COP philosophy over again
> -----------------------------------------
>
<snip/>
> Once you start using COP (component oriented programming), it's very
> hard to go back (so much so that many abuse it and over-componentize
> their systems... even Cocoon itself suffers from this problem on some
> parts).
:)
<snip/>
> Improvement #1: component-oriented deployment
> ---------------------------------------------
>
<snip/>
> case 2: block-like deployment
>
> +-----+ +-------+
> | FOP | | Batik |
> +-----+ +-------+
> | \ |
> | \ |
> +---------+ +---------+
> | webapp1 | | webapp2 |
> +---------+ +---------+
>
> The second case allows:
>
> - optimization of resources (libraries are not deployed more than needed)
>
> - separate distributions (different packages can be prepared and
> maintained by different groups independently, as long as the service
> contracts remain the same)
+1, good use case.
> Improvement #2: polymorphic behavior
> ------------------------------------
>
> The above solution already improves on the WAR model, but we can do
> better than this. Another use-case scenario:
>
> In the previous scenario, your web application required PDF
> serialization and, in fact, it mixes concerns if it depends *explicitly*
> on FOP since, later on, you might want to use another library/service
> that implements the same (for example iText or RenderX).
>
> So, instead of depending on a particular *implementation* of a service
> behavior, if we make blocks depending on *behaviors* directly
> (considered as service contracts) we can implement polymorphic behavior
> of blocks.
Similar to virtual-packages in Debian ?
eg:
exim; provides: mail-transport-agent
sendmail; provides: mail-transport-agent
mutt: depends: mail-transport-agent
Which allows you to install any particular implementation of a
virtual-package.
<snip/>
> case 2: dependency on behavior
>
> +-----------+ +-----------+
> | +-----+ | | +-------+ |
> | | FOP | | | | Batik | |
> | +-----+ | | +-------+ |
> | FO->PDF | | SVG->PNG |
> +-----------+ +-----------+
> | \ |
> | \ |
> +---------+ +---------+
> | webapp1 | | webapp2 |
> +---------+ +---------+
>
> Here, the webapp1 requires "fo-pdf" serialization services but it does
> not care (nor should!) which implementation of this service is actually
> located into the system.
>
> It is, in fact, the installer's concern to indicate *what* block that
> *implements* that behavior should be used in that system at that time.
>
> Note that this allows several very intersting things:
>
> 1) versioning: it is possible install several different versions of the
> same block and try them out (even at runtime) and roll-back if the
> version creates incompatibilities without having to change anything in
> the blocks, but only using the block manager (which is the part of
> cocoon responsible for deployment and configuration of blocks in the
> system).
>
> 2) polymorphism: I can have different implementations of the same
> behavior and I can switch them simply by acting on the block manager,
> without having to touch a single configuration line in any block. The
> blocks are, in fact, sealed.
Does the installer choose based on some policy which
implementation will be used, or will it require an admin to choose
it at install time ?
If its policy based, do you think it's worth having the possibility to
recommend a particular implementation due to other concerns outside of
functionality like performance ? defects ? etc ?
I'm not sure how FOP and iText compare in performance but if your
application is really performance critical, and assuming both
serializers are feature complete (as far as your report is concerned)
being able to 'Recommend' (Debian talk) the faster one might be
useful.
Similarly if there are 2 blocks that implement the same block
interface, but one of them contains a known defect, being able to
'Recommend' the other one might also be desirable, especially if
the blocks are hosted from a source the user has no direct
influence over.
> Improvement #3: block inheritance
> ---------------------------------
>
> The third step is to allow blocks to extends other blocks.
>
<snip/>
> This mainly:
>
> - reduces block development and maintanance costs because changes and
> bugfixes are directly inherited by all the extending blocks, thus
> allowing better SoC between the two groups mainaining the different blocks
>
> - easy customization: blocks can be adapted for personal specific
> needs simply with a wrapper around and without the need to repackaging.
+1, great.
(I agree with Sylvain's comments about the Block API identifying
services rather than resources).
> +---------------------------+
> | Part 2: technical details |
> +---------------------------+
>
> Ok. Now that we have described where we want to go, let's describe how.
>
> Cocoon Blocks
> -------------
>
> A Cocoon block is a zipped archive, just like JARs and WARs.
<snip/>
> The main COB descriptor file is found at
>
> /BLOCK-INF/block.xml
>
> This file contains markup with a cob-specific namespace and will include
> the following information:
>
> 1) block implementation metadata:
> - unique URI identifier [this identifier will also be used as an
> address on where to locate the block and how to download it from the
> web!] (example: http://mystuff.org/dist/myblock-1.5.34.cob)
> - version (1.5.34)
> - short name (My Block)
> - description
> - author
> - URI of license (http://mystuff.org/dist/license)
> - URI of the distribution location
> (http://mystuff/dist/latest/myblock.cob)
> - ???
>
> 2) role(s):
> the URI(s) of the behavioral role(s) this block implements
> and exposes [optional]
Do you mean the specification of which 'virtual-block's this
particular block implements, and/or extra services that are
exposed as part of this Blocks API ?
<snip/>
> Also, the /BLOCK-INF/ directory contains the 'roles' file for Avalon
> components:
>
> /BLOCK-INF/roles.xml
After looking at the Merlin/etc oriented way of specifiying Avalon
components, I'd be more inclined to use the x-files if possible (we
could perhaps retain a roles.xml for ECM style compatibility reasons
though).
RoleManager just provides the ability to shortcut your
configurations (and with the introduction of Fortress specify your
component handler), whereas the x-files allow you to do full
meta-info analysis of components which I presume would be a
necessity in such a distributed system.
Merlin style x-files are described at
http://jakarta.apache.org/avalon/excalibur/merlin/assembly.html.
Essentially for each Avalon Component there is a manifest entry
identifying it as so, and a .xinfo & .xprofile file identifying
role oriented and instance information of the component.
With this approach, components are loaded and validated
automatically, and the container can tell you even before a client
requests the first component whether the request and use of the
component will succeed (as far as dependancies on other
components, context entries, component versions, etc, go).
> Possible use-case scenario
> --------------------------
>
> Suppose you have your naked cocoon running in your favorite servlet
> container, and you want to deploy myblock.cob. Here is a possible
> sequence of actions on an hypotetical web interface on top of Cocoon
> (a-la Tomcat Manager)
>
> 1) upload the myblock.cob to Cocoon
>
> 2) Cocoon scans /BLOCK-INF/, reads block.xml and finds out the
> behaviors this block depends on as well as the block that it extends.
>
> 3) the block manager connects to the uber "Cocoon Block Librarian" web
> service (hosted probably on cocoon.apache.org) and asks for the list of
> blocks that exhibit that required behavior.
>
> 4) the librarian returns a list of those blocks, so the users chooses,
> or the manager allows the user to deploy its own block that implements
> the required behavior or to reuse those already deployed blocks that
> implement the required behaviors.
>
> 5) Cocoon checks that all dependencies are met, then unpacks and
> installs the blocks
>
> 6) For each block that exposes a sitemap, the deployment manager asks
> the deploying user where he/she wants to *mount* that block in the
> managed URI space or if he/she wants to keep them internal only (thus
> only available to the other blocks, but not mounted on the public URI space)
>
> 7) for each block that requires installation-time configurations, the
> block manager will present the user information on how to configure the
> block.
>
> 8) If no collisions in the URI spaces are found, the blocks are made
> available for servicing.
Sounds good to me, it would be also nice if the whole process could
be automated in some way without manual intervention though. I
think this is where my 'Recommends' comment way above comes from.
For example, our application servers (16 of them) are restarted daily
at 7am and it would be nice if the systems could come up automatically
without requiring a deployment admin to answer/manually configure
each of the 16 systems at startup/installation time.
Perhaps deployment configuration settings/profiles could be given
to the deployment manager for automatic block deployment ? (...how
many times can I use deployment in the once sentence!) :)
> Resource dereferencing
> ----------------------
<snip>
> The proposed solution is to use block-specific protocols to identify the
> dereferenced resources.
>
> For example, the myblock.cob/sitemap.xmap file could contain a global
> matcher which works like this:
>
> <map:match pattern="**/*.html">
> <map:generate src="{1}.xml"/>
> <map:transform src="block:skin:/stylesheets/document2html.xslt"/>
> <map:serialize/>
> </map:match>
>
> please note the
>
> block:skin:/stylesheets/document2html.xslt
>
> which indicates
>
> block -> use the block protocol
>
> skin -> use the 'skin' prefix to lookup the block behavior URI and thus
> the block which implements it for this block (the block manager knows
> this)
>
> /stylesheets/document2html.xslt -> it will ask the sitemap of the skin
> block to produce that resource.
Will the block protocol also be networkable and allow blocks on other
hosts to be mounted remotely ?
> Dereferencing navigation
> ------------------------
<snip/>
> For example, things like
>
> <form action="block:web-service:/post">...</form>
>
> is trasnformed into
>
> <form action="/servizio-web/post"/>...</form>
+1
> Some design decision taken
> --------------------------
>
> o) NO BEHAVIOR VALIDATION:
>
> I thought a lot about it but I think that having 'behavior description
> languages' (such as the WSDL-equivalent for blocks) is going to be
> terribly complicated, expensive to implement and hard to use and
> enforce, even for simple blocks which don't expose a sitemap and are
> just repositories for informations.
>
> For this reason, there is no validation taking place: if a block
> implements a particular behavior and exposes it thru its descriptor
> file, Cocoon automatically assume it implements the behavior correctly.
>
> In the future, we might think of adding a behavior description layer to
> enforce a little more validation, but I fear the complexity (for
> example) of validating stylesheets against a particular required
> behavior.
>
> IMO, only human try/fail and patching will allow interoperability.
On a side subject, how about a tool that could generate a skeleton
block based on the block interfaces one wants to implement (ie.
the block.xml, sitemap.xmap, etc).
That would make it a bit nicer for developers as the tool could
provide skeletons for what needs to be implemented for that block
to correctly implement particular block interfaces.
> o) VERSIONING AS PART OF THE BEHAVIOR URI
<snip/>
> o) CROSS-BLOCK SECURITY
<snip/>
> o) COCOON MANAGER SECURITY
>
> The cocoon manager might be a block itself that connects to specific
> cocoon internals and provides a web interface for it. So, it can be
> removed or disabled when put on production.
>
> Also, the feature of automatic discovery of blocks thru the 'cocoon
> block library' can be turned off or substituted with its own (even the
> 'cocoon block library' could be a block, so you could have your own
> block library on your system instead of connecting to the apache one).
+1, good idea. Perhaps automated block deployment could be done
with a particular implementation of the 'automatic discovery' mechanism
you describe above.
> o) OPTIONAL COP
<snip/>
> TODO
> ----
>
<snip/>
> 3) Which avalon container should we use since the one we currently use
> (ECM) is not powerful enough? is there already a container which is
> powerful enough to handle our needs as described here? if not, what do
> we do? we implement our own or work with the avalon people to fix theirs
> to meet our needs?
I agree, ECM isn't powerful enough to handle all this. The 2 new
Avalon containers are Fortress and Merlin.
It would be great if there was some synergy between Avalon & Cocoon
to develop/improve one/both of these containers to be suitable for
use in Cocoon, rather than implement our own.
Merlin offers better support for the meta-info approach to
managing components and container hierarchies, whereas Fortress offers
better ECM style compatibility. Both don't yet handle package
level dependancies but I don't see any problems adding that.
The choice of container is important though as a lot of what you
describe could be container concerns rather than application concerns
(eg. package validation, versioning, classloader management, etc).
Having most of that at the container level makes it much easier
for Cocoon which would then become the essential core, blocks,
and perhaps any required container extensions, etc.
This is where 2.1 has suffered IMO, as the 2.1 codebase includes
features that IMO should really be handled at the container level
(eg. extra avalon lifecycles, configuration file monitoring,
sitemap/subsitap -> container hierarchy management, etc).
Perhaps we need to investigate a bit deeper into what the
container should do for us. This will allow selection of which
container to be a bit easier.
Once I get our admin app up and running here at the bank I'd be
happy to look deeper into this.
<snip/>
One other thing:
7) Backwards compatibility, how will it be retained ?
All looks great Stefano so far. Look forward to any comments you may
have.
Cheers,
Marcus
--
.....
,,$$$$$$$$$, Marcus Crafter
;$' '$$$$: Computer Systems Engineer
$: $$$$: ManageSoft GmbH
$ o_)$$$: 82-84 Mainzer Landstrasse
;$, _/\ &&:' 60327 Frankfurt Germany
' /( &&&
\_&&&&'
&&&&.
&&&&&&&:
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stephen McConnell <mc...@apache.org>.
Stefano Mazzocchi wrote:
> Stephen McConnell wrote:
>
>>
>>
>> Stefano Mazzocchi wrote:
>>
>> Stefanno:
>>
>> Have read with interest the Blocks 1.1 description. First of all -
>> thanks to everyone who contributed to this. I have a number of notes
>> in-line, some of which I am sure will reflect my ignorance concerning
>> the Cocoon world/terminolgy. Throughts are strongly related to
>> background with Avalon, experience with Merlin and Fortress and usage of
>> the excalibur/meta package.
>
>
> Stephen, thanks much for this. I think your experience in
> component-oriented paradigm will be very valuable for us here. See my
> comments inline.
I'm actually really exited about the opportunity to work with the Cocoon
community on this. It is solid real requirements. Anyway - sorry about
the delay is responding - a couple of other items poped up that I had to
take of.
>
>>
>>
>> >
>> > +---------------------------+
>> > | Part 2: technical details |
>> > +---------------------------+
>> >
>> > Ok. Now that we have described where we want to go, let's describe
>> how.
>> >
>> > Cocoon Blocks
>> > -------------
>> >
>> > A Cocoon block is a zipped archive, just like JARs and WARs.
>> >
>> > The suggested extension of a cocoon block is ".cob" (for COcoon
>> Block).
>>
>>
>>
>> Another suggestion ... BAR - Block ARchive.
>>
>> The reason for suggestiong this is that the concept of a JAR/WAR style
>> deployment unit is something I've been looking at within the Merlin
>> framework. It seems to me that the notion of a block is something
>> usable at level across many different applications and based on the
>> requirements and descriptions here - I dion't see any immediate Cocoon
>> specifics except for the inclusion of the sitemap and default sitemap
>> semantics (more notes on that later).
>
>
> Well, a COB is more than a BAR. A COB is a cocoon-specific BAR. We
> need this. We need a way for the block to *mount* itself onto a
> specific URI space. Otherwise blocks are just a way to deploy java
> components and their libraries.
Here are the asumptions I have in my head - please let me know if I'm
drifting or if something doesn't sound right!
I'm assuming that a some point we have a Cocoon container that is
managing block deployment. The Cocoon container represents a URL name
space. Each block also represents a URI namespace. The Cocoon
container would be responsible for the mapping of URIs to services
publised by respective blocks.
>
>>
>> >
>> > The suggested MIME type is "application/x-cocoon-block".
>>
>> And following the BAR notion .. "application/x-block"?
>
>
> I'm not against using a more general MIME type, as long as there is a
> way to *cast* it to COB before deployment. Something like having a
> signature inside the block metadata or something like that.
Let me confess up front that my experience with MIME types is for all
purposes non-existent. I not really in a position to comment but I'm
confident that skills exist within Cocoon.
>
>>
>> >
>> > A Cocoon Block (COB from now on) includes a directory called
>> >
>> > /BLOCK-INF
>> >
>> > which contains all the block metadata and the resources that must
>> not be
>> > directly referentiable from other blocks (for example, jars,
>> classes or
>> > file resources made available thru the classloader). The directories
>> >
>> > /BLOCK-INF/classes
>> > /BLOCK-INF/jar
>> >
>> > are used for classes and jar files. [This follows the WAR paradigm]
>>
>>
>>
>> For consitency with the Servlet spec (Web Applications/SRV.9.5 Directory
>> Structure) - I suggest /BLOCK-INF/jar be changed to /BLOCK-INF/lib
>
>
> Yes, yes, I overlooked that. Totally agree it should be /BLOCK-INF/lib
>
>>
>> >
>> > The main COB descriptor file is found at
>> >
>> > /BLOCK-INF/block.xml
>> >
>> > This file contains markup with a cob-specific namespace and will
>> > include the following information:
>> >
>> > 1) block implementation metadata:
>> > - unique URI identifier [this identifier will also be used as an
>> > address on where to locate the block and how to download it from the
>> > web!] (example: http://mystuff.org/dist/myblock-1.5.34.cob)
>> > - version (1.5.34)
>> > - short name (My Block)
>> > - description
>> > - author
>> > - URI of license (http://mystuff.org/dist/license)
>> > - URI of the distribution location
>> > (http://mystuff/dist/latest/myblock.cob)
>> > - ???
>> >
>> > 2) role(s):
>> > the URI(s) of the behavioral role(s) this block implements
>> > and exposes [optional]
>>
>>
>>
>> When you are using the work "role", is it safe to assume that this is a
>> URI that resolves to a description of the set of computational
>> "service"(s) that a block is capable of providing?
>
>
> yes, it's the 'behavioral contract'.
>
>> If this is correct - then I would suggest renaming this to
>> "service(s)".
>
>
> 'service' is kinda abused as a term, expecially now with the web
> services stuff floating around.
>
>> My rationale here is that a "role" (to me) is more correctly aligned
>> with the consumer of a service - Block B1 is depedendent on service X
>> for role of "authorization". If I understand correctly, the notion
>> you desribing is collection of an interface + version range supported
>> by a block that would enable it to be supplied to Block B1 in order
>> to fulfill the service dependecies that B1 has with respect to its
>> "authorization" concerns.
>
>
> Your assumptions are correct and I agree with your rationale that
> 'role' is kinda misplaced as an identifier for a behavioral contract.
>
> Still, I don't like the term 'service'. Anybody else has a good
> suggestion for this?
>
>>
>>
>> Keep in mind that I'm biased relative to the Merlin/Phoenix coventions
>> here of using the work "service" to describe the functionality
>> exported by a component.
>
>
> No problem.
>
>> I'm extending that notion on the assumption that a block exposed a
>> set (or sub-set) of the services provided by the components it is
>> aggregating.
>
>
> Yes, this plus all the cocoon-specific services. In fact, you could
> think at the sitemap as a description of the behavior of a hidden
> 'cocoon component' that exhibits pipeline-handling services.
Is is resonably to say that the sitemap represents a combination of
computational dependencies, and the disrciption of an execution
sequence? One of the things I'm thinking about in backround is the
extent to which a sitemap can be used as the basic for (a) block
internal structual validation, and (b) system (i.e. the Cocoon
container) validation of an assembly of blocks.
>
>> Just as a side note, you may want to think about seperating "block"
>> URIs from "service" URIs.
>
>
> Read again: it's already there. One URI describes the block another
> describes the 'behavior' that it's implementing.
>
> So, we could have
>
> http://apache.org/cocoon/blocks/instances/FOP/3.2 implements
> http://apache.org/cocoon/blocks/FO2PDF/1.2
>
>> This is something I've been working on recently in
>> Merlin - and the seperation of component provider for service has
>> proved valuable.
>
>
> Oh, it's even more than valuable: it's vital. Otherwise, how can be
> implement block polymorphism?
Yep.
Although I would like to dig further into this (but more on that further
down).
>
>> It ensures that the concepts of a service is not tied to a
>> particular implementation unit (block or component). Seperation of
>> component implemetation meta data from the service meta data is
>> already in place under the excalibur/meta package for the same reasons.
>>
>> >
>> > 3) dependencies:
>> > the URI(s) of the behavioral roles this block expects,
>> > along with the prefixes used by the block as shortcuts in
>> protocol
>> > resolving (see below for the meaning of this) [optional]
>>
>>
>>
>> I'm guessing that your referring to the inclusion of a roles file - is
>> that correct?
>
>
> Nop. I'm talking about the dependencies of a particular block on the
> services provided by other blocks.
>
> So
>
> http//apache.org/cocoon/blocks/instances/Forrest/1.0 requires
> http://apache.org/cocoon/blocks/FO2PDF/1.[2-x]
>
> which means that Forrest requires a service to transform FO into PDF
> and will use a contract defined on version 1.2 of that behavioral
> contract and not changed until 2.0 (excluded)
Ok - no problem - its clear.
>
>
>> How does this compare to something like the dependencies
>> declaration used in the excalibur/meta package?
>> http://jakarta.apache.org/avalon/excalibur/meta/dependencies.html
>>
>> >
>> > 4) inheritance:
>> > the URI of the block extended. [optional]
>>
>>
>>
>> It seems to me that there two distinct inheritance concerns: (a) block
>> inheritance and (b) component inheritance (assuming that a block
>> aggregates components). In the case of block inheritance this would
>> handles the cases of resources and the ability to redefine resources
>> in derived blocks.
>
>
> My proposal didn't include a way for a block to access a resource
> included in another block directly, but only passing thru a sitemap
> and invoquing pipelines.
>
> Here, when a sitemap *extends* another one, it's means of falling
> back: the two sitemaps are appended and if no matching happens in the
> first one, it falls back on the extended one.
Understood.
>
>> In the case of component inheritance, this should be
>> handled at the component type level and should not be linked to block
>> inheritance.
>
>
> I thought that classloading precedence would solve this issue almost
> automatically. In fact, again, if the asked component is not present
> in the block classloader, it will fall back to the classloader of the
> extended block.
What you are describing is something already available and operation
within Merlin based on the container hierachy. However, I think the
notion of formal inhertance implies more that in that in that a specific
fallback path is declared which is not the same as cascading containment
model. I think it would be a good idea to flesh out an example of a
Cocoon sitemap service that extends another and from that, flesh out the
specification in more detail.
>
>>
>>
>> >
>> > 5) sitemap:
>> > the location inside the block file space of the sitemap
>> > [optional, if not found defaults to '/sitemap.xmap']
>>
>>
>>
>> This one - I'm not sure about - does it make sence for this to be part
>> of a generic block specification
>
>
> No, it makes sense to have this in a cocoon block specification but
> I'd be interested in seeing how our effort can combine with others.
Based on my reading of a coupleof other posts in this thread, my
immediate impression is that sitemap is in effect source data that is
applied to a sitemap service. I.e. I'm feeling confident that this can
be readiuly abstracted to a classic service defintion and component
depluyment lifecycle.
>
>> , or is it part of a block that provides
>> functionality derived from a stitemap?
>
>
> A cocoon block is a block with some cocoon specific service. In this
> sense a COB extends a BAR and for this reason must have
> cocoon-specific semantics.
Yep.
>
>> Perhaps this is point where a COB extends a BAR ?
>
>
> Yep. And no small point: without this, blocks are almost useless as a
> webapp deployment tool to us. In avalon, you are packaging services
> provided by components, in cocoon we want to package services but they
> are not only provided by java components but also provided by cocoon
> services (pipelines).
>
> In this sense, if a block exposes a sitemap is a cocoon block, if it
> doesn't (because sitemap exposure is optional) it is a regular avalon
> block.
Understood.
>
>> >
>> > 6) configurations:
>> > the configurations required for this block to function [optional]
>>
>>
>>
>> Some clarification needed here - I'm assuming that a block is a
>> collection of a components.
>
>
> No. A block is a collection of deployable services, some of which are
> implemented as avalon components.
Just a small but perhaps important comment - with the introduction of
the service package into the Avalon framework, the most basic "Avalon
component" is a java.lang.Object. Secondly, with the intoduction of a
extensions, a component (java.lang.Object) can delcare its own lifecycle
that compliments and/or replaces the classic Avalon phases. In effect -
a modern Avalon container can handle any lifecycle model you care to
throw at it. I think its an important point because Avalon today (a) is
not a lock-in scenario, and (b) is open to real work requirements. I
hop I don't sound like I'm preaching here - its just that I'm really
happy about the evolution framework evolution over the last year - and
the fact that I can really apply Avalon to reasl problems.
>
>
>> Each component would have its own meta info
>> (explicit or derived). At the level of block I can imagine information
>> that is describing profiles of component usage, and instructions
>> concerning assembly of profiles that will result in the establishment of
>> a computation system (I'm talking about internal assembly of a block
>> here - not block assembly). This internal "assembly" level information
>> can be considered as the block configuration but should not be confused
>> with component configuration data.
>
>
> I lost you here.
>
> Let me give you an example of what I mean with configuration.
>
> Let me suppose that I deploy a block that provides me with
> authentication services (don't think about java components only, think
> about also a pipeline that handles the login pages, the error pages,
> the authentication flow, the user-managing pages and flow and the
> components to connect to the various data storages)
>
> This block will then need configurations to work such as:
>
> - system to use [file|RDBMS|LDAP]
> - location of the database
> - username/password for connection (not needed for 'file')
> - ...
>
> and so on.
Combining this with the comments you made later concerning the
seperation of internal block concerns from the viewpoint of "block as
deployer unit" - It's clear. I was going to go into more detail on
what I wrote above - but I figure I can come back to that later if needed.
>>
>> On the subject of component configuration, there are three different
>> levels of component configuration that are handled within the Merlin
>> container. The first type is static configuration defaults (established
>> by a developer and bundled with the class), the second type is
>> configuration data associated with a named deployment profile (i.e.
>> component X deployed using profile P1 is different to component X
>> deployed using profile P2). The third category of configuration data is
>> data defined by an administrator that typically suppliments a profile,
>> which in turn suppliments default configuration data.
>
>
> It is *not* the deployer concern to know who uses the configurations
> inside the block. So I shouldn't have to configure single components,
> but the block as a whole and then the block knows what part uses what
> configuration. Otherwise IoC is broken.
This is an important distinction. Today I'm mostly dealing with the
internal configuration of relatively complex systems (all of the stuff I
described above) - and from my own point of view, the notion of a block
is something that allows the encapsulation of that such that it can be
considered from a different viewpoint. If I consider that the block
represents a configuration boundary, then we have a clean distinction
between the configuration applied by a "deployer" and opposed to the
"internal" configuration of components.
>
> I don't want users to have to know the internals of the block in order
> to be able to configure it.
>
> it should be as simple as possible and as transparent as possible to
> the user. Just fill-up the form with the value you want and that's it.
This is helping me a lot in figuring out the conceptual point where a
unit of containerment ends and a block begins. I'm starting to get a
picture in my head of what are the specifics of a block over and above
the notion of a container aggregating a bunch of components and
publishing some services.
>
>>
>>
>> >
>> >
>> > Also, the /BLOCK-INF/ directory contains the 'roles' file for Avalon
>> > components:
>> >
>> > /BLOCK-INF/roles.xml
>>
>>
>>
>> I've been thinking about how to handle roles versus the more formal meta
>> data approach used in Merlin. One of the first things that is needed at
>> the component level is the declaration of mechanism used to bring
>> external data into and meta-data model. Markus has already started
>> working on content in this subject and I'll be shifting some of the
>> meta-data content out of Merlin to the excalibur/meta package in the
>> near future as part of supporting this work. In effect there should not
>> be a need to include a /BLOCK-INF/roles.xml at the spec level - instead
>> one should be declaring a meta management strategy at the component
>> level, and possible a default strategy at a block level. This would
>> enable the deployment of ECM style components without change, together
>> with non-ECM components. Specification of the inclusion of a roles file
>> would be part a ECM meta strategy spec.
>
>
> Ok.
>
>>
>> >
>> >
>> > Possible use-case scenario
>> > --------------------------
>> >
>> > Suppose you have your naked cocoon running in your favorite servlet
>> > container, and you want to deploy myblock.cob. Here is a possible
>> > sequence of actions on an hypotetical web interface on top of Cocoon
>> > (a-la Tomcat Manager)
>> >
>> > 1) upload the myblock.cob to Cocoon
>> >
>> > 2) Cocoon scans /BLOCK-INF/, reads block.xml and finds out the
>> > behaviors this block depends on as well as the block that it extends.
>> >
>> > 3) the block manager connects to the uber "Cocoon Block Librarian"
>> > web service (hosted probably on cocoon.apache.org) and asks for the
>> > list of blocks that exhibit that required behavior.
>> >
>> > 4) the librarian returns a list of those blocks, so the users
>> chooses,
>> > or the manager allows the user to deploy its own block that implements
>> > the required behavior or to reuse those already deployed blocks that
>> > implement the required behaviors.
>> >
>> > 5) Cocoon checks that all dependencies are met, then unpacks and
>> > installs the blocks
>> >
>> > 6) For each block that exposes a sitemap, the deployment manager asks
>> > the deploying user where he/she wants to *mount* that block in the
>> > managed URI space or if he/she wants to keep them internal only (thus
>> > only available to the other blocks, but not mounted on the public URI
>> > space)
>>
>>
>>
>> The above comment is probably the point where a COB comes into focusus
>> as a specification that extends a more generic BAR specification (i.e.
>> COcoon Block could be viewed as an extension of a generic component
>> Block ARchive).
>
>
> Yep
>
>>
>> >
>> >
>> > 7) for each block that requires installation-time configurations, the
>> > block manager will present the user information on how to configure
>> > the block.
>> >
>> > 8) If no collisions in the URI spaces are found, the blocks are made
>> > available for servicing.
>> >
>> >
>> > Resource dereferencing
>> > ----------------------
>> >
>> > Security concerns aside, the above scenario shows one major issue:
>> > blocks are managed, deployed and mounted by the container. There is
>> (and
>> > there should not be) a way for a block to directly access another
>> block
>> > because this would ruin IoC. xdc
>>
>>
>>
>> If you follow the seperation of "block" from "service" you can avoid
>> this issue. In effect, "service" is what is exposed by the assembly
>> system - block never needs to be exposed. However, this does not
>> address the complete picture. The block concept includes resources as
>> well as services. To complete the picture, the block would need to
>> declare accessible resources (something not addressed in the
>> excalibur/meta or Merlin system).
>
>
> You got me wrong here: the separation of block and service was already
> proposed, but for inheritance, you have to expose *directly* the block
> you want to extend. You can't extend a behavior with a block.
I have the impression that what we are talking about is closer to a
cascading block structure as distinct from inheritance. You mentioned in
the original post the the inhertence principal enables one block to
override another - for example, the action of resolving a URI on a
derived block may result in something different compared with resolving
a URI on the parent (overriding), and second benefit being fallback
semantics. You also mentioned the issue of block exposure and IoC
violation. I spent a bit of time thinking about this have some ideas
that could solve the problem without block exposure - but I need to
think about it some more.
>
> Also note that cocoon blocks will not expose resources but only
> pipelines and components. Resources are those generated by the pipelines.
>
>>
>> The idea of seperating "block" and "service" has significant
>> implications - firstly, the structural unit of deployment are seperate -
>> which means that a service interface, realted meta and resources can be
>> loaded indepedently of a block. You need to be able to do this as soon
>> as you get into classloader hierachies across which service defintions
>> appear higher in the classloader that the implemetations (i.e. the
>> service defintions are shared whereas the block implementation is
>> protected).
>
>
> I lost you here again, probably you are more familiar than me on
> implementation details.
Yes its rather implementation detail - and it also plays into inhertance
throughts that are tumbling around in my head. I'll try to pull some
notes together that explains a possible strategy for block inhertance
without IoC violation.
>>
>> >
>> > Some design decision taken
>> > --------------------------
>> >
>> > o) NO BEHAVIOR VALIDATION:
>> >
>> > I thought a lot about it but I think that having 'behavior description
>> > languages' (such as the WSDL-equivalent for blocks) is going to be
>> > terribly complicated, expensive to implement and hard to use and
>> > enforce, even for simple blocks which don't expose a sitemap and are
>> > just repositories for informations.
>> >
>> > For this reason, there is no validation taking place: if a block
>> > implements a particular behavior and exposes it thru its descriptor
>> > file, Cocoon automatically assume it implements the behavior
>> correctly.
>> >
>> > In the future, we might think of adding a behavior description
>> layer to
>> > enforce a little more validation, but I fear the complexity (for
>> > example) of validating stylesheets against a particular required
>> > behavior.
>> >
>> > IMO, only human try/fail and patching will allow interoperability.
>>
>>
>>
>> Given sufficient meta-info (type-level) plus meta-data (profile-level)
>> it is possible to do validation on components prior to the assembly
>> of blocks/components into a running system.
>
>
> Yeah, for components it's doable. But my concern are is talking about
> validating an entire URI space with its internal flow etc etc. Not easy.
>
>> The validation phase does
>> things like ensuring that meta-data in consitent with implemetation,
>> references to resoruces actually refer to existing resources, etc.
>
>
> Hmmm, suppose you have a matchers like this
>
> <map:match pattern="news/**">
> <map:call resource="block:newsstore:/news/{1}"/>
> ...
> </map:match>
>
> how are you going to validate it?
Don't know
- simply because I'm not up to speed on cocoon sitemaps yet
- but I'll get there. ;-)
>> This
>> type of validation does not need any supplimentary langauge because its
>> simply ensuring the consistency of a logical system before system
>> deployment. Validation could be applied at block creation time, and
>> during multi-block assembly.
>
>
> Components were never my concern for validation purposes.
> Cocoon-specific URI-oriented services are!
>
>>
>> >
>> >
>> > o) VERSIONING AS PART OF THE BEHAVIOR URI
>> >
>> > The behavior URI *MUST* terminate with a /x.y that indicates the
>> > major.minor version of the behavior that a block implements.
>>
>>
>>
>> Can you explain the *must*
>
>
> I'll explain it like this: Java failed to add versioning to interfaces
> and class definitions (assuming that it was classloading's concern to
> do that). I don't want to make the same mistake here. A contract is
> immutable *only* if marked with a timestamp or a unique version
> number. Unlike W3C, I prefer version numbers as unique discriminators
> for URIs.
>
>> - the conventions used in the excalibur/meta
>> package assume a default value of 1.0 if no version information is
>> supplied.
>
>
> This is lame.
Yep.
<snip>
>>
>>
>> Defintion of a block as a structural package
>> ---------------------------------------------
>>
>> I would like to see an Excalibur package dealing with a BAR (Block
>> ARchive) that serves as the basic structure for a COB. This should
>> include tools and utilities for BAR creation, structural validation,
>> signing, etc. There is existing content in the Phoenix app-server
>> related to the SAR file format which is close to the notion of a block
>> in terms of structure but is too cause grained for the block concept.
>
>
> Why so?
The sar structure is basically a packing model similar to a way,
together with assembly information. While this is appropriate at the
application level, a block (as discussed here) is finer graiined in that
is depedencies, exposes services and behaviour. These attributes don't
appear at the level of a sar structure.
> (BTW, should we copy Peter in this discussion?)
Looking at the list I noticed he's already replied.
>> In
>> addition, the work in Merlin dealing with container defintion seems to
>> me to be very close to component/service management side of a block, but
>> lacks the formal management of resources (i.e. a Merlin container only
>> expose services - not resources).
>
>
> Again, cocoon blocks should not expose resources so this is not a
> problem.
>
>>
>>
>> Component meta info and meta data
>> ---------------------------------
>>
>> As mented above - the component type level meta info in excalibur/meta
>> combined with profile level meta data in excalibur/assembly (model
>> package) is a working starting point for the component level deployment
>> concepts. There is some more seperation work to be done on the Merlin
>> side - after which much of the Merlin meta data model will move over to
>> the excalibur/meta package. This will provide a light-weight meta model
>> that is container independent. The model does not currently support
>> inhertance - this would require some minor additions to the existing
>> stucture and some significant additions to the verification functions.
>
>
> Ok.
>
>>
>>
>> Assembly solutions
>> ------------------
>>
>> Merlin includes a assembly engine that automates the process of wiring
>> together components based on depedencies and services. This is working
>> well today but could do with some refactoring.
>
>
> Is it working well or not? the above doesn't really parse.
Yes - this is working really well - both in terms of a top level
containment system, and in terms of embedding container hierachies.
The comment concerning refactoring is in relation to the assembly system
itself which is could be improved in terms of restructuring of the code
into a number of seperate source file - i.e. improve maintainability and
make it easier for others to understand the internal workings of the
assembly system.
>
>
>> Notions of default
>> configurations combined with packaged deployment profiles are proving to
>> be excellent solutions to simplification of the over service management
>> problem.
>>
>> Lifecycle and Lifestyle management
>> ----------------------------------
>>
>> Both Merlin and Fortress support the classic Avalon lifecycle stages
>> (configuration, contextualization, composition/servicing, etc.) together
>> with a common model for the introduction of lifecycle extensions.
>> Respective implemetations differ in the Merlin allows extension
>> implementations to be component that my have their own depedencies
>> whereas Fortress does not have support for compoennt assembly. Lifestyle
>> management is equivalent in that both provide support for singleton,
>> thread, pool and transient policies. Again, implemetation approaches
>> differ - Fortress is very much derived from the ECM model and respects
>> lifestyle marker interfaces whereas Merlin requires lifestyle policy to
>> be declared within the meta-info of a component type. Looking forward,
>> the Merlin strategy will be to declare the lifestyle processing
>> strategy, allowing for defintion of a plug-in handler for lifestyle
>> resolution - allowing a mix of pure meta-based components together with
>> ECM style and Avalon 4.1.2 marker interface recognition.
>
>
> So, do you think it would be possible to migrate Cocoon from ECM to
> Merlin/Fortress without breaking existing functionality?
Yes. This is criteria I basing everything on. 100% compatability with
respect to deployment of exiting ECM based components + a migration
strategy enabling develpers to easily enhance existing content to take
advantage of blocks.
>
>
> Also, are they capable of run-time changes to the block dependencies?
Yes - the API specifically enables run-time management of associations.
I'm currently working on seperation out the meta data level in Merlin 2
and moving it into excalibur/meta along side the meta info model so you
should see more documentation on this rather soon. As soon as its in
place I'll post the URLs.
Cheers, Steve.
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stefano Mazzocchi <st...@apache.org>.
Stephen McConnell wrote:
>
>
> Stefano Mazzocchi wrote:
>
> Stefanno:
>
> Have read with interest the Blocks 1.1 description. First of all -
> thanks to everyone who contributed to this. I have a number of notes
> in-line, some of which I am sure will reflect my ignorance concerning
> the Cocoon world/terminolgy. Throughts are strongly related to
> background with Avalon, experience with Merlin and Fortress and usage of
> the excalibur/meta package.
Stephen, thanks much for this. I think your experience in
component-oriented paradigm will be very valuable for us here. See my
comments inline.
>
>
> >
> > +---------------------------+
> > | Part 2: technical details |
> > +---------------------------+
> >
> > Ok. Now that we have described where we want to go, let's describe how.
> >
> > Cocoon Blocks
> > -------------
> >
> > A Cocoon block is a zipped archive, just like JARs and WARs.
> >
> > The suggested extension of a cocoon block is ".cob" (for COcoon Block).
>
>
>
> Another suggestion ... BAR - Block ARchive.
>
> The reason for suggestiong this is that the concept of a JAR/WAR style
> deployment unit is something I've been looking at within the Merlin
> framework. It seems to me that the notion of a block is something
> usable at level across many different applications and based on the
> requirements and descriptions here - I dion't see any immediate Cocoon
> specifics except for the inclusion of the sitemap and default sitemap
> semantics (more notes on that later).
Well, a COB is more than a BAR. A COB is a cocoon-specific BAR. We need
this. We need a way for the block to *mount* itself onto a specific URI
space. Otherwise blocks are just a way to deploy java components and
their libraries.
>
> >
> > The suggested MIME type is "application/x-cocoon-block".
>
> And following the BAR notion .. "application/x-block"?
I'm not against using a more general MIME type, as long as there is a
way to *cast* it to COB before deployment. Something like having a
signature inside the block metadata or something like that.
>
> >
> > A Cocoon Block (COB from now on) includes a directory called
> >
> > /BLOCK-INF
> >
> > which contains all the block metadata and the resources that must not be
> > directly referentiable from other blocks (for example, jars, classes or
> > file resources made available thru the classloader). The directories
> >
> > /BLOCK-INF/classes
> > /BLOCK-INF/jar
> >
> > are used for classes and jar files. [This follows the WAR paradigm]
>
>
>
> For consitency with the Servlet spec (Web Applications/SRV.9.5 Directory
> Structure) - I suggest /BLOCK-INF/jar be changed to /BLOCK-INF/lib
Yes, yes, I overlooked that. Totally agree it should be /BLOCK-INF/lib
>
> >
> > The main COB descriptor file is found at
> >
> > /BLOCK-INF/block.xml
> >
> > This file contains markup with a cob-specific namespace and will
> > include the following information:
> >
> > 1) block implementation metadata:
> > - unique URI identifier [this identifier will also be used as an
> > address on where to locate the block and how to download it from the
> > web!] (example: http://mystuff.org/dist/myblock-1.5.34.cob)
> > - version (1.5.34)
> > - short name (My Block)
> > - description
> > - author
> > - URI of license (http://mystuff.org/dist/license)
> > - URI of the distribution location
> > (http://mystuff/dist/latest/myblock.cob)
> > - ???
> >
> > 2) role(s):
> > the URI(s) of the behavioral role(s) this block implements
> > and exposes [optional]
>
>
>
> When you are using the work "role", is it safe to assume that this is a
> URI that resolves to a description of the set of computational
> "service"(s) that a block is capable of providing?
yes, it's the 'behavioral contract'.
> If this is correct - then I would suggest renaming this to
> "service(s)".
'service' is kinda abused as a term, expecially now with the web
services stuff floating around.
> My rationale here is that a "role" (to me) is more correctly aligned
> with the consumer of a service - Block B1 is depedendent on service X
> for role of "authorization". If I understand correctly, the notion
> you desribing is collection of an interface + version range supported
> by a block that would enable it to be supplied to Block B1 in order to
> fulfill the service dependecies that B1 has with respect to its
> "authorization" concerns.
Your assumptions are correct and I agree with your rationale that 'role'
is kinda misplaced as an identifier for a behavioral contract.
Still, I don't like the term 'service'. Anybody else has a good
suggestion for this?
>
>
> Keep in mind that I'm biased relative to the Merlin/Phoenix coventions
> here of using the work "service" to describe the functionality
> exported by a component.
No problem.
> I'm extending that notion on the assumption that a block exposed a set
> (or sub-set) of the services provided by the components it is aggregating.
Yes, this plus all the cocoon-specific services. In fact, you could
think at the sitemap as a description of the behavior of a hidden
'cocoon component' that exhibits pipeline-handling services.
> Just as a side note, you may want to think about seperating "block"
> URIs from "service" URIs.
Read again: it's already there. One URI describes the block another
describes the 'behavior' that it's implementing.
So, we could have
http://apache.org/cocoon/blocks/instances/FOP/3.2 implements
http://apache.org/cocoon/blocks/FO2PDF/1.2
> This is something I've been working on recently in
> Merlin - and the seperation of component provider for service has
> proved valuable.
Oh, it's even more than valuable: it's vital. Otherwise, how can be
implement block polymorphism?
> It ensures that the concepts of a service is not tied to a
> particular implementation unit (block or component). Seperation of
> component implemetation meta data from the service meta data is
> already in place under the excalibur/meta package for the same reasons.
>
> >
> > 3) dependencies:
> > the URI(s) of the behavioral roles this block expects,
> > along with the prefixes used by the block as shortcuts in protocol
> > resolving (see below for the meaning of this) [optional]
>
>
>
> I'm guessing that your referring to the inclusion of a roles file - is
> that correct?
Nop. I'm talking about the dependencies of a particular block on the
services provided by other blocks.
So
http//apache.org/cocoon/blocks/instances/Forrest/1.0 requires
http://apache.org/cocoon/blocks/FO2PDF/1.[2-x]
which means that Forrest requires a service to transform FO into PDF and
will use a contract defined on version 1.2 of that behavioral contract
and not changed until 2.0 (excluded)
> How does this compare to something like the dependencies
> declaration used in the excalibur/meta package?
> http://jakarta.apache.org/avalon/excalibur/meta/dependencies.html
>
> >
> > 4) inheritance:
> > the URI of the block extended. [optional]
>
>
>
> It seems to me that there two distinct inheritance concerns: (a) block
> inheritance and (b) component inheritance (assuming that a block
> aggregates components). In the case of block inheritance this would
> handles the cases of resources and the ability to redefine resources
> in derived blocks.
My proposal didn't include a way for a block to access a resource
included in another block directly, but only passing thru a sitemap and
invoquing pipelines.
Here, when a sitemap *extends* another one, it's means of falling back:
the two sitemaps are appended and if no matching happens in the first
one, it falls back on the extended one.
> In the case of component inheritance, this should be
> handled at the component type level and should not be linked to block
> inheritance.
I thought that classloading precedence would solve this issue almost
automatically. In fact, again, if the asked component is not present in
the block classloader, it will fall back to the classloader of the
extended block.
>
>
> >
> > 5) sitemap:
> > the location inside the block file space of the sitemap
> > [optional, if not found defaults to '/sitemap.xmap']
>
>
>
> This one - I'm not sure about - does it make sence for this to be part
> of a generic block specification
No, it makes sense to have this in a cocoon block specification but I'd
be interested in seeing how our effort can combine with others.
> , or is it part of a block that provides
> functionality derived from a stitemap?
A cocoon block is a block with some cocoon specific service. In this
sense a COB extends a BAR and for this reason must have cocoon-specific
semantics.
> Perhaps this is point where a COB extends a BAR ?
Yep. And no small point: without this, blocks are almost useless as a
webapp deployment tool to us. In avalon, you are packaging services
provided by components, in cocoon we want to package services but they
are not only provided by java components but also provided by cocoon
services (pipelines).
In this sense, if a block exposes a sitemap is a cocoon block, if it
doesn't (because sitemap exposure is optional) it is a regular avalon block.
> >
> > 6) configurations:
> > the configurations required for this block to function [optional]
>
>
>
> Some clarification needed here - I'm assuming that a block is a
> collection of a components.
No. A block is a collection of deployable services, some of which are
implemented as avalon components.
> Each component would have its own meta info
> (explicit or derived). At the level of block I can imagine information
> that is describing profiles of component usage, and instructions
> concerning assembly of profiles that will result in the establishment of
> a computation system (I'm talking about internal assembly of a block
> here - not block assembly). This internal "assembly" level information
> can be considered as the block configuration but should not be confused
> with component configuration data.
I lost you here.
Let me give you an example of what I mean with configuration.
Let me suppose that I deploy a block that provides me with
authentication services (don't think about java components only, think
about also a pipeline that handles the login pages, the error pages, the
authentication flow, the user-managing pages and flow and the components
to connect to the various data storages)
This block will then need configurations to work such as:
- system to use [file|RDBMS|LDAP]
- location of the database
- username/password for connection (not needed for 'file')
- ...
and so on.
>
> On the subject of component configuration, there are three different
> levels of component configuration that are handled within the Merlin
> container. The first type is static configuration defaults (established
> by a developer and bundled with the class), the second type is
> configuration data associated with a named deployment profile (i.e.
> component X deployed using profile P1 is different to component X
> deployed using profile P2). The third category of configuration data is
> data defined by an administrator that typically suppliments a profile,
> which in turn suppliments default configuration data.
It is *not* the deployer concern to know who uses the configurations
inside the block. So I shouldn't have to configure single components,
but the block as a whole and then the block knows what part uses what
configuration. Otherwise IoC is broken.
I don't want users to have to know the internals of the block in order
to be able to configure it.
it should be as simple as possible and as transparent as possible to the
user. Just fill-up the form with the value you want and that's it.
>
>
> >
> >
> > Also, the /BLOCK-INF/ directory contains the 'roles' file for Avalon
> > components:
> >
> > /BLOCK-INF/roles.xml
>
>
>
> I've been thinking about how to handle roles versus the more formal meta
> data approach used in Merlin. One of the first things that is needed at
> the component level is the declaration of mechanism used to bring
> external data into and meta-data model. Markus has already started
> working on content in this subject and I'll be shifting some of the
> meta-data content out of Merlin to the excalibur/meta package in the
> near future as part of supporting this work. In effect there should not
> be a need to include a /BLOCK-INF/roles.xml at the spec level - instead
> one should be declaring a meta management strategy at the component
> level, and possible a default strategy at a block level. This would
> enable the deployment of ECM style components without change, together
> with non-ECM components. Specification of the inclusion of a roles file
> would be part a ECM meta strategy spec.
Ok.
>
> >
> >
> > Possible use-case scenario
> > --------------------------
> >
> > Suppose you have your naked cocoon running in your favorite servlet
> > container, and you want to deploy myblock.cob. Here is a possible
> > sequence of actions on an hypotetical web interface on top of Cocoon
> > (a-la Tomcat Manager)
> >
> > 1) upload the myblock.cob to Cocoon
> >
> > 2) Cocoon scans /BLOCK-INF/, reads block.xml and finds out the
> > behaviors this block depends on as well as the block that it extends.
> >
> > 3) the block manager connects to the uber "Cocoon Block Librarian"
> > web service (hosted probably on cocoon.apache.org) and asks for the
> > list of blocks that exhibit that required behavior.
> >
> > 4) the librarian returns a list of those blocks, so the users chooses,
> > or the manager allows the user to deploy its own block that implements
> > the required behavior or to reuse those already deployed blocks that
> > implement the required behaviors.
> >
> > 5) Cocoon checks that all dependencies are met, then unpacks and
> > installs the blocks
> >
> > 6) For each block that exposes a sitemap, the deployment manager asks
> > the deploying user where he/she wants to *mount* that block in the
> > managed URI space or if he/she wants to keep them internal only (thus
> > only available to the other blocks, but not mounted on the public URI
> > space)
>
>
>
> The above comment is probably the point where a COB comes into focusus
> as a specification that extends a more generic BAR specification (i.e.
> COcoon Block could be viewed as an extension of a generic component
> Block ARchive).
Yep
>
> >
> >
> > 7) for each block that requires installation-time configurations, the
> > block manager will present the user information on how to configure
> > the block.
> >
> > 8) If no collisions in the URI spaces are found, the blocks are made
> > available for servicing.
> >
> >
> > Resource dereferencing
> > ----------------------
> >
> > Security concerns aside, the above scenario shows one major issue:
> > blocks are managed, deployed and mounted by the container. There is (and
> > there should not be) a way for a block to directly access another block
> > because this would ruin IoC. xdc
>
>
>
> If you follow the seperation of "block" from "service" you can avoid
> this issue. In effect, "service" is what is exposed by the assembly
> system - block never needs to be exposed. However, this does not
> address the complete picture. The block concept includes resources as
> well as services. To complete the picture, the block would need to
> declare accessible resources (something not addressed in the
> excalibur/meta or Merlin system).
You got me wrong here: the separation of block and service was already
proposed, but for inheritance, you have to expose *directly* the block
you want to extend. You can't extend a behavior with a block.
Also note that cocoon blocks will not expose resources but only
pipelines and components. Resources are those generated by the pipelines.
>
> The idea of seperating "block" and "service" has significant
> implications - firstly, the structural unit of deployment are seperate -
> which means that a service interface, realted meta and resources can be
> loaded indepedently of a block. You need to be able to do this as soon
> as you get into classloader hierachies across which service defintions
> appear higher in the classloader that the implemetations (i.e. the
> service defintions are shared whereas the block implementation is
> protected).
I lost you here again, probably you are more familiar than me on
implementation details.
>
> >
> > Some design decision taken
> > --------------------------
> >
> > o) NO BEHAVIOR VALIDATION:
> >
> > I thought a lot about it but I think that having 'behavior description
> > languages' (such as the WSDL-equivalent for blocks) is going to be
> > terribly complicated, expensive to implement and hard to use and
> > enforce, even for simple blocks which don't expose a sitemap and are
> > just repositories for informations.
> >
> > For this reason, there is no validation taking place: if a block
> > implements a particular behavior and exposes it thru its descriptor
> > file, Cocoon automatically assume it implements the behavior correctly.
> >
> > In the future, we might think of adding a behavior description layer to
> > enforce a little more validation, but I fear the complexity (for
> > example) of validating stylesheets against a particular required
> > behavior.
> >
> > IMO, only human try/fail and patching will allow interoperability.
>
>
>
> Given sufficient meta-info (type-level) plus meta-data (profile-level)
> it is possible to do validation on components prior to the assembly
> of blocks/components into a running system.
Yeah, for components it's doable. But my concern are is talking about
validating an entire URI space with its internal flow etc etc. Not easy.
> The validation phase does
> things like ensuring that meta-data in consitent with implemetation,
> references to resoruces actually refer to existing resources, etc.
Hmmm, suppose you have a matchers like this
<map:match pattern="news/**">
<map:call resource="block:newsstore:/news/{1}"/>
...
</map:match>
how are you going to validate it?
> This
> type of validation does not need any supplimentary langauge because its
> simply ensuring the consistency of a logical system before system
> deployment. Validation could be applied at block creation time, and
> during multi-block assembly.
Components were never my concern for validation purposes.
Cocoon-specific URI-oriented services are!
>
> >
> >
> > o) VERSIONING AS PART OF THE BEHAVIOR URI
> >
> > The behavior URI *MUST* terminate with a /x.y that indicates the
> > major.minor version of the behavior that a block implements.
>
>
>
> Can you explain the *must*
I'll explain it like this: Java failed to add versioning to interfaces
and class definitions (assuming that it was classloading's concern to do
that). I don't want to make the same mistake here. A contract is
immutable *only* if marked with a timestamp or a unique version number.
Unlike W3C, I prefer version numbers as unique discriminators for URIs.
> - the conventions used in the excalibur/meta
> package assume a default value of 1.0 if no version information is
> supplied.
This is lame. It's like saying that you'll default to
'org.apache.avalon' if you forgot to indicate the package of a
component. I think one should know what he/she is doing: if the URI that
defines a contract is
http://blah/something/1.0
it's not
http://blah/something
> My experience is that this is good for the developer but bad
> for the user. User's typically prefer the most recent stable release
> as a default value.
Ah, you are mixing concerns here! One thing is to talk about contract
dependencies, another thing entirely is to talk about user preferences
of deployment of block *instance* versions!
I agree with you that users want the most stable release, but that's why
the block descriptor metadata in my proposal includes:
- unique URI for this block (http://blah/myblock-1.3.239.cob)
- URI for the latest release (http://blah/myblock-latest.cob)
but these are URI for block implementations *not* for the block behaviors.
> I've also some reservation about the "/" delimited as the appropriate
> means for version delimiting - because it would break what is already
> running in Merlin :-)
Nothing is carved in stone here so feel free to propose alternative
syntaxes as long as the intended results remain the same.
>
>
> >
> >
> > On dependencies, each block must be able to specify the 'ranges' of
> > versioning that it is known to work with. For example
> >
> > prefix="skin"/>
> >
> > But I haven't really thought about the patterns that could be used for
> > this.
> >
> > Please, help on this.
>
>
>
> Some useful documetation concerning "component" level meta info for the
> type level is available on the excalibur/meta package. This meta info
> *only* deals with the component type level (equivalent to information
> supplimenting the component implementation classes and service interface
> classes).
> http://jakarta.apache.org/avalon/excalibur/meta/index.html
>
> Meta information concerning the description of "profiles" (the
> configuration data, context directives, etc.) is defined under the
> Merlin 2 API. The Profile Javadoc is a good starting point.
>
> http://jakarta.apache.org/avalon/excalibur/merlin/api/
Ok, I'll take a look at those later (I'm offline right now)
>
>
> >
> > 3) Which avalon container should we use since the one we currently
> > use (ECM) is not powerful enough? is there already a container which
> > is powerful enough to handle our needs as described here? if not, what
> > do we do? we implement our own or work with the avalon people to fix
> > theirs to meet our needs?
>
>
>
> I would *very* much like to see this as a joint Cocoon/Avalon iniative.
Me too. I don't want to reinvent the wheel if it's possible to avoid that!
>
> On the Avalon front there are two containers the play into the
> requirements stated above - Merlin and Fortress. However, neither of
> these containers completely address the requirements. But lets look a
> little deeper and figure out where Avalon is today relative to the
> target and what potential is offered by a combination of Merlin,
> Fortress and aother Avalon related iniatives.
ok
>
>
> Defintion of a block as a structural package
> ---------------------------------------------
>
> I would like to see an Excalibur package dealing with a BAR (Block
> ARchive) that serves as the basic structure for a COB. This should
> include tools and utilities for BAR creation, structural validation,
> signing, etc. There is existing content in the Phoenix app-server
> related to the SAR file format which is close to the notion of a block
> in terms of structure but is too cause grained for the block concept.
Why so? (BTW, should we copy Peter in this discussion?)
> In
> addition, the work in Merlin dealing with container defintion seems to
> me to be very close to component/service management side of a block, but
> lacks the formal management of resources (i.e. a Merlin container only
> expose services - not resources).
Again, cocoon blocks should not expose resources so this is not a problem.
>
>
> Component meta info and meta data
> ---------------------------------
>
> As mented above - the component type level meta info in excalibur/meta
> combined with profile level meta data in excalibur/assembly (model
> package) is a working starting point for the component level deployment
> concepts. There is some more seperation work to be done on the Merlin
> side - after which much of the Merlin meta data model will move over to
> the excalibur/meta package. This will provide a light-weight meta model
> that is container independent. The model does not currently support
> inhertance - this would require some minor additions to the existing
> stucture and some significant additions to the verification functions.
Ok.
>
>
> Assembly solutions
> ------------------
>
> Merlin includes a assembly engine that automates the process of wiring
> together components based on depedencies and services. This is working
> well today but could do with some refactoring.
Is it working well or not? the above doesn't really parse.
> Notions of default
> configurations combined with packaged deployment profiles are proving to
> be excellent solutions to simplification of the over service management
> problem.
>
> Lifecycle and Lifestyle management
> ----------------------------------
>
> Both Merlin and Fortress support the classic Avalon lifecycle stages
> (configuration, contextualization, composition/servicing, etc.) together
> with a common model for the introduction of lifecycle extensions.
> Respective implemetations differ in the Merlin allows extension
> implementations to be component that my have their own depedencies
> whereas Fortress does not have support for compoennt assembly. Lifestyle
> management is equivalent in that both provide support for singleton,
> thread, pool and transient policies. Again, implemetation approaches
> differ - Fortress is very much derived from the ECM model and respects
> lifestyle marker interfaces whereas Merlin requires lifestyle policy to
> be declared within the meta-info of a component type. Looking forward,
> the Merlin strategy will be to declare the lifestyle processing
> strategy, allowing for defintion of a plug-in handler for lifestyle
> resolution - allowing a mix of pure meta-based components together with
> ECM style and Avalon 4.1.2 marker interface recognition.
So, do you think it would be possible to migrate Cocoon from ECM to
Merlin/Fortress without breaking existing functionality?
Also, are they capable of run-time changes to the block dependencies?
> Mixed lookup semantics
> ----------------------
>
> Fortress provides complete support for the extended semantics implied
> within a lookup argument. The Merlin 2 implementation does not support
> this. The main issue (from my own point of view) is that the Avalon
> framrework Composable and Serviceable interface seamantics are
> insuffiently specificed and the real requirement here is to resolve this
> at the framework level first, then apply these solutions within
> respective containers. In the meantime, the strategy for Merlin will be
> to plug-in an ECM style manager when required at a component or
> container level (with an implementation based on existing Fortress
> code). This will enable zero modification of existing ECM style
> components.
Ok, cool. We don't want to deal with framework changes until they
solidify so this is a very big requirement for us.
>
> >
> > 4) how do we implement the block manager? should it be a comman line
> > interface or a web interface, or both?
>
>
>
> I don't think I agree with the question ;-)
> Management of blocks should be indepedent of the means through
> information is presented. Assume that you have a container that is
> capable of managing a set of components, resources and subsidary
> containers ... you could imagine a management interface to the
> container, and that management interface could be accessible via the
> web, command line, JMX etc.
Yeah, of course. for 'block manager' I was indicating the
'user-interactive layer' that allows us to deploy, configure and manage
blocks. I was not talking about the block manager in term of container
implementation. Terminology conflict here.
>
> > what about security?
>
>
>
> Work I've done in this area is perhaps excessive relative to what you
> have in mind. I have a micro PKI which handles the generation of keys
> and certificates which are used for both admin and runtime
> authorization. The main difference between the work I'm doing and what
> your describing here is that I'm dealing with distributed containers and
> I need to propergate identify with every invocation and single
> invocation may result in service invocation across multiple container
> deployed in defferent sites, each with different security policies.
No, no, no, nothing that fancy here :) we just would like to be sure
that the block http://apache.org/cocoon/blah-1.3.398.cob really comes
from apache.org and is therefore trustfull to deploy. That's plain
enough for me.
>
> >
> > 5) the 'uber library of cocoon blocks'. Where do we host it? how to
> > we manage it? How do we provide the block discovery web service? which
> > technology do we use: SOAP or REST?
>
>
>
> My experience here is somewhat experimental at this stage. I'm not
> using a web protocol - instead I'm passing meta model structures over
> the wire (i.e. remote invocations but the scenario is a little diffenent
> because I'm more concerned with service access where service can be
> relocated locally or accessed remotely).
>
> >
> > 6) should we "digitally sign" our blocks?
>
>
>
> Yes.
>
> > if so, how?
> >
>
> Has anyone though about a Cocoon Certification Authority ?
Ok, I think we have to involve our crypto gurus here, I'll ask the
mod_ssl people.
For now, let's skip this step since it's just another step in the
validation phase and doesn't impact the block design.
--
Stefano Mazzocchi <st...@apache.org>
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stephen McConnell <mc...@apache.org>.
Ivelin Ivanov wrote:
>
>
>> "Stephen McConnell" wrote:
>>
>>
>>
>>> 6) should we "digitally sign" our blocks?
>>>
>>>
>>Yes.
>>
>>
>
>Same way as JARs.
>
>
>
>>>if so, how?
>>>
>>>
>>>
>>Has anyone though about a Cocoon Certification Authority ?
>>
>>
>
>
>...which is signed by a Root Apache Certification Authority?
>
Yep.
(or someting like an Apache Software Distribution Authority CA itself
signed by a root Apache CA).
Cheers, Steve.
>
>
>Ivelin
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
>For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>
>
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Ivelin Ivanov <iv...@apache.org>.
>
>
> "Stephen McConnell" wrote:
>
> >
> > 6) should we "digitally sign" our blocks?
>
>
> Yes.
Same way as JARs.
>
> > if so, how?
> >
>
> Has anyone though about a Cocoon Certification Authority ?
...which is signed by a Root Apache Certification Authority?
Ivelin
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stephen McConnell <mc...@apache.org>.
Stefano Mazzocchi wrote:
Stefanno:
Have read with interest the Blocks 1.1 description. First of all -
thanks to everyone who contributed to this. I have a number of notes
in-line, some of which I am sure will reflect my ignorance concerning
the Cocoon world/terminolgy. Throughts are strongly related to
background with Avalon, experience with Merlin and Fortress and usage of
the excalibur/meta package.
>
> +---------------------------+
> | Part 2: technical details |
> +---------------------------+
>
> Ok. Now that we have described where we want to go, let's describe how.
>
> Cocoon Blocks
> -------------
>
> A Cocoon block is a zipped archive, just like JARs and WARs.
>
> The suggested extension of a cocoon block is ".cob" (for COcoon Block).
Another suggestion ... BAR - Block ARchive.
The reason for suggestiong this is that the concept of a JAR/WAR style
deployment unit is something I've been looking at within the Merlin
framework. It seems to me that the notion of a block is something
usable at level across many different applications and based on the
requirements and descriptions here - I dion't see any immediate Cocoon
specifics except for the inclusion of the sitemap and default sitemap
semantics (more notes on that later).
>
> The suggested MIME type is "application/x-cocoon-block".
And following the BAR notion .. "application/x-block"?
>
> A Cocoon Block (COB from now on) includes a directory called
>
> /BLOCK-INF
>
> which contains all the block metadata and the resources that must not be
> directly referentiable from other blocks (for example, jars, classes or
> file resources made available thru the classloader). The directories
>
> /BLOCK-INF/classes
> /BLOCK-INF/jar
>
> are used for classes and jar files. [This follows the WAR paradigm]
For consitency with the Servlet spec (Web Applications/SRV.9.5 Directory
Structure) - I suggest /BLOCK-INF/jar be changed to /BLOCK-INF/lib
>
> The main COB descriptor file is found at
>
> /BLOCK-INF/block.xml
>
> This file contains markup with a cob-specific namespace and will
> include the following information:
>
> 1) block implementation metadata:
> - unique URI identifier [this identifier will also be used as an
> address on where to locate the block and how to download it from the
> web!] (example: http://mystuff.org/dist/myblock-1.5.34.cob)
> - version (1.5.34)
> - short name (My Block)
> - description
> - author
> - URI of license (http://mystuff.org/dist/license)
> - URI of the distribution location
> (http://mystuff/dist/latest/myblock.cob)
> - ???
>
> 2) role(s):
> the URI(s) of the behavioral role(s) this block implements
> and exposes [optional]
When you are using the work "role", is it safe to assume that this is a
URI that resolves to a description of the set of computational
"service"(s) that a block is capable of providing? If this is correct -
then I would suggest renaming this to "service(s)". My rationale here
is that a "role" (to me) is more correctly aligned with the consumer of
a service - Block B1 is depedendent on service X for role of
"authorization". If I understand correctly, the notion you desribing is
collection of an interface + version range supported by a block that
would enable it to be supplied to Block B1 in order to fulfill the
service dependecies that B1 has with respect to its "authorization"
concerns.
Keep in mind that I'm biased relative to the Merlin/Phoenix coventions
here of using the work "service" to describe the functionality exported
by a component. I'm extending that notion on the assumption that a block
exposed a set (or sub-set) of the services provided by the components it
is aggregating.
Just as a side note, you may want to think about seperating "block" URIs
from "service" URIs. This is something I've been working on recently in
Merlin - and the seperation of component provider for service has proved
valuable. It ensures that the concepts of a service is not tied to a
particular implementation unit (block or component). Seperation of
component implemetation meta data from the service meta data is already
in place under the excalibur/meta package for the same reasons.
>
> 3) dependencies:
> the URI(s) of the behavioral roles this block expects,
> along with the prefixes used by the block as shortcuts in protocol
> resolving (see below for the meaning of this) [optional]
I'm guessing that your referring to the inclusion of a roles file - is
that correct? How does this compare to something like the dependencies
declaration used in the excalibur/meta package?
http://jakarta.apache.org/avalon/excalibur/meta/dependencies.html
>
> 4) inheritance:
> the URI of the block extended. [optional]
It seems to me that there two distinct inheritance concerns: (a) block
inheritance and (b) component inheritance (assuming that a block
aggregates components). In the case of block inheritance this would
handles the cases of resources and the ability to redefine resources in
derived blocks. In the case of component inheritance, this should be
handled at the component type level and should not be linked to block
inheritance.
>
> 5) sitemap:
> the location inside the block file space of the sitemap
> [optional, if not found defaults to '/sitemap.xmap']
This one - I'm not sure about - does it make sence for this to be part
of a generic block specification, or is it part of a block that provides
functionality derived from a stitemap? Perhaps this is point where a COB
extends a BAR ?
>
> 6) configurations:
> the configurations required for this block to function [optional]
Some clarification needed here - I'm assuming that a block is a
collection of a components. Each component would have its own meta info
(explicit or derived). At the level of block I can imagine information
that is describing profiles of component usage, and instructions
concerning assembly of profiles that will result in the establishment of
a computation system (I'm talking about internal assembly of a block
here - not block assembly). This internal "assembly" level information
can be considered as the block configuration but should not be confused
with component configuration data.
On the subject of component configuration, there are three different
levels of component configuration that are handled within the Merlin
container. The first type is static configuration defaults (established
by a developer and bundled with the class), the second type is
configuration data associated with a named deployment profile (i.e.
component X deployed using profile P1 is different to component X
deployed using profile P2). The third category of configuration data is
data defined by an administrator that typically suppliments a profile,
which in turn suppliments default configuration data.
>
>
> Also, the /BLOCK-INF/ directory contains the 'roles' file for Avalon
> components:
>
> /BLOCK-INF/roles.xml
I've been thinking about how to handle roles versus the more formal meta
data approach used in Merlin. One of the first things that is needed at
the component level is the declaration of mechanism used to bring
external data into and meta-data model. Markus has already started
working on content in this subject and I'll be shifting some of the
meta-data content out of Merlin to the excalibur/meta package in the
near future as part of supporting this work. In effect there should not
be a need to include a /BLOCK-INF/roles.xml at the spec level - instead
one should be declaring a meta management strategy at the component
level, and possible a default strategy at a block level. This would
enable the deployment of ECM style components without change, together
with non-ECM components. Specification of the inclusion of a roles file
would be part a ECM meta strategy spec.
>
>
> Possible use-case scenario
> --------------------------
>
> Suppose you have your naked cocoon running in your favorite servlet
> container, and you want to deploy myblock.cob. Here is a possible
> sequence of actions on an hypotetical web interface on top of Cocoon
> (a-la Tomcat Manager)
>
> 1) upload the myblock.cob to Cocoon
>
> 2) Cocoon scans /BLOCK-INF/, reads block.xml and finds out the
> behaviors this block depends on as well as the block that it extends.
>
> 3) the block manager connects to the uber "Cocoon Block Librarian"
> web service (hosted probably on cocoon.apache.org) and asks for the
> list of blocks that exhibit that required behavior.
>
> 4) the librarian returns a list of those blocks, so the users chooses,
> or the manager allows the user to deploy its own block that implements
> the required behavior or to reuse those already deployed blocks that
> implement the required behaviors.
>
> 5) Cocoon checks that all dependencies are met, then unpacks and
> installs the blocks
>
> 6) For each block that exposes a sitemap, the deployment manager asks
> the deploying user where he/she wants to *mount* that block in the
> managed URI space or if he/she wants to keep them internal only (thus
> only available to the other blocks, but not mounted on the public URI
> space)
The above comment is probably the point where a COB comes into focusus
as a specification that extends a more generic BAR specification (i.e.
COcoon Block could be viewed as an extension of a generic component
Block ARchive).
>
>
> 7) for each block that requires installation-time configurations, the
> block manager will present the user information on how to configure
> the block.
>
> 8) If no collisions in the URI spaces are found, the blocks are made
> available for servicing.
>
>
> Resource dereferencing
> ----------------------
>
> Security concerns aside, the above scenario shows one major issue:
> blocks are managed, deployed and mounted by the container. There is (and
> there should not be) a way for a block to directly access another block
> because this would ruin IoC. xdc
If you follow the seperation of "block" from "service" you can avoid
this issue. In effect, "service" is what is exposed by the assembly
system - block never needs to be exposed. However, this does not
address the complete picture. The block concept includes resources as
well as services. To complete the picture, the block would need to
declare accessible resources (something not addressed in the
excalibur/meta or Merlin system).
The idea of seperating "block" and "service" has significant
implications - firstly, the structural unit of deployment are seperate -
which means that a service interface, realted meta and resources can be
loaded indepedently of a block. You need to be able to do this as soon
as you get into classloader hierachies across which service defintions
appear higher in the classloader that the implemetations (i.e. the
service defintions are shared whereas the block implementation is
protected).
>
> So, one block doesn't know where the blocks it depends on are located,
> both on disk *and* on the URI space as well.
>
> The proposed solution is to use block-specific protocols to identify the
> dereferenced resources.
>
> For example, the myblock.cob/sitemap.xmap file could contain a global
> matcher which works like this:
>
> <map:match pattern="**/*.html">
> <map:generate src="{1}.xml"/>
> <map:transform src="block:skin:/stylesheets/document2html.xslt"/>
> <map:serialize/>
> </map:match>
>
> please note the
>
> block:skin:/stylesheets/document2html.xslt
>
> which indicates
>
> block -> use the block protocol
>
> skin -> use the 'skin' prefix to lookup the block behavior URI and thus
> the block which implements it for this block (the block manager knows
> this)
>
> /stylesheets/document2html.xslt -> it will ask the sitemap of the
> skin block to produce that resource.
>
>
> Dereferencing navigation
> ------------------------
>
> Not only a sitemap needs to connect to the resources contained in the
> blocks on which the block depends on, but the resulting pages as well.
>
> In fact, suppose you have a block that exposes a web service and another
> one that exposes a web application that wraps that web service. For
> sure, the generated web page will have to have a URI to connect to that
> service, since it's the client's browser that makes the call (unless we
> want to virtualize everything thru the sitemaps, but I wouldn't suggest
> it).
>
> So, a possible solution is to use the "block:" protocol in the pages as
> well and have a URI-mapping transformer right before the serialization
> stage.
>
> For example, things like
>
> <form action="block:web-service:/post">...</form>
>
> is trasnformed into
>
> <form action="/servizio-web/post"/>...</form>
Not following the above too well (probably some prior Cocoon knowlege
that I'm missing). One thing that I feel uncomfortable about is the
direct reference in the action statement to the "block" as distinct to a
reference to a "service".
E.g. The following would make me feel better:
<form action="service:web-service:/post">...</form>
:-)
>
>
> Some design decision taken
> --------------------------
>
> o) NO BEHAVIOR VALIDATION:
>
> I thought a lot about it but I think that having 'behavior description
> languages' (such as the WSDL-equivalent for blocks) is going to be
> terribly complicated, expensive to implement and hard to use and
> enforce, even for simple blocks which don't expose a sitemap and are
> just repositories for informations.
>
> For this reason, there is no validation taking place: if a block
> implements a particular behavior and exposes it thru its descriptor
> file, Cocoon automatically assume it implements the behavior correctly.
>
> In the future, we might think of adding a behavior description layer to
> enforce a little more validation, but I fear the complexity (for
> example) of validating stylesheets against a particular required
> behavior.
>
> IMO, only human try/fail and patching will allow interoperability.
Given sufficient meta-info (type-level) plus meta-data (profile-level)
it is possible to do validation on components prior to the assembly of
blocks/components into a running system. The validation phase does
things like ensuring that meta-data in consitent with implemetation,
references to resoruces actually refer to existing resources, etc. This
type of validation does not need any supplimentary langauge because its
simply ensuring the consistency of a logical system before system
deployment. Validation could be applied at block creation time, and
during multi-block assembly.
>
>
> o) VERSIONING AS PART OF THE BEHAVIOR URI
>
> The behavior URI *MUST* terminate with a /x.y that indicates the
> major.minor version of the behavior that a block implements.
Can you explain the *must* - the conventions used in the excalibur/meta
package assume a default value of 1.0 if no version information is
supplied. My experience is that this is good for the developer but bad
for the user. User's typically prefer the most recent stable release as
a default value.
I've also some reservation about the "/" delimited as the appropriate
means for version delimiting - because it would break what is already
running in Merlin :-)
>
>
> On dependencies, each block must be able to specify the 'ranges' of
> versioning that it is known to work with. For example
>
> <block behavior="http://xml.apache.org/forrest/skin/1.x"
> prefix="skin"/>
>
> But I haven't really thought about the patterns that could be used for
> this.
>
> Please, help on this.
Some useful documetation concerning "component" level meta info for the
type level is available on the excalibur/meta package. This meta info
*only* deals with the component type level (equivalent to information
supplimenting the component implementation classes and service interface
classes).
http://jakarta.apache.org/avalon/excalibur/meta/index.html
Meta information concerning the description of "profiles" (the
configuration data, context directives, etc.) is defined under the
Merlin 2 API. The Profile Javadoc is a good starting point.
http://jakarta.apache.org/avalon/excalibur/merlin/api/
>
> o) CROSS-BLOCK SECURITY
>
> Even I don't think anybody is stupid enough to use a single Cocoon
> instance to run a full ISP and ask for sandboxing of the single blocks,
> cross-block security is a big concern, expecially since you might be
> deploying components on the fly in a binary format.
>
> So, first thing is to protect the /BLOCK-INF/ directory.
>
> The second thing is to wrap each block with its own classloader,
> connected to the block dependency map, so that each class discovery is
> done only on the class space of the dependent blocks.
>
> [NOTE: this doesn't prevent people from using blocks as trojans, but we
> won't host blocks which don't come with the source code so we solve that
> problem].
>
> o) COCOON MANAGER SECURITY
>
> The cocoon manager might be a block itself that connects to specific
> cocoon internals and provides a web interface for it. So, it can be
> removed or disabled when put on production.
>
> Also, the feature of automatic discovery of blocks thru the 'cocoon
> block library' can be turned off or substituted with its own (even the
> 'cocoon block library' could be a block, so you could have your own
> block library on your system instead of connecting to the apache one).
The introduction of the above points are examples of the requirement for
the population of a container with a set of internal facilities (as
opposed to components that a container is managing) - its an important
distinction.
>
> o) OPTIONAL COP
>
> The block.xml file makes it *optional* to expose behaviors or to depend
> on them. This allows the COP model to nicely downgrade to the good old
> single-archive WAR paradigm for those who don't care about block
> polymorphism.
>
> - o -
>
> Conclusions
> -----------
>
> I think I have exposed a detailed plan on how to implement blocks and
> solve a number of issues we are having:
>
> 1) allow users to 'compose' Cocoon only with those modules they need
> 2) allow users to easily deploy their stuff on cocoon
> 3) allow users to easily reuse web applications components without
> sacrificing coherence, interoperability and easy extensibility
> 4) allow users to be helped by Cocoon to 'fill the gaps' and be
> suggested on what components is best required and feed it automatically
> (apt-get like)
> 5) allow the Cocoon communities to clearly separate concerns between
> the core and the application-level stuff, thus allowing the cocoon
> community to really scale by massive development parallelization
> 6) allows, for the first time in the history of the web, to use
> polymorphism, inheritence and COP at a web application level.
>
> THANKS
> ------
>
> I would like to thank Giacomo Pati and Carsten Ziegler for their great
> contribution and precious feedback.
>
>
> Changes from version 1.0
> ------------------------
>
> - added the concept of block inheritance
> - wrote a scenario for introduction of the COB model as an evolution
> of the WAR model.
> - added configurations to blocks
> - changed block.info and blocks.roles into block.xml and roles.xml
> - removed issues already identified by the first round of design
>
>
> TODO
> ----
>
> 1) blocks should allow to depend on 'ranges' of behavior versions.
> Let's try to come up with a way to describe those ranges effectively.
>
> 2) the block manager should present the user with a form on how to
> configure the block, thus the block should contain enough
> configuration metadata (default values, valid entries, ect..) to tell
> the block manager how to create the form to present. Should we use RDF
> for this or schemas are good enough?
>
> 3) Which avalon container should we use since the one we currently
> use (ECM) is not powerful enough? is there already a container which
> is powerful enough to handle our needs as described here? if not, what
> do we do? we implement our own or work with the avalon people to fix
> theirs to meet our needs?
I would *very* much like to see this as a joint Cocoon/Avalon iniative.
On the Avalon front there are two containers the play into the
requirements stated above - Merlin and Fortress. However, neither of
these containers completely address the requirements. But lets look a
little deeper and figure out where Avalon is today relative to the
target and what potential is offered by a combination of Merlin,
Fortress and aother Avalon related iniatives.
Defintion of a block as a structural package
---------------------------------------------
I would like to see an Excalibur package dealing with a BAR (Block
ARchive) that serves as the basic structure for a COB. This should
include tools and utilities for BAR creation, structural validation,
signing, etc. There is existing content in the Phoenix app-server
related to the SAR file format which is close to the notion of a block
in terms of structure but is too cause grained for the block concept.
In addition, the work in Merlin dealing with container defintion seems
to me to be very close to component/service management side of a block,
but lacks the formal management of resources (i.e. a Merlin container
only expose services - not resources).
Component meta info and meta data
---------------------------------
As mented above - the component type level meta info in excalibur/meta
combined with profile level meta data in excalibur/assembly (model
package) is a working starting point for the component level deployment
concepts. There is some more seperation work to be done on the Merlin
side - after which much of the Merlin meta data model will move over to
the excalibur/meta package. This will provide a light-weight meta model
that is container independent. The model does not currently support
inhertance - this would require some minor additions to the existing
stucture and some significant additions to the verification functions.
Assembly solutions
------------------
Merlin includes a assembly engine that automates the process of wiring
together components based on depedencies and services. This is working
well today but could do with some refactoring. Notions of default
configurations combined with packaged deployment profiles are proving to
be excellent solutions to simplification of the over service management
problem.
Lifecycle and Lifestyle management
----------------------------------
Both Merlin and Fortress support the classic Avalon lifecycle stages
(configuration, contextualization, composition/servicing, etc.) together
with a common model for the introduction of lifecycle extensions.
Respective implemetations differ in the Merlin allows extension
implementations to be component that my have their own depedencies
whereas Fortress does not have support for compoennt assembly.
Lifestyle management is equivalent in that both provide support for
singleton, thread, pool and transient policies. Again, implemetation
approaches differ - Fortress is very much derived from the ECM model and
respects lifestyle marker interfaces whereas Merlin requires lifestyle
policy to be declared within the meta-info of a component type. Looking
forward, the Merlin strategy will be to declare the lifestyle processing
strategy, allowing for defintion of a plug-in handler for lifestyle
resolution - allowing a mix of pure meta-based components together with
ECM style and Avalon 4.1.2 marker interface recognition.
Mixed lookup semantics
----------------------
Fortress provides complete support for the extended semantics implied
within a lookup argument. The Merlin 2 implementation does not support
this. The main issue (from my own point of view) is that the Avalon
framrework Composable and Serviceable interface seamantics are
insuffiently specificed and the real requirement here is to resolve this
at the framework level first, then apply these solutions within
respective containers. In the meantime, the strategy for Merlin will be
to plug-in an ECM style manager when required at a component or
container level (with an implementation based on existing Fortress
code). This will enable zero modification of existing ECM style
components.
>
> 4) how do we implement the block manager? should it be a comman line
> interface or a web interface, or both?
I don't think I agree with the question ;-)
Management of blocks should be indepedent of the means through
information is presented. Assume that you have a container that is
capable of managing a set of components, resources and subsidary
containers ... you could imagine a management interface to the
container, and that management interface could be accessible via the
web, command line, JMX etc.
> what about security?
Work I've done in this area is perhaps excessive relative to what you
have in mind. I have a micro PKI which handles the generation of keys
and certificates which are used for both admin and runtime
authorization. The main difference between the work I'm doing and what
your describing here is that I'm dealing with distributed containers and
I need to propergate identify with every invocation and single
invocation may result in service invocation across multiple container
deployed in defferent sites, each with different security policies.
>
> 5) the 'uber library of cocoon blocks'. Where do we host it? how to
> we manage it? How do we provide the block discovery web service? which
> technology do we use: SOAP or REST?
My experience here is somewhat experimental at this stage. I'm not
using a web protocol - instead I'm passing meta model structures over
the wire (i.e. remote invocations but the scenario is a little diffenent
because I'm more concerned with service access where service can be
relocated locally or accessed remotely).
>
> 6) should we "digitally sign" our blocks?
Yes.
> if so, how?
>
Has anyone though about a Cocoon Certification Authority ?
Cheers, Steve.
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:mcconnell@osm.net
http://www.osm.net
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Stefano Mazzocchi wrote:
> Miles Elam wrote:
>
>> With regard to block deployment and its similarity to general package
>> management systems (deb, rpm, msi, etc.), should there be any
>> discussion about central repositories a la Debian's stable, testing,
>> and unstable?
>>
>> A self-contained unit of code (component, package, whatever) is
>> great, but there's something to be said for:
>>
>> apt-get install foo
>>
>> It is so convenient in fact that many people used Debian or
>> Debian-based distributions solely as a way to avoid the hunt you used
>> to do for rpm files.
>>
>> How does a user find a package that does SVG if they've never heard
>> of Batik? They know that they want to use SVG and serialize, but
>> then they must go to a web site, find the list of COBs, read the docs
>> on each one, and download the appropriate one? Are we expecting
>> people to do a google search but with a site:cocoondev.apache.org
>> modifier (which of course assumes they know to constrain the search
>> there)?
>>
>> My question is how should block directories and discovery be
>> handled? I guess it could be considered an implementation detail,
>> but I think it should be brewing on the back burner in peoples' mind
>> at least. Having useful repositories requires more forethought than
>> just a download directory.
>>
>> Thoughts?
>
>
> I'm in a hurry now (going to the london gettogether right after this,
> All Bar One on Regents Street, London if anybody else wants to show
> up) but I will reply in full detail tomorrow.
>
> By now just a hint: when we'll have cocoon.apache.org, we'll have our
> own 'uber library' of blocks for block discovery.
>
> The idea is simple:
>
> 1) I give you the block behavior
> 2) you give me a list of blocks that implement this behavior and the
> location where I can download them
>
> Nice simple, effective and implemented with a simple POST request and
> XML response.
>
> What do you think?
That's very easy once you know the block behavior (point 1 above). And
this is where we will need something like http://modules.apache.org/ to
know which block behaviors exist, and what is their formal definition
that should be used in the POST request.
Enjoy your gettogether in London !
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Miles Elam <mi...@pcextremist.com>.
I think you constantly amaze me with how often you are right. Nothing
like a hung over Stefano to make someone humble...
:)
- Miles
Stefano Mazzocchi wrote:
> Let's do it the other way around: let's start from cocoon.apache.org
> and if we can't scale, we'll think about how to fix that, ok?
>
> I perfectly see your point, but I think we should avoid designing and
> implementing stuff just because there are parallels in other areas.
> Design by parallelism is a very subdle anti-pattern.
>
> And for your commercially-friendly concern, I don't think that any
> company will ever do block deployment out of dynamic discovery anyway.
> And if they want to do it, I'd suggest we talk about that when the
> issue emerges.
>
> What do you think?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stefano Mazzocchi <st...@apache.org>.
Miles Elam wrote:
> Stefano Mazzocchi wrote:
>
>> I'm in a hurry now (going to the london gettogether right after this,
>> All Bar One on Regents Street, London if anybody else wants to show
>> up) but I will reply in full detail tomorrow.
>
>
> No problem. Have fun! I wish I wasn't eight time zones away from you
> or I'd join in on the sharing of pints.
>
Ok, I'm back. I had some 7 pints of beer and with a day-empty stomach
before we hit wagamama (http://www.wagamama.com) so not all my synapses
could be fully functional... but anyway... here I am.
>> By now just a hint: when we'll have cocoon.apache.org, we'll have our
>> own 'uber library' of blocks for block discovery.
>>
>> The idea is simple:
>>
>> 1) I give you the block behavior
>> 2) you give me a list of blocks that implement this behavior and the
>> location where I can download them
>>
>> Nice simple, effective and implemented with a simple POST request and
>> XML response.
>>
>> What do you think?
>
>
> That works for storage issues and for getting newest versions, but it is
> a single point of failure and leaves out one major group: commercial
> vendors.
All right. I was hoping to discuss this later down the road, but I think
it's good to give perspectives right up front. Yes, I'm aware of this
issue and I do have solutions to propose for that.
> I love free (libre) software, but commercial software exists,
> some of it is good, and if they have a revenue stream they can be
> terribly prolific with code production.
Hey, I'm not RMS :) I know that.
> Lets say a vendor (correctly) recognizes Cocoon as a truly innovative
> product and sees a niche for itself for creating custom components for
> it.
This is already happening. A lot.
> If their product costs money (which it almost certainly will in
> this scenario), they don't want people to be able to automatically
> download their products without payment.
That's obvious.
> If and when Cocoon really takes off
If? :) [just kidding]
> the sheer number of component producers -- commercial and
> open source -- would surely either (a) overwhelm the component
> maintainer on components.cocoon.apache.org (or whatever the hostname) or
> (b) become so large and unweildy a list with so many competing products
> so as to be much less usable by the Cocoon user.
>
> On the other hand, if you have an equivalent of Debian's "sources.list"
> -- a list of all of your possible download points -- you can easily
> add/remove access points as needed, allow for failover to alternate
> servers, allow for multiple types of sources (think stable versus beta
> versus bleeding edge), makes sure that people always have the most
> recent version in case of slow rsync to mirrors, and finally it would
> allow a vendor to bundle their services with a Cocoon package.
Careful, you are mixing concerns.
One concern is about mirroring and load distribution. That will be dealt
with the mirroring effort that is going on in infrastructure@, our block
library will simply point you to the right URI (we could do things like
geo-spotting or explicitly having the client indicate the location,
anyway that's a implementation detail)
Another concern is multiple block libraries.
And yes, that is already (even if partially) touched in the design paper
I sent.
> Cocoon won't go as far without local dealer support. Most of the time,
> end users won't be downloading Cocoon, Tomcat, et al and setting up
> their own box. Most of the time, they call local consultants, have them
> make offers, choose the one they like the best, and have them set it up.
> If those vendors can just add themselves to a list in their custom
> Cocoon package, they do not disrupt the community with highly
> specialized components, and vendors have an "added value" (*ugh*
> sometimes I really hate marketing-speak) they can tout to their
> customers. In other words, they'll have a greater incentive to help
> propogate Cocoon to others.
Yes, I see this.
But again, be careful not to mix concerns.
One usage scenario is about automatic discovery of blocks, another is
direct installation of a deployment descriptor.
Think of something like this [it's an example, not a proposal!]
<deploy>
<block href="http://myblocks.org/whatever.cob/>
<block href="http://cocoon.apache.org/dist/blocks/fop-1.2.3.cob/>
</deploy>
and your customer is happy. Note that the URI-based discovery phase it's
not needed anymore in this case.
[NOTE: the URI is transparently redirected to the mirror one depending
on language headers, geo-spotting, round-robin or other means]
> Open Source projects of course would be listed on the main components
> list. At such time where enough vendors get visible enough or provide
> enough utility in their components so as to warrant further exposure, a
> separate list similar to Debian's (I keep bringing it up don't I...)
> non-free could be set up; Once again, this does not disrupt anyone
> else. On the same token, the lists could be split if they grew too large.
Yes.
> You end up with much less control over the pool but the pool is much
> larger. Sometimes the key to success is making sure you include
> everyone. Other times, it's just making sure people get out of each
> others' way.
Yes, I see your point very clearly, but my point is: let's follow darwin.
I'm *very* afraid of building something without having a touch of
reality. I want to start with one library of blocks and if this doesn't
scale with the amount of blocks we end up having (that is a dream,
actually, we are not a 8Gb linux distribution!) we'll think about how to
fix that.
> For the time being, the "sources.list" would only have one URL:
> http://cocoon.apache.org/components/ (or whatever the path turns out to
> be) and would be no different than what you proposed.
Let's do it the other way around: let's start from cocoon.apache.org and
if we can't scale, we'll think about how to fix that, ok?
I perfectly see your point, but I think we should avoid designing and
implementing stuff just because there are parallels in other areas.
Design by parallelism is a very subdle anti-pattern.
And for your commercially-friendly concern, I don't think that any
company will ever do block deployment out of dynamic discovery anyway.
And if they want to do it, I'd suggest we talk about that when the issue
emerges.
What do you think?
--
Stefano Mazzocchi <st...@apache.org>
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Miles Elam <mi...@pcextremist.com>.
Stefano Mazzocchi wrote:
> I'm in a hurry now (going to the london gettogether right after this,
> All Bar One on Regents Street, London if anybody else wants to show
> up) but I will reply in full detail tomorrow.
No problem. Have fun! I wish I wasn't eight time zones away from you
or I'd join in on the sharing of pints.
> By now just a hint: when we'll have cocoon.apache.org, we'll have our
> own 'uber library' of blocks for block discovery.
>
> The idea is simple:
>
> 1) I give you the block behavior
> 2) you give me a list of blocks that implement this behavior and the
> location where I can download them
>
> Nice simple, effective and implemented with a simple POST request and
> XML response.
>
> What do you think?
That works for storage issues and for getting newest versions, but it is
a single point of failure and leaves out one major group: commercial
vendors. I love free (libre) software, but commercial software exists,
some of it is good, and if they have a revenue stream they can be
terribly prolific with code production.
Lets say a vendor (correctly) recognizes Cocoon as a truly innovative
product and sees a niche for itself for creating custom components for
it. If their product costs money (which it almost certainly will in
this scenario), they don't want people to be able to automatically
download their products without payment. If and when Cocoon really
takes off, the sheer number of component producers -- commercial and
open source -- would surely either (a) overwhelm the component
maintainer on components.cocoon.apache.org (or whatever the hostname) or
(b) become so large and unweildy a list with so many competing products
so as to be much less usable by the Cocoon user.
On the other hand, if you have an equivalent of Debian's "sources.list"
-- a list of all of your possible download points -- you can easily
add/remove access points as needed, allow for failover to alternate
servers, allow for multiple types of sources (think stable versus beta
versus bleeding edge), makes sure that people always have the most
recent version in case of slow rsync to mirrors, and finally it would
allow a vendor to bundle their services with a Cocoon package.
Cocoon won't go as far without local dealer support. Most of the time,
end users won't be downloading Cocoon, Tomcat, et al and setting up
their own box. Most of the time, they call local consultants, have them
make offers, choose the one they like the best, and have them set it up.
If those vendors can just add themselves to a list in their custom
Cocoon package, they do not disrupt the community with highly
specialized components, and vendors have an "added value" (*ugh*
sometimes I really hate marketing-speak) they can tout to their
customers. In other words, they'll have a greater incentive to help
propogate Cocoon to others.
Open Source projects of course would be listed on the main components
list. At such time where enough vendors get visible enough or provide
enough utility in their components so as to warrant further exposure, a
separate list similar to Debian's (I keep bringing it up don't I...)
non-free could be set up; Once again, this does not disrupt anyone
else. On the same token, the lists could be split if they grew too large.
You end up with much less control over the pool but the pool is much
larger. Sometimes the key to success is making sure you include
everyone. Other times, it's just making sure people get out of each
others' way.
For the time being, the "sources.list" would only have one URL:
http://cocoon.apache.org/components/ (or whatever the path turns out to
be) and would be no different than what you proposed.
Thoughts?
- Miles
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Stefano Mazzocchi <st...@apache.org>.
Miles Elam wrote:
> With regard to block deployment and its similarity to general package
> management systems (deb, rpm, msi, etc.), should there be any discussion
> about central repositories a la Debian's stable, testing, and unstable?
>
> A self-contained unit of code (component, package, whatever) is great,
> but there's something to be said for:
>
> apt-get install foo
>
> It is so convenient in fact that many people used Debian or Debian-based
> distributions solely as a way to avoid the hunt you used to do for rpm
> files.
>
> How does a user find a package that does SVG if they've never heard of
> Batik? They know that they want to use SVG and serialize, but then they
> must go to a web site, find the list of COBs, read the docs on each one,
> and download the appropriate one? Are we expecting people to do a
> google search but with a site:cocoondev.apache.org modifier (which of
> course assumes they know to constrain the search there)?
>
> My question is how should block directories and discovery be handled? I
> guess it could be considered an implementation detail, but I think it
> should be brewing on the back burner in peoples' mind at least. Having
> useful repositories requires more forethought than just a download
> directory.
>
> Thoughts?
I'm in a hurry now (going to the london gettogether right after this,
All Bar One on Regents Street, London if anybody else wants to show up)
but I will reply in full detail tomorrow.
By now just a hint: when we'll have cocoon.apache.org, we'll have our
own 'uber library' of blocks for block discovery.
The idea is simple:
1) I give you the block behavior
2) you give me a list of blocks that implement this behavior and the
location where I can download them
Nice simple, effective and implemented with a simple POST request and
XML response.
What do you think?
--
Stefano Mazzocchi <st...@apache.org>
--------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [design] Cocoon Blocks 1.1
Posted by Miles Elam <mi...@geekspeak.org>.
With regard to block deployment and its similarity to general package
management systems (deb, rpm, msi, etc.), should there be any discussion
about central repositories a la Debian's stable, testing, and unstable?
A self-contained unit of code (component, package, whatever) is great,
but there's something to be said for:
apt-get install foo
It is so convenient in fact that many people used Debian or Debian-based
distributions solely as a way to avoid the hunt you used to do for rpm
files.
How does a user find a package that does SVG if they've never heard of
Batik? They know that they want to use SVG and serialize, but then they
must go to a web site, find the list of COBs, read the docs on each one,
and download the appropriate one? Are we expecting people to do a
google search but with a site:cocoondev.apache.org modifier (which of
course assumes they know to constrain the search there)?
My question is how should block directories and discovery be handled? I
guess it could be considered an implementation detail, but I think it
should be brewing on the back burner in peoples' mind at least. Having
useful repositories requires more forethought than just a download
directory.
Thoughts?
- Miles
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [design] Cocoon Blocks 1.1
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Hi,
damn I just have time to print out your email, Stefano, before I have
to leave to Munic to promote Cocoon on the W-JAX (http://www.w-jax.de).
So, I can't reply on this before thursday :( when I get online again...
But the good thing is, I can think about it (again) for some days
and you know from last week what this means ;)
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org