Re: [RT] Component manager, classloader and blocks

2003-10-12 Thread Stefano Mazzocchi
On Sunday, Oct 12, 2003, at 12:21 Europe/Rome, Stephan Michels wrote:



On Fri, 10 Oct 2003, Stefano Mazzocchi wrote:

On Friday, Oct 10, 2003, at 13:22 Europe/Rome, Stephan Michels wrote:

To prevent component name collisions within, we could use prefixes 
like

 
  
  
  
name collision of what? you define the names of the components. those
are the prefixes already, the classes are the real names of the
components and they are already fully qualified to avoid collisions.
Okay, I think you mean, (for example) if you want to use a generator 
from
block 'basic', you can write easly

myblock:sitemap.xmap:

 
  
But in this case you doesn't gain anything more than from avalon block.
I want to share these components by the @type insteadof the class name.
For example virtual components can only be shared with @name/@type
names.
Now, if you a block, which depends on block, which shares
components with the same type, you will have conflict.
One possible solution is to use prefixes, which allow to map names
to block IDs.
hmm, I don't think these conflicts are a problem since it's *you* that 
name the components with hints, not the block that exposes them.

For the classes and libs itself, I think separate them into public
and private isn't necessary for the first step.
Either we do this right away or it's going to be painful later on. I
would be against such an half-step (also because classloading
complexity isn't that much different with the two paths)
Here we do have different opinions. I'm curious about the opinions
from the others.
One question, separate the avalon block the classes into 
public/private?

Stephan.



--
Stefano.


Re: [RT] Component manager, classloader and blocks

2003-10-12 Thread Stephan Michels


On Fri, 10 Oct 2003, Stefano Mazzocchi wrote:

>
> On Friday, Oct 10, 2003, at 13:22 Europe/Rome, Stephan Michels wrote:
>
> > To prevent component name collisions within, we could use prefixes like
> >
> >   >   
> >   
> >   
> >   
>
> name collision of what? you define the names of the components. those
> are the prefixes already, the classes are the real names of the
> components and they are already fully qualified to avoid collisions.

Okay, I think you mean, (for example) if you want to use a generator from
block 'basic', you can write easly

myblock:sitemap.xmap:

 
  

But in this case you doesn't gain anything more than from avalon block.
I want to share these components by the @type insteadof the class name.

For example virtual components can only be shared with @name/@type
names.

Now, if you a block, which depends on block, which shares
components with the same type, you will have conflict.

One possible solution is to use prefixes, which allow to map names
to block IDs.

> > For the classes and libs itself, I think separate them into public
> > and private isn't necessary for the first step.
>
> Either we do this right away or it's going to be painful later on. I
> would be against such an half-step (also because classloading
> complexity isn't that much different with the two paths)

Here we do have different opinions. I'm curious about the opinions
from the others.

One question, separate the avalon block the classes into public/private?

Stephan.



Re: [RT] Component manager, classloader and blocks

2003-10-10 Thread Stefano Mazzocchi
On Friday, Oct 10, 2003, at 13:22 Europe/Rome, Stephan Michels wrote:

Hi,

Since some days I thought about how implement blocks with smallest
amount of work. (small ist beautiful)
Most of the work is already finished, if we look into the 'unreal'
block in the CVS repository. We have
a classes, libs, a sitemap, a xconf file and some custom files.
We could easily pack them into a zip file.
yes

What need:

For every block we need
* a block URI, which identifies it.
yes

* statements about dependecies to other blocks.
yes

* Component manager, for a separate cocoon.xconf
well, not sure about this.

* Sitemap proccessor for the root sitemap of the block
yes

* A classloader for each block, which were exchange if the
  the block has changed.
Sylvain has an idea on how we can do transparent classloading directly 
with a chain on component managers. Sylvain?

The simplest form to include the information about the block
URI and the dependencies is to use the sitemap for it, for example
http://apache.org/cocoon/sitemap/1.0";>
 http://apache.org/cocoon/block/myblock/1.0";>
  http://apache.org/cocoon/block/basic/1.0"/>
 
-1

a block needs a descriptor that contains metadata for the librarian.

For the sitemap components we need two component manager for
handling the 'public' and 'private' components.
 +---++---+
 | myblock   || basic |
 | +---+ | lookup | +---+ |
 | | public cm |-++>| public cm | |
 | +---+ || +---+ |
 |  ^||  ^|
 |  | lookup ||  | lookup |
 |  |||  ||
 | +---+ || +---+ |
 | | private cm| || | private cm| |
 | +---+ || +---+ |
 |  ^||  ^|
 |  | lookup ||  | lookup |
 |  |||  ||
 | +--+  || +---+ |
 | | sitemap  |  || | sitemap   | |
 | +--+  || +---+ |
 |   ||   |
 +---++---+
sounds resonable.

Another difficult part is about the dependecies of the CMs between
subsitemaps (I doesn't have a solution). I think subsitemaps
are a contrary solution to blocks, perhaps we should rethink the
subsitemaps.
I don't see this, nor I see a problem with subsitemaps, they'd simply 
cascade back to the parent sitemap as they normally do.

To prevent component name collisions within, we could use prefixes like

 
  
  
  
name collision of what? you define the names of the components. those 
are the prefixes already, the classes are the real names of the 
components and they are already fully qualified to avoid collisions.

If there is no name collision, you can leave out the prefix.
The problem is that the current CM model doesn't support
such a kind of prefix, but it doesn't need to, because
the sitemap processor can resolve the prefix, and know
which CM to ask for.
I can't see the problem.

For the classes and libs itself, I think separate them into public
and private isn't necessary for the first step.
Either we do this right away or it's going to be painful later on. I 
would be against such an half-step (also because classloading 
complexity isn't that much different with the two paths)

A cheap solution is use following FS within a zip file:

myblock.zip
 /COB_INF/classes
 /COB-INF/lib
 /COB-INF/componts.xconf
 /sitemap.xmap
 /[whatever]
Every block get his own classloader, and if the block has changes
the classloader will be exchanged. Each depending block has
a parent classloader, which will be consulted if the current
classloader doesn't know the class.
Yes but keep in mind that classloading and component management must go 
hand in hand.

--
Stefano.


[RT] Component manager, classloader and blocks

2003-10-10 Thread Stephan Michels
Hi,

Since some days I thought about how implement blocks with smallest
amount of work. (small ist beautiful)

Most of the work is already finished, if we look into the 'unreal'
block in the CVS repository. We have
a classes, libs, a sitemap, a xconf file and some custom files.
We could easily pack them into a zip file.

What need:

For every block we need
* a block URI, which identifies it.
* statements about dependecies to other blocks.
* Component manager, for a separate cocoon.xconf
* Sitemap proccessor for the root sitemap of the block
* A classloader for each block, which were exchange if the
  the block has changed.

The simplest form to include the information about the block
URI and the dependencies is to use the sitemap for it, for example

http://apache.org/cocoon/sitemap/1.0";>
 http://apache.org/cocoon/block/myblock/1.0";>
  http://apache.org/cocoon/block/basic/1.0"/>
 

For the sitemap components we need two component manager for
handling the 'public' and 'private' components.

 +---++---+
 | myblock   || basic |
 | +---+ | lookup | +---+ |
 | | public cm |-++>| public cm | |
 | +---+ || +---+ |
 |  ^||  ^|
 |  | lookup ||  | lookup |
 |  |||  ||
 | +---+ || +---+ |
 | | private cm| || | private cm| |
 | +---+ || +---+ |
 |  ^||  ^|
 |  | lookup ||  | lookup |
 |  |||  ||
 | +--+  || +---+ |
 | | sitemap  |  || | sitemap   | |
 | +--+  || +---+ |
 |   ||   |
 +---++---+

Another difficult part is about the dependecies of the CMs between
subsitemaps (I doesn't have a solution). I think subsitemaps
are a contrary solution to blocks, perhaps we should rethink the
subsitemaps.

To prevent component name collisions within, we could use prefixes like

 
  
  
  

If there is no name collision, you can leave out the prefix.
The problem is that the current CM model doesn't support
such a kind of prefix, but it doesn't need to, because
the sitemap processor can resolve the prefix, and know
which CM to ask for.


For the classes and libs itself, I think separate them into public
and private isn't necessary for the first step.
A cheap solution is use following FS within a zip file:

myblock.zip
 /COB_INF/classes
 /COB-INF/lib
 /COB-INF/componts.xconf
 /sitemap.xmap
 /[whatever]

Every block get his own classloader, and if the block has changes
the classloader will be exchanged. Each depending block has
a parent classloader, which will be consulted if the current
classloader doesn't know the class.


My unsorted braindump, Stephan.

> cat /dev/brain | grep "blocks" | mail [EMAIL PROTECTED]

___
 Stephan Michels   EMail: [EMAIL PROTECTED]
 ICQ: 115535699Tel: +49-030-314-21583
+|+|+|+|+|+|+|-|