You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Gianugo Rabellino <g....@bibop.it> on 2001/08/21 12:26:19 UTC

Component setup

Ciao,

while I understand this is more an Avalon-specific question,
I'm a bit confused about component setup in Cocoon. From 
Berin's documents I understand that there are some methods
that are called once in a component's life such as 
configure(), initialize(), compose() and so on.

I'm planning to use initialize() in XMLDBGenerator in 
order to obtain a database instance that will be reused
during the component lifetime: I actually did it and it
seems to work, yet by grepping the whole Cocoon code base 
I see that Initializable is implemented only in Cocoon.java: 
is that on purpose (i.e. is the use of Initializable discouraged
for some reason that I'm missing) or is it just a coincidence?

TIA,

-- 
Gianugo Rabellino

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Component setup

Posted by Berin Loritsch <bl...@apache.org>.
Gianugo Rabellino wrote:
> 
> Ciao,
> 
> while I understand this is more an Avalon-specific question,
> I'm a bit confused about component setup in Cocoon. From
> Berin's documents I understand that there are some methods
> that are called once in a component's life such as
> configure(), initialize(), compose() and so on.
> 
> I'm planning to use initialize() in XMLDBGenerator in
> order to obtain a database instance that will be reused
> during the component lifetime: I actually did it and it
> seems to work, yet by grepping the whole Cocoon code base
> I see that Initializable is implemented only in Cocoon.java:
> is that on purpose (i.e. is the use of Initializable discouraged
> for some reason that I'm missing) or is it just a coincidence?

It's mainly coincidence.  Much of Cocoon takes advantage of
the well defined ordering of method calls--or only use
Composable and Configurable.  They are relatively simple.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Component setup

Posted by Gianugo Rabellino <g....@bibop.it>.
> > I'm planning to use initialize() in XMLDBGenerator in 
> > order to obtain a database instance that will be reused
> > during the component lifetime: I actually did it and it
> > seems to work, yet by grepping the whole Cocoon code base 
> > I see that Initializable is implemented only in Cocoon.java: 
> > is that on purpose (i.e. is the use of Initializable discouraged
> > for some reason that I'm missing) or is it just a coincidence?
> 
> Coincidence. Usually, databases have connection pools (is XML:DB an exclusion
> from this rule?)

I tend to think so. Given the API, having a connection pool wouldn't 
make that much sense to me since the focus in on the Collection rather
than on the Connection, and the Collection has to be requested every
time. Pooling the component should be more than enough to give
good performance (at least I hope so :)). 

Ciao,

-- 
Gianugo Rabellino

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: Component setup

Posted by Vadim Gritsenko <vg...@hns.com>.
> -----Original Message-----
> From: Gianugo Rabellino [mailto:g.rabellino@bibop.it]
> Sent: Tuesday, August 21, 2001 6:26 AM
> To: cocoon-dev@xml.apache.org
> Subject: Component setup
> 
> 
> Ciao,
> 
> while I understand this is more an Avalon-specific question,
> I'm a bit confused about component setup in Cocoon. From 
> Berin's documents I understand that there are some methods
> that are called once in a component's life such as 
> configure(), initialize(), compose() and so on.
> 
> I'm planning to use initialize() in XMLDBGenerator in 
> order to obtain a database instance that will be reused
> during the component lifetime: I actually did it and it
> seems to work, yet by grepping the whole Cocoon code base 
> I see that Initializable is implemented only in Cocoon.java: 
> is that on purpose (i.e. is the use of Initializable discouraged
> for some reason that I'm missing) or is it just a coincidence?

Coincidence. Usually, databases have connection pools (is XML:DB an exclusion
from this rule?), so generator would have configure() to get name of the pool it should 
work with and compose() to get reference to the pool.
That's why initialize() is not so common.

Vadim

> 
> TIA,
> 
> -- 
> Gianugo Rabellino
> 
> ---------------------------------------------------------------------
> 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