You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Daniel Fagerstrom <da...@nada.kth.se> on 2006/05/01 11:05:32 UTC

[RT] Simplifying setup

People, I'm fed up with the sickening complicated setup sequence in 
Cocoon. Much of the complication is related to setting up the component 
manager and general over componentization.

I'd like to remove the component container setup from the concern area 
of Cocoon. The component container should instead be setup by the 
servlet container using a ServletContextListener and made available to 
the Cocoon main servlet through a servlet context attribute (the details 
will be slightly different in the blocks context).

Furthermore the setup contains a number of classes and components with 
fairly overlapping and fuzzy concern areas: The CocoonServlet creates a 
CoreUtil which creates a CocoonBeanFactory which in turn is used to get 
the Cocoon component, which in turn delegates most of it job to the 
SitemapLanguage which also is a component that is managed by the 
CocoonBeanFactory. A fun exercise for the interested is to try to figure 
out how and where the Cocoon component is configured and created.

Now, I don't see any reason at all for Cocoon and SitemapLanguage to be 
managed components, it just complicates everything. And for the Cocoon 
component there is not much use anymore. Its responsibilities are rather 
vague. I suggest that we just move whatever useful thing it might do, to 
the main servlet and use Servlet instead of Processor as top level 
interface (as discussed before, so many sitemap internal details has 
been added to Processor that it is not useful as an abstraction anymore 
anyway).

For the Cocoon main servlet I suggest that we start from the 
SitemapServlet 
http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java, 
and modify it so that it gets the bean container from a servlet context 
attribute instead of being injected. Also the sitemap path (for non 
default valiues) could be taken from servlet config init parameter 
instead of the current mechanism.

The SitemapServlet is rather minimal so some functionality from the 
Cocoon component and the CocoonServlet could be moved to it. But I think 
we should strive to keep it minimal. More advanced functionality like 
multi part mime handling could preferably be moved to servlet filters.

The suggested architecture will make it much easier to maintain and 
understand Cocoon, and will also make it simpler to reuse and to add new 
controllers to (a Flowscript controller or a RoR inspired convention 
controller e.g.). The CLI and Portlet environment will need some 
refactoring if we follow the above path. But the CLI need some work 
anyway and for the Portlet environment I would guess that getting closer 
to the servlet standards just should simplify things.

WDYT?

/Daniel

Re: [RT] Simplifying setup

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Carsten Ziegeler skrev:
> Daniel Fagerstrom wrote:
>
>   
>> It will mean some changes for the portal block as it use the Cocoon 
>> component and the same complicated setup as the the CocoonServlet. 
>> Geting a component container that is setup by a servlet context listener 
>> through the portlet context should work fine a simplify the portlet 
>> setup as well.
>>     
> I guess you're refering to the portlet environment itself (using Cocoon
> as a portlet). The portal itself should not be affected by this.
>   
Exactly.

/Daniel


Re: [RT] Simplifying setup

Posted by Carsten Ziegeler <cz...@apache.org>.
Daniel Fagerstrom wrote:

> It will mean some changes for the portal block as it use the Cocoon 
> component and the same complicated setup as the the CocoonServlet. 
> Geting a component container that is setup by a servlet context listener 
> through the portlet context should work fine a simplify the portlet 
> setup as well.
I guess you're refering to the portlet environment itself (using Cocoon
as a portlet). The portal itself should not be affected by this.

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: [RT] Simplifying setup

Posted by Reinhard Poetz <re...@apache.org>.
I understand that you guys are frustrated that you can't use trunk in production 
or even try to migrate your existing apps. I (and I think Daniel too) feel 
frustrated because whenever we make some progress and tell the list about it, 
somebody is complaining about this or that (look at the subject of this 
thread!!!). Of course, it's everybody's right to express his thoughts and 
feelings, but this kind of reaction is not what we expect.

As being said several times Daniel and I know what's to do and we work 
continiously on it. That might be too slow for some of us (including Daniel and 
me!), but that's the best thing we can offer. Additionally I want to point out 
(again), that our work on the OSGi integration is completly _orthogonal_ to the 
thing that we call Cocoon and you don't have to dig into stuff you don't 
understand just to get something done in trunk. A couple of weeks I wrote a 
Maven plugin that extracts blocks into a Cocoon webapp, which was a first step 
into the direction to get trunk working again.

Reinhard

Ralph Goers wrote:
> Thanks, Upayavira.  Your response is better than what I would have written
> myself.
> 
> In addition, I have quite a bit of frustration that it doesn't seem (from
> my perspective) that it is all that important to those who do have the
> time to try to get a release of trunk out.  It would make it far easier
> for me to recommend moving to 2.2, and this be given the time at work, if
> a release was in sight.  As it is I expect there to be several milestone
> releases before a 2.2.0 is released.  I pushed hard for a 2.1.9 release
> primarily because my project at work is on a deadline and I needed all the
> latest portal patches.  I am currently adding enhancements to the 2.1.9
> base even though I know Carsten has already added similar functionality in
> trunk.  Believe me, I'd much rather just use those, but given the way
> things are I really don't have a choice.
> 
> Ralph
> 
> 
> Upayavira said:
> 
>>Reinhard Poetz wrote:
>>
>>>Ralph Goers wrote:
>>>
>>>
>>>>I also get paid to do real work.  OSGi doesn't fit in those plans.  A
>>>>lot of other stuff in trunk does but I can't have it because a release
>>>>of trunk isn't going to happen in 2006.  My employer won't pay me to
>>>>work on stuff that they won't see in the next few months.  And there
>>>>is enough stuff in 2.1 that needs fixing to keep me busy for a long
>>>>time.
>>>
>>>What exactly is stopping you from working on trunk to make the release
>>>happen?
>>
>>People differ in terms of their freedom to work. Some people are
>>fortunate in that they have free time that they can contribute to
>>projects they believe in. Others aren't.
>>
>>I myself have a young family, with another on the way, which pretty
>>effectively fills my non-work time. So, the only way I can get to work
>>on projects is to persuade my boss that it is a good idea, and do it on
>>work time.
>>
>>And of course bosses tend not to favour their employees working on
>>speculative projects that _may_ give results, unless that is directly
>>related to the nature of their business.
>>
>>I personally have had the opportunity to introduce Cocoon into my
>>current workplace, but, due to the additional complexity it would have
>>brought to play, have not been able to justify it. Thus, I have not been
>>in a position to contribute to Cocoon in terms of code for quite some
>>time.
>>
>>Personally, I am grateful that you and Daniel are free to do the work
>>that you are doing. If you get a sense of frustration from Ralph,
>>perhaps you can read that as the frustration that he himself doesn't
>>have the kind of free time to give to it that you do.
>>
>>For Ralph to be able to contribute, he needs to be able to justify it.
>>If you could help him justify it, he may help sooner. Otherwise, he'll
>>just carry on waiting. Either, in the end, is just going to have to be
>>fine.
>>
>>But then, surely all of the above is obvious, no?

		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Re: [RT] Simplifying setup

Posted by Ralph Goers <Ra...@dslextreme.com>.
Thanks, Upayavira.  Your response is better than what I would have written
myself.

In addition, I have quite a bit of frustration that it doesn't seem (from
my perspective) that it is all that important to those who do have the
time to try to get a release of trunk out.  It would make it far easier
for me to recommend moving to 2.2, and this be given the time at work, if
a release was in sight.  As it is I expect there to be several milestone
releases before a 2.2.0 is released.  I pushed hard for a 2.1.9 release
primarily because my project at work is on a deadline and I needed all the
latest portal patches.  I am currently adding enhancements to the 2.1.9
base even though I know Carsten has already added similar functionality in
trunk.  Believe me, I'd much rather just use those, but given the way
things are I really don't have a choice.

Ralph


Upayavira said:
> Reinhard Poetz wrote:
>> Ralph Goers wrote:
>>
>>> I also get paid to do real work.  OSGi doesn't fit in those plans.  A
>>> lot of other stuff in trunk does but I can't have it because a release
>>> of trunk isn't going to happen in 2006.  My employer won't pay me to
>>> work on stuff that they won't see in the next few months.  And there
>>> is enough stuff in 2.1 that needs fixing to keep me busy for a long
>>> time.
>>
>> What exactly is stopping you from working on trunk to make the release
>> happen?
>
> People differ in terms of their freedom to work. Some people are
> fortunate in that they have free time that they can contribute to
> projects they believe in. Others aren't.
>
> I myself have a young family, with another on the way, which pretty
> effectively fills my non-work time. So, the only way I can get to work
> on projects is to persuade my boss that it is a good idea, and do it on
> work time.
>
> And of course bosses tend not to favour their employees working on
> speculative projects that _may_ give results, unless that is directly
> related to the nature of their business.
>
> I personally have had the opportunity to introduce Cocoon into my
> current workplace, but, due to the additional complexity it would have
> brought to play, have not been able to justify it. Thus, I have not been
> in a position to contribute to Cocoon in terms of code for quite some
> time.
>
> Personally, I am grateful that you and Daniel are free to do the work
> that you are doing. If you get a sense of frustration from Ralph,
> perhaps you can read that as the frustration that he himself doesn't
> have the kind of free time to give to it that you do.
>
> For Ralph to be able to contribute, he needs to be able to justify it.
> If you could help him justify it, he may help sooner. Otherwise, he'll
> just carry on waiting. Either, in the end, is just going to have to be
> fine.
>
> But then, surely all of the above is obvious, no?
>
> Regards, Upayavira
>


Re: [RT] Simplifying setup

Posted by Upayavira <uv...@odoko.co.uk>.
Reinhard Poetz wrote:
> Ralph Goers wrote:
> 
>> I also get paid to do real work.  OSGi doesn't fit in those plans.  A
>> lot of other stuff in trunk does but I can't have it because a release
>> of trunk isn't going to happen in 2006.  My employer won't pay me to
>> work on stuff that they won't see in the next few months.  And there
>> is enough stuff in 2.1 that needs fixing to keep me busy for a long time.
> 
> What exactly is stopping you from working on trunk to make the release
> happen?

People differ in terms of their freedom to work. Some people are
fortunate in that they have free time that they can contribute to
projects they believe in. Others aren't.

I myself have a young family, with another on the way, which pretty
effectively fills my non-work time. So, the only way I can get to work
on projects is to persuade my boss that it is a good idea, and do it on
work time.

And of course bosses tend not to favour their employees working on
speculative projects that _may_ give results, unless that is directly
related to the nature of their business.

I personally have had the opportunity to introduce Cocoon into my
current workplace, but, due to the additional complexity it would have
brought to play, have not been able to justify it. Thus, I have not been
in a position to contribute to Cocoon in terms of code for quite some time.

Personally, I am grateful that you and Daniel are free to do the work
that you are doing. If you get a sense of frustration from Ralph,
perhaps you can read that as the frustration that he himself doesn't
have the kind of free time to give to it that you do.

For Ralph to be able to contribute, he needs to be able to justify it.
If you could help him justify it, he may help sooner. Otherwise, he'll
just carry on waiting. Either, in the end, is just going to have to be fine.

But then, surely all of the above is obvious, no?

Regards, Upayavira

Re: [RT] Simplifying setup

Posted by Reinhard Poetz <re...@apache.org>.
Ralph Goers wrote:

> I also get paid to do real work.  OSGi doesn't fit in those plans.  A 
> lot of other stuff in trunk does but I can't have it because a release 
> of trunk isn't going to happen in 2006.  My employer won't pay me to 
> work on stuff that they won't see in the next few months.  And there is 
> enough stuff in 2.1 that needs fixing to keep me busy for a long time.

What exactly is stopping you from working on trunk to make the release happen?

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

	

	
		
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

Re: [RT] Simplifying setup

Posted by Upayavira <uv...@odoko.co.uk>.
Ralph Goers wrote:

<big-snip/>
>> Daniel's proposal was about making this process simpler and this has
>> *nothing* to do with OSGi. Daniel and I believe that OSGi is the way
>> to go but this doesn't necessarily mean that everything we do is
>> OSGi-related. As we had to understand Cocoon internals in greater
>> detail, we started to think more and more about how to simplify
>> things, and believe me, there is room for improvment as the core of
>> Cocoon has grown and got too complicated over the years.
> Well, I apologize for not knowing enough about trunk to understand that
> that is how it all works now. However, I'd still like to see an example
> of how configuring via a servlet filter will make the configuration
> simpler.  Or does it just make the code simpler?

Makes the code more 'normative'? Just doing things the same way as has
become a convention in more recent times? Which makes the code more
accessible to folks that have been exposed to such approaches, which is
an increasing number of people. That's how I read it.

Regards, Upayavira

Re: [RT] Simplifying setup

Posted by Ralph Goers <Ra...@dslextreme.com>.
Reinhard Poetz wrote:
>
> Ralph,
>
> I can't follow your argumentation anymore. How do the following 
> statements fit together?
>
> "Please provide an example of what this would look like. I really need to
> understand how this will simplify anything."
>
> and
>
> "And I don't see much point in learning how trunk works until it 
> stabilizes."
This is pretty simple. I'm tired of long  emails about theoretical 
topics.  I frankly can't understand what the heck you guys are talking 
about half the time because I never see any concrete examples in the 
emails.  I just can't give an honest to goodness answer as to whether 
this is a good thing or not without something I can wrap my arms 
around.  And looking at trunk to figure it out doesn't seem to be a 
productive way to do it as I have come to believe that trunk is never 
going to be released.  (This is my opinion - you certainly don't have to 
agree with it or like it).
>
>
> ... so what do you want? Daniel and I spend our spare time on 
> improving trunk and this takes time as nobody is paying us directly 
> for this because we do it in our spare time. We have a clear goal and 
> we communicated it dozens of times to the list and added all open 
> tasks to JIRA.
> If this is too slow or insufficent for your needs, you need to get 
> involved by getting your hands dirty. You're complaining that things 
> in trunk don't work as they should? Hey, that's your chance! I don't 
> think that it's rocket science to improve things.
I also get paid to do real work.  OSGi doesn't fit in those plans.  A 
lot of other stuff in trunk does but I can't have it because a release 
of trunk isn't going to happen in 2006.  My employer won't pay me to 
work on stuff that they won't see in the next few months.  And there is 
enough stuff in 2.1 that needs fixing to keep me busy for a long time.
>
>                                      - o -
>
> *If* you had took the time to learn a bit more about the architecture 
> that Daniel is proposing, you would learn that our work on OSGi isn't 
> affecting the non-OSGi-Cocoon in any way. Look at the current way of 
> setting up Cocoon:
>
> "[...] The CocoonServlet creates a CoreUtil which creates a 
> CocoonBeanFactory which in turn is used to get the Cocoon component, 
> which in turn delegates most of it job to the SitemapLanguage which 
> also is a component that is managed by the CocoonBeanFactory. A fun 
> exercise for the interested is to try to figure out how and where the 
> Cocoon component is configured and created. [...]"
>
> Daniel's proposal was about making this process simpler and this has 
> *nothing* to do with OSGi. Daniel and I believe that OSGi is the way 
> to go but this doesn't necessarily mean that everything we do is 
> OSGi-related. As we had to understand Cocoon internals in greater 
> detail, we started to think more and more about how to simplify 
> things, and believe me, there is room for improvment as the core of 
> Cocoon has grown and got too complicated over the years.
Well, I apologize for not knowing enough about trunk to understand that 
that is how it all works now. However, I'd still like to see an example 
of how configuring via a servlet filter will make the configuration 
simpler.  Or does it just make the code simpler?

Ralph

Re: [RT] Simplifying setup

Posted by Reinhard Poetz <re...@apache.org>.
Ralph Goers wrote:
> 
> 
> Daniel Fagerstrom said:
> 
>>Carsten Ziegeler skrev:
>>
>>>Daniel Fagerstrom wrote:
>>>
>>>><snip rt/>
>>>
>>>I'm mostly fine with your proposed changes if you think that this helps
>>>Cocoon. In the end all changes that don't require to rewrite or change
>>>our current blocks are fine for me.
>>
>>It will mean some changes for the portal block as it use the Cocoon
>>component and the same complicated setup as the the CocoonServlet.
>>Geting a component container that is setup by a servlet context listener
>>through the portlet context should work fine a simplify the portlet
>>setup as well.
> 
> 
> Please provide an example of what this would look like.  I really need to
> understand how this will simplify anything.
> 
> 
>>>But I'm remaining very sceptical wrt to a 2.2 release in general. I
>>>think one of our main goals is currently out of focus: release early,
>>>release often. This has nothing to do with this RT specifically, I just
>>>wanted to use this thread as a reminder to focus on a release :)
>>
>>My personal goal is to release a blocks based Cocoon. But if anyone want
>>to release something from trunk earlier, I'm fine with that. I just
>>don't see any activity in that direction.
> 
> 
> While true, it is unfortunate.  Switching to Maven 2 for building projects
> is a lot less scary than switching from 2.1 to an OSGi based system. That
> doesn't make it bad, but it may make the resistance to adopt it high.  I
> believe that is why it was recommended at the gettogether that the focus
> be on delivering trunk with Maven 2 by the end of the year and then
> focusing on "real blocks".   At least, that is what I remember hearing.
> 
> 
>>The important differences between 2.1 and trunk is in the cocoon-core,
>>and as long as it is as complicated as it is today, only a few people
>>understand it well enough to be able to work on it. So refactorings that
>>make the core easier to understand and less monolithic will make it
>>easier for more people to get involved, which IMO should increase the
>>chance for a release.
> 
> 
> For me, this remains to be seen.  Moving stuff from cocoon's core to OSGi
> doesn't make it any less complicated. It just makes it a different set of
> things to understand.  And unless you are getting rid of caching,
> pipelines, etc. there is still a lot of Cocoon specific stuff to
> understand.
> 
> Frankly, if trunk was completely working with Maven 2 I'd be all over it
> trying to get it into production. But since it has been in sandbox mode
> for so long, I've focused completely on 2.1 as that is what my employer
> will be using until trunk gets in a mode where I trust it.  And I don't
> see much point in learning how trunk works until it stabilizes.

Ralph,

I can't follow your argumentation anymore. How do the following statements fit 
together?

"Please provide an example of what this would look like. I really need to
understand how this will simplify anything."

and

"And I don't see much point in learning how trunk works until it stabilizes."


... so what do you want? Daniel and I spend our spare time on improving trunk 
and this takes time as nobody is paying us directly for this because we do it in 
our spare time. We have a clear goal and we communicated it dozens of times to 
the list and added all open tasks to JIRA.
If this is too slow or insufficent for your needs, you need to get involved by 
getting your hands dirty. You're complaining that things in trunk don't work as 
they should? Hey, that's your chance! I don't think that it's rocket science to 
improve things.

                                      - o -

*If* you had took the time to learn a bit more about the architecture that 
Daniel is proposing, you would learn that our work on OSGi isn't affecting the 
non-OSGi-Cocoon in any way. Look at the current way of setting up Cocoon:

"[...] The CocoonServlet creates a CoreUtil which creates a CocoonBeanFactory 
which in turn is used to get the Cocoon component, which in turn delegates most 
of it job to the SitemapLanguage which also is a component that is managed by 
the CocoonBeanFactory. A fun exercise for the interested is to try to figure out 
how and where the Cocoon component is configured and created. [...]"

Daniel's proposal was about making this process simpler and this has *nothing* 
to do with OSGi. Daniel and I believe that OSGi is the way to go but this 
doesn't necessarily mean that everything we do is OSGi-related. As we had to 
understand Cocoon internals in greater detail, we started to think more and more 
about how to simplify things, and believe me, there is room for improvment as 
the core of Cocoon has grown and got too complicated over the years.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

	

	
		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Re: [RT] Simplifying setup

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Ralph Goers skrev:
> Thanks for the link Daniel.  I took a look at it and reread your original
> email.  Parts of it I think are good ideas but I have one major concern. 
> I think it is a bad idea to architect things such that the CocoonServlet
> will not run unless some ServletContextListener has previously run.
> However, I have no problem at all with allowing for
> ServletContextListeners to override or extend default behaviors though.

Carsten has already implemented it so that a Spring container that is 
made available from a servlet context listener will be used as a parent 
container.

> I've been working a lot with Jetspeed lately. It uses Spring for darn near
> everything. However, it doesn't seem to use the approach discussed below. 
> Rather, they just have an assembly directory with a whole bunch of
> configuration files.  It seems you can just add your own file to the
> directory to add whatever behaviors you want.  I guess I prefer that
> behavior over having to modify the web.xml (actually, I hate modifying the
> web.xml).

As long as you are happy with the default position of the main 
configuration the sole change will be:

<listener>
 
<listener-class>org.apache.cocoon.core.container.spring.ContextLoaderListener</listener-class>
</listener>

in the web.xml. And it will be part of the default web.xml so you will 
not need to write it yourself.

> As for getting rid of the Cocoon object and your other suggestions, I
> don't have any real concern there.  Actually, I'd prefer a main servlet
> that gets a Spring configuration and then just hands off control to a
> component configured there.  But that might make it all even harder to
> understand since it would then be very loosely coupled.

We basically have something like that today although it happens in two 
steps and part of the xml bean configuration is created programmatically.

I think component based design is great in many way, but in Cocoon we 
have taken it to far. Letting absolutely everything including the main 
controller being a managed component make the bootstrap really 
complicated. That is the situation we have today, and I want to simplify 
it by removing flexibility that no one uses.

/Daniel

Re: [RT] Simplifying setup

Posted by Ralph Goers <Ra...@dslextreme.com>.
Thanks for the link Daniel.  I took a look at it and reread your original
email.  Parts of it I think are good ideas but I have one major concern. 
I think it is a bad idea to architect things such that the CocoonServlet
will not run unless some ServletContextListener has previously run.
However, I have no problem at all with allowing for
ServletContextListeners to override or extend default behaviors though.

I've been working a lot with Jetspeed lately. It uses Spring for darn near
everything. However, it doesn't seem to use the approach discussed below. 
Rather, they just have an assembly directory with a whole bunch of
configuration files.  It seems you can just add your own file to the
directory to add whatever behaviors you want.  I guess I prefer that
behavior over having to modify the web.xml (actually, I hate modifying the
web.xml).

As for getting rid of the Cocoon object and your other suggestions, I
don't have any real concern there.  Actually, I'd prefer a main servlet
that gets a Spring configuration and then just hands off control to a
component configured there.  But that might make it all even harder to
understand since it would then be very loosely coupled.

Ralph





Daniel Fagerstrom said:
> Ralph Goers skrev:
>>
>>
>> Daniel Fagerstrom said:
>>> Carsten Ziegeler skrev:
>>>> Daniel Fagerstrom wrote:
>>>>> <snip rt/>
>>>> I'm mostly fine with your proposed changes if you think that this
>>>> helps
>>>> Cocoon. In the end all changes that don't require to rewrite or change
>>>> our current blocks are fine for me.
>>> It will mean some changes for the portal block as it use the Cocoon
>>> component and the same complicated setup as the the CocoonServlet.
>>> Geting a component container that is setup by a servlet context
>>> listener
>>> through the portlet context should work fine a simplify the portlet
>>> setup as well.
>>
>> Please provide an example of what this would look like.  I really need
>> to
>> understand how this will simplify anything.
>
> Here
> http://static.springframework.org/spring/docs/1.2.x/reference/webintegration.html#intro,
>
> you can see the standard way of integrating a Spring container in a web
> framework. I propose that we should do the same in Cocoon. That doesn't
> mean a simplification in itself, but the refactoring of the core that I
> propose mean that it will be much easier to follow what happen in Cocoon
> and thus taking part in development. It will also mean that it will be
> easier for people who want to build new things, like a RoR style
> controller or a flowscript controller to do that.
>
>               --- o0o ---
>
> For the rest of your mail Reinhard have already answered that.
>
> It is time for you to back up all your opinions with some actual coding
> on the trunk.
>
> /Daniel
>


Re: [RT] Simplifying setup

Posted by Giacomo Pati <gi...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 2 May 2006, Reinhard Poetz wrote:

> Date: Tue, 02 May 2006 10:15:41 +0200
> From: Reinhard Poetz <re...@apache.org>
> Reply-To: dev@cocoon.apache.org
> To: dev@cocoon.apache.org
> Subject: Re: [RT] Simplifying setup
> 
> Giacomo Pati wrote:
>
>> >  Here
>> >  http://static.springframework.org/spring/docs/1.2.x/reference/webintegration.html#intro, 
>> >  you can see the standard way of integrating a Spring container in a web
>>
>>
>>  Is that a proposal to directly use Spring (which I would suggest)?
>> 
>> >  framework. I propose that we should do the same in Cocoon. That doesn't
>>
>>
>>  Or do you think of using again something like "our own implementation of a
>>  component container" ?
>
> In trunk we've already switched to Spring as component container.

Yes, but IIRC not with it's standard inclusion as WebApplicationContext.

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEVxsULNdJvZjjVZARAlv+AKC+2Uim4apQ1o5CHw6KYwzQz6j7+wCg0ZCl
wDKPbOUEcPcYAnajIqn/Tdk=
=PQp9
-----END PGP SIGNATURE-----

Re: [RT] Simplifying setup

Posted by Reinhard Poetz <re...@apache.org>.
Giacomo Pati wrote:

>> Here
>> http://static.springframework.org/spring/docs/1.2.x/reference/webintegration.html#intro, 
>> you can see the standard way of integrating a Spring container in a web
> 
> 
> Is that a proposal to directly use Spring (which I would suggest)?
> 
>> framework. I propose that we should do the same in Cocoon. That doesn't
> 
> 
> Or do you think of using again something like "our own implementation of 
> a component container" ?

In trunk we've already switched to Spring as component container.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

		
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Re: [RT] Simplifying setup

Posted by Giacomo Pati <gi...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 2 May 2006, Carsten Ziegeler wrote:

> Date: Tue, 02 May 2006 10:50:16 +0200
> From: Carsten Ziegeler <cz...@apache.org>
> Reply-To: dev@cocoon.apache.org
> To: dev@cocoon.apache.org
> Subject: Re: [RT] Simplifying setup
> 
> Giacomo Pati wrote:
>>
>> I also know that one can define spring xml configuration
>> (appicationContext.xml) with the standard spring method in the web.xml
>> definitions (with the spring listener class). Is a possible "root"
>> ApplicationContext used in your Spring implementation as the parent
>> Context?
>>
> Sure :)

I was expecting this ;)

Thanks

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEVyGsLNdJvZjjVZARAtTTAJ9iTf+SCVrjLcwFJHLzFmTSaDEOAACeMWKA
2djtJ6HLqTYLibPgETrk3xM=
=Xc3L
-----END PGP SIGNATURE-----

Re: [RT] Simplifying setup

Posted by Carsten Ziegeler <cz...@apache.org>.
Giacomo Pati wrote:
> 
> I also know that one can define spring xml configuration 
> (appicationContext.xml) with the standard spring method in the web.xml 
> definitions (with the spring listener class). Is a possible "root" 
> ApplicationContext used in your Spring implementation as the parent 
> Context?
> 
Sure :)

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: [RT] Simplifying setup

Posted by Giacomo Pati <gi...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 2 May 2006, Carsten Ziegeler wrote:

> Date: Tue, 02 May 2006 10:19:12 +0200
> From: Carsten Ziegeler <cz...@apache.org>
> Reply-To: dev@cocoon.apache.org
> To: dev@cocoon.apache.org
> Subject: Re: [RT] Simplifying setup
> 
> Giacomo Pati wrote:
>> Is that a proposal to directly use Spring (which I would suggest)?
>>
>>>> framework. I propose that we should do the same in Cocoon. That doesn't
>>
>> Or do you think of using again something like "our own implementation of
>> a component container" ?
>>
> We are directly using Spring in 2.2 already (with some minor extensions
> as we have our own subclass of a BeanFactory which is there to provide

I know but Daniel is proposing using the Servlet mechanics to include it 
via ServletContext.

> Avalon compatibility. You can directly use spring xml configuration
> files and you can mix them with Avalon-style configuration files.

I also know that one can define spring xml configuration 
(appicationContext.xml) with the standard spring method in the web.xml 
definitions (with the spring listener class). Is a possible "root" 
ApplicationContext used in your Spring implementation as the parent 
Context?

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEVxvYLNdJvZjjVZARAqa1AJwORADNnpeVM8W4/uYzDXVb7ppsMACgvRJW
qHGCzw4TsQHTnZKzy/fhs1Y=
=LN0H
-----END PGP SIGNATURE-----

Re: [RT] Simplifying setup

Posted by Carsten Ziegeler <cz...@apache.org>.
Giacomo Pati wrote:
> Is that a proposal to directly use Spring (which I would suggest)?
> 
>>> framework. I propose that we should do the same in Cocoon. That doesn't
> 
> Or do you think of using again something like "our own implementation of 
> a component container" ?
> 
We are directly using Spring in 2.2 already (with some minor extensions
as we have our own subclass of a BeanFactory which is there to provide
Avalon compatibility. You can directly use spring xml configuration
files and you can mix them with Avalon-style configuration files.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: [RT] Simplifying setup

Posted by Giacomo Pati <gi...@apache.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Tue, 2 May 2006, Daniel Fagerstrom wrote:

> Date: Tue, 02 May 2006 09:26:06 +0200
> From: Daniel Fagerstrom <da...@nada.kth.se>
> Reply-To: dev@cocoon.apache.org
> To: dev@cocoon.apache.org
> Subject: Re: [RT] Simplifying setup
> 
> Ralph Goers skrev:
>>
>>
>>  Daniel Fagerstrom said:
>> >  Carsten Ziegeler skrev:
>> > >  Daniel Fagerstrom wrote:
>> > > >  <snip rt/>
>> > >  I'm mostly fine with your proposed changes if you think that this 
>> > >  helps
>> > >  Cocoon. In the end all changes that don't require to rewrite or change
>> > >  our current blocks are fine for me.
>> >  It will mean some changes for the portal block as it use the Cocoon
>> >  component and the same complicated setup as the the CocoonServlet.
>> >  Geting a component container that is setup by a servlet context listener
>> >  through the portlet context should work fine a simplify the portlet
>> >  setup as well.
>>
>>  Please provide an example of what this would look like.  I really need to
>>  understand how this will simplify anything.
>
> Here
> http://static.springframework.org/spring/docs/1.2.x/reference/webintegration.html#intro, 
> you can see the standard way of integrating a Spring container in a web

Is that a proposal to directly use Spring (which I would suggest)?

> framework. I propose that we should do the same in Cocoon. That doesn't

Or do you think of using again something like "our own implementation of 
a component container" ?

> mean a simplification in itself, but the refactoring of the core that I
> propose mean that it will be much easier to follow what happen in Cocoon
> and thus taking part in development. It will also mean that it will be
> easier for people who want to build new things, like a RoR style
> controller or a flowscript controller to do that.
>
>             --- o0o ---
>
> For the rest of your mail Reinhard have already answered that.
>
> It is time for you to back up all your opinions with some actual coding on 
> the trunk.
>
> /Daniel
>
>

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEVxIFLNdJvZjjVZARAhI5AKC/teFNI4m7lw2KxQiQhp653ofXVQCeOkTk
k9y21MEKh5FMMsRS7T8ce5o=
=VSDx
-----END PGP SIGNATURE-----

Re: [RT] Simplifying setup

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Ralph Goers skrev:
> 
> 
> Daniel Fagerstrom said:
>> Carsten Ziegeler skrev:
>>> Daniel Fagerstrom wrote:
>>>> <snip rt/>
>>> I'm mostly fine with your proposed changes if you think that this helps
>>> Cocoon. In the end all changes that don't require to rewrite or change
>>> our current blocks are fine for me.
>> It will mean some changes for the portal block as it use the Cocoon
>> component and the same complicated setup as the the CocoonServlet.
>> Geting a component container that is setup by a servlet context listener
>> through the portlet context should work fine a simplify the portlet
>> setup as well.
> 
> Please provide an example of what this would look like.  I really need to
> understand how this will simplify anything.

Here
http://static.springframework.org/spring/docs/1.2.x/reference/webintegration.html#intro, 

you can see the standard way of integrating a Spring container in a web
framework. I propose that we should do the same in Cocoon. That doesn't
mean a simplification in itself, but the refactoring of the core that I
propose mean that it will be much easier to follow what happen in Cocoon
and thus taking part in development. It will also mean that it will be
easier for people who want to build new things, like a RoR style
controller or a flowscript controller to do that.

              --- o0o ---

For the rest of your mail Reinhard have already answered that.

It is time for you to back up all your opinions with some actual coding 
on the trunk.

/Daniel

Re: [RT] Simplifying setup

Posted by Ralph Goers <Ra...@dslextreme.com>.


Daniel Fagerstrom said:
> Carsten Ziegeler skrev:
>> Daniel Fagerstrom wrote:
>>> <snip rt/>
>> I'm mostly fine with your proposed changes if you think that this helps
>> Cocoon. In the end all changes that don't require to rewrite or change
>> our current blocks are fine for me.
>
> It will mean some changes for the portal block as it use the Cocoon
> component and the same complicated setup as the the CocoonServlet.
> Geting a component container that is setup by a servlet context listener
> through the portlet context should work fine a simplify the portlet
> setup as well.

Please provide an example of what this would look like.  I really need to
understand how this will simplify anything.

>
>> But I'm remaining very sceptical wrt to a 2.2 release in general. I
>> think one of our main goals is currently out of focus: release early,
>> release often. This has nothing to do with this RT specifically, I just
>> wanted to use this thread as a reminder to focus on a release :)
>
> My personal goal is to release a blocks based Cocoon. But if anyone want
> to release something from trunk earlier, I'm fine with that. I just
> don't see any activity in that direction.

While true, it is unfortunate.  Switching to Maven 2 for building projects
is a lot less scary than switching from 2.1 to an OSGi based system. That
doesn't make it bad, but it may make the resistance to adopt it high.  I
believe that is why it was recommended at the gettogether that the focus
be on delivering trunk with Maven 2 by the end of the year and then
focusing on "real blocks".   At least, that is what I remember hearing.

>
> The important differences between 2.1 and trunk is in the cocoon-core,
> and as long as it is as complicated as it is today, only a few people
> understand it well enough to be able to work on it. So refactorings that
> make the core easier to understand and less monolithic will make it
> easier for more people to get involved, which IMO should increase the
> chance for a release.

For me, this remains to be seen.  Moving stuff from cocoon's core to OSGi
doesn't make it any less complicated. It just makes it a different set of
things to understand.  And unless you are getting rid of caching,
pipelines, etc. there is still a lot of Cocoon specific stuff to
understand.

Frankly, if trunk was completely working with Maven 2 I'd be all over it
trying to get it into production. But since it has been in sandbox mode
for so long, I've focused completely on 2.1 as that is what my employer
will be using until trunk gets in a mode where I trust it.  And I don't
see much point in learning how trunk works until it stabilizes.

Ralph



Re: [RT] Simplifying setup

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Carsten Ziegeler skrev:
> Daniel Fagerstrom wrote:
>> <snip rt/>
> I'm mostly fine with your proposed changes if you think that this helps
> Cocoon. In the end all changes that don't require to rewrite or change
> our current blocks are fine for me.

It will mean some changes for the portal block as it use the Cocoon 
component and the same complicated setup as the the CocoonServlet. 
Geting a component container that is setup by a servlet context listener 
through the portlet context should work fine a simplify the portlet 
setup as well.

> But I'm remaining very sceptical wrt to a 2.2 release in general. I
> think one of our main goals is currently out of focus: release early,
> release often. This has nothing to do with this RT specifically, I just
> wanted to use this thread as a reminder to focus on a release :)

My personal goal is to release a blocks based Cocoon. But if anyone want 
to release something from trunk earlier, I'm fine with that. I just 
don't see any activity in that direction.

The important differences between 2.1 and trunk is in the cocoon-core, 
and as long as it is as complicated as it is today, only a few people 
understand it well enough to be able to work on it. So refactorings that 
make the core easier to understand and less monolithic will make it 
easier for more people to get involved, which IMO should increase the 
chance for a release.

/Daniel

Re: [RT] Simplifying setup

Posted by Carsten Ziegeler <cz...@apache.org>.
Daniel Fagerstrom wrote:
> <snip rt/>
I'm mostly fine with your proposed changes if you think that this helps
Cocoon. In the end all changes that don't require to rewrite or change
our current blocks are fine for me.

But I'm remaining very sceptical wrt to a 2.2 release in general. I
think one of our main goals is currently out of focus: release early,
release often. This has nothing to do with this RT specifically, I just
wanted to use this thread as a reminder to focus on a release :)

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: [RT] Simplifying setup

Posted by Ralph Goers <Ra...@dslextreme.com>.
Please provide a concrete example of what you are proposing before 
checking anything in.  Then we can discuss this.

Daniel Fagerstrom wrote:
> People, I'm fed up with the sickening complicated setup sequence in 
> Cocoon. Much of the complication is related to setting up the 
> component manager and general over componentization.
>
> I'd like to remove the component container setup from the concern area 
> of Cocoon. The component container should instead be setup by the 
> servlet container using a ServletContextListener and made available to 
> the Cocoon main servlet through a servlet context attribute (the 
> details will be slightly different in the blocks context).
>
> Furthermore the setup contains a number of classes and components with 
> fairly overlapping and fuzzy concern areas: The CocoonServlet creates 
> a CoreUtil which creates a CocoonBeanFactory which in turn is used to 
> get the Cocoon component, which in turn delegates most of it job to 
> the SitemapLanguage which also is a component that is managed by the 
> CocoonBeanFactory. A fun exercise for the interested is to try to 
> figure out how and where the Cocoon component is configured and created.
>
> Now, I don't see any reason at all for Cocoon and SitemapLanguage to 
> be managed components, it just complicates everything. And for the 
> Cocoon component there is not much use anymore. Its responsibilities 
> are rather vague. I suggest that we just move whatever useful thing it 
> might do, to the main servlet and use Servlet instead of Processor as 
> top level interface (as discussed before, so many sitemap internal 
> details has been added to Processor that it is not useful as an 
> abstraction anymore anyway).
>
> For the Cocoon main servlet I suggest that we start from the 
> SitemapServlet 
> http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java, 
> and modify it so that it gets the bean container from a servlet 
> context attribute instead of being injected. Also the sitemap path 
> (for non default valiues) could be taken from servlet config init 
> parameter instead of the current mechanism.
>
> The SitemapServlet is rather minimal so some functionality from the 
> Cocoon component and the CocoonServlet could be moved to it. But I 
> think we should strive to keep it minimal. More advanced functionality 
> like multi part mime handling could preferably be moved to servlet 
> filters.
>
> The suggested architecture will make it much easier to maintain and 
> understand Cocoon, and will also make it simpler to reuse and to add 
> new controllers to (a Flowscript controller or a RoR inspired 
> convention controller e.g.). The CLI and Portlet environment will need 
> some refactoring if we follow the above path. But the CLI need some 
> work anyway and for the Portlet environment I would guess that getting 
> closer to the servlet standards just should simplify things.
>
> WDYT?
>
> /Daniel

Re: [RT] Simplifying setup

Posted by Reinhard Poetz <re...@apache.org>.
Daniel Fagerstrom wrote:
> People, I'm fed up with the sickening complicated setup sequence in 
> Cocoon. Much of the complication is related to setting up the component 
> manager and general over componentization.
> 
> I'd like to remove the component container setup from the concern area 
> of Cocoon. The component container should instead be setup by the 
> servlet container using a ServletContextListener and made available to 
> the Cocoon main servlet through a servlet context attribute (the details 
> will be slightly different in the blocks context).
> 
> Furthermore the setup contains a number of classes and components with 
> fairly overlapping and fuzzy concern areas: The CocoonServlet creates a 
> CoreUtil which creates a CocoonBeanFactory which in turn is used to get 
> the Cocoon component, which in turn delegates most of it job to the 
> SitemapLanguage which also is a component that is managed by the 
> CocoonBeanFactory. A fun exercise for the interested is to try to figure 
> out how and where the Cocoon component is configured and created.

hehe ;-)

> Now, I don't see any reason at all for Cocoon and SitemapLanguage to be 
> managed components, it just complicates everything. And for the Cocoon 
> component there is not much use anymore. Its responsibilities are rather 
> vague. I suggest that we just move whatever useful thing it might do, to 
> the main servlet and use Servlet instead of Processor as top level 
> interface (as discussed before, so many sitemap internal details has 
> been added to Processor that it is not useful as an abstraction anymore 
> anyway).
> 
> For the Cocoon main servlet I suggest that we start from the 
> SitemapServlet 
> http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java, 
> and modify it so that it gets the bean container from a servlet context 
> attribute instead of being injected. Also the sitemap path (for non 
> default valiues) could be taken from servlet config init parameter 
> instead of the current mechanism.
> 
> The SitemapServlet is rather minimal so some functionality from the 
> Cocoon component and the CocoonServlet could be moved to it. But I think 
> we should strive to keep it minimal. More advanced functionality like 
> multi part mime handling could preferably be moved to servlet filters.
> 
> The suggested architecture will make it much easier to maintain and 
> understand Cocoon, and will also make it simpler to reuse and to add new 
> controllers to (a Flowscript controller or a RoR inspired convention 
> controller e.g.). The CLI and Portlet environment will need some 
> refactoring if we follow the above path. But the CLI need some work 
> anyway and for the Portlet environment I would guess that getting closer 
> to the servlet standards just should simplify things.
> 
> WDYT?

After stepping through the code together with you I agree with your analysis and 
your suggestions.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

	

	
		
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

Re: [RT] Simplifying setup

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Sylvain Wallez skrev:
> Daniel Fagerstrom wrote:
>
>   
>> What I mean is that the tree processor currently get the path to the
>> sitemap.xmap from the configuration file. If the tree processor stop
>> being a managed component and just is setup in the SitemapServlet, it
>> will still need to get the sitemap path from somewhere. IMO a servlet
>> config init parameter would be a reasonable place to set the sitemap path.
>>     
>
> Ah, ok. Now, since this is about simplifying setup: is it even useful to
> have a configurable sitemap path?
>   
Don't know if it is useful, a default value should be enough in the vast 
majority of use cases.

/Daniel


Re: [RT] Simplifying setup

Posted by Sylvain Wallez <sy...@apache.org>.
Daniel Fagerstrom wrote:

> What I mean is that the tree processor currently get the path to the
> sitemap.xmap from the configuration file. If the tree processor stop
> being a managed component and just is setup in the SitemapServlet, it
> will still need to get the sitemap path from somewhere. IMO a servlet
> config init parameter would be a reasonable place to set the sitemap path.

Ah, ok. Now, since this is about simplifying setup: is it even useful to
have a configurable sitemap path?

Sylvain

-- 
Sylvain Wallez - http://bluxte.net


Re: [RT] Simplifying setup

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Sylvain Wallez skrev:
> Daniel Fagerstrom wrote:  
...
>> For the Cocoon main servlet I suggest that we start from the
>> SitemapServlet
>> http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java,
>> and modify it so that it gets the bean container from a servlet
>> context attribute instead of being injected.
>>     
>
> Makes sense also. The servlet specification states that servlet should
> have a no-arg constructor and get whatever then need to work in the
> init() method. So having servlets expecting dependencies to be injected
> by some external stuff makes them something that is no more exactly a
> servlet. Note that it can be circumvented somehow by having the init
> method grab the component container and do the injection process.
>   
Yes, in the current block fw I use dependency injection into servlets 
for components while connections to other servlets (blocks) are 
available through request dispatchers and (block) properties go to 
servlet init parameters. After having thought a little bit more about it 
I have realized that it is better to make the components and/or the 
service manager that a block depends on available to it as servlet 
context attributes.  This makes the blocks fw usable for more existing 
servlets and it make the life cycle for the servlets less complicated.

>> Also the sitemap path (for non default valiues) could be taken from
>> servlet config init parameter instead of the current mechanism.
>>     
>
> WDYM?
>   
What I mean is that the tree processor currently get the path to the 
sitemap.xmap from the configuration file. If the tree processor stop 
being a managed component and just is setup in the SitemapServlet, it 
will still need to get the sitemap path from somewhere. IMO a servlet 
config init parameter would be a reasonable place to set the sitemap path.

/Daniel


Re: [RT] Simplifying setup

Posted by Sylvain Wallez <sy...@apache.org>.
Daniel Fagerstrom wrote:
> People, I'm fed up with the sickening complicated setup sequence in
> Cocoon. Much of the complication is related to setting up the
> component manager and general over componentization.
>
> I'd like to remove the component container setup from the concern area
> of Cocoon. The component container should instead be setup by the
> servlet container using a ServletContextListener and made available to
> the Cocoon main servlet through a servlet context attribute (the
> details will be slightly different in the blocks context).

Yup. This is a common practice adopted by Spring and NanoContainer.

> Furthermore the setup contains a number of classes and components with
> fairly overlapping and fuzzy concern areas: The CocoonServlet creates
> a CoreUtil which creates a CocoonBeanFactory which in turn is used to
> get the Cocoon component, which in turn delegates most of it job to
> the SitemapLanguage which also is a component that is managed by the
> CocoonBeanFactory. A fun exercise for the interested is to try to
> figure out how and where the Cocoon component is configured and created.

:-)

> Now, I don't see any reason at all for Cocoon and SitemapLanguage to
> be managed components, it just complicates everything. And for the
> Cocoon component there is not much use anymore. Its responsibilities
> are rather vague. I suggest that we just move whatever useful thing it
> might do, to the main servlet and use Servlet instead of Processor as
> top level interface (as discussed before, so many sitemap internal
> details has been added to Processor that it is not useful as an
> abstraction anymore anyway).

Makes sense. The useful abstraction would be pipeline.

> For the Cocoon main servlet I suggest that we start from the
> SitemapServlet
> http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/sitemap/SitemapServlet.java,
> and modify it so that it gets the bean container from a servlet
> context attribute instead of being injected.

Makes sense also. The servlet specification states that servlet should
have a no-arg constructor and get whatever then need to work in the
init() method. So having servlets expecting dependencies to be injected
by some external stuff makes them something that is no more exactly a
servlet. Note that it can be circumvented somehow by having the init
method grab the component container and do the injection process.

> Also the sitemap path (for non default valiues) could be taken from
> servlet config init parameter instead of the current mechanism.

WDYM?

> The SitemapServlet is rather minimal so some functionality from the
> Cocoon component and the CocoonServlet could be moved to it. But I
> think we should strive to keep it minimal. More advanced functionality
> like multi part mime handling could preferably be moved to servlet
> filters.

Yup.

> The suggested architecture will make it much easier to maintain and
> understand Cocoon, and will also make it simpler to reuse and to add
> new controllers to (a Flowscript controller or a RoR inspired
> convention controller e.g.). The CLI and Portlet environment will need
> some refactoring if we follow the above path. But the CLI need some
> work anyway and for the Portlet environment I would guess that getting
> closer to the servlet standards just should simplify things.
>
> WDYT?

Sounds good!

Sylvain

-- 
Sylvain Wallez - http://bluxte.net