cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: Playing with Cocoon 2
Date Tue, 04 Apr 2000 12:45:20 GMT
Donald Ball wrote:
> 
> On Tue, 4 Apr 2000, Ross Burton wrote:
> 
> > Anyway, back to the point of this.  I managed to get my own generator
> > running which displays the page "<status></status>", which is a start.
 I
> > then hunted through the component manager interfaces but could not find
> > anything to get an enumeration over all of the loaded components.  Is there
> > a method I am missing totally or shall I add it and mail the patches?
> 
> I'm running into a similar problem with my XIncludeFilter. How do I get a
> reference to the sitemap's parser (so I don't hard code xerces in)? If
> Filters or SitemapComponents had access to the ComponentManager object,
> I'd be set, but they don't. 

???

They don't if you don't want them to do.

I know it's not easy to see it, but Cocoon2 incorporates many of the
Avalon ideas for componentized and polymorphic frameworks.... that
means:

 "if you want something, add the interface that provides you that
service"

This is:

Components do _NOT_ have access to other components. They are
components, they are passive so they are _used_! They MUST NOT access
any other component.

On the other hand, it's perfectly normal that components need access to
other components. For this reason you do

 XIncludeFilter implements Component, Composer

Composers are things that "compose" themselves with other components.
The component and composer behaviors are orthogonal. Each one can be
present without the other.

So, look at XalanFilter, for an example of how this is done.

> Would it be better to add a
> setComponentManager method to Filter, add it to SitemapComponent, add it
> as a fifth argument to the SitemapComponent setup method, or something
> else entirely?

:) do you know how much time Federico, Pierpaolo and I spent polishing
those interfaces?

I don't say they are perfect (no, no possible way), but they are _MUCH_
more solid than they appear to be.

I warn all of you: if you thought Cocoon 1.x was well designed, well
Cocoon2 will be *addictive*... everything you'll do in the future on the
server side will need be based on those interfaces or it will not be
beautiful enough for you to work with.

Welcome to the world of viral programming memes :)
 
> For your problem, I'd reckon that ComponentManager oughta be enhanced with
> a
> 
> Enumeration getComponentNames()
> 
> method.

We thought about this and decided to leave it out for security
reasons... but this is a case for Avalon blocks, might not be the case
for internal components... hmmmmm

Pier, what do you say?

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message