cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <>
Subject Multiple block instances
Date Wed, 06 Apr 2005 08:41:36 GMT
Daniel Fagerstrom wrote:

> Consider the following case: One of my applications use a repository 
> block, and this repository block has a db connection with name and 
> password as deplyment parameters. If another application need to use the 
> same repository block, but connected to another db it will have other 
> deployment parameters. In this case we will have two deployed instances 
> of the same block with different deployment parameters. How do we differ 
> between them.

If you need different behaviour of one block you will have to extend it (so it 
gets another unique ID) and only change the properties in block.xml.
(Although I think that this isn't a good example because it's not a consuming 
block's concern to set the database connection IMO).

> Another case is if we follow the method of handling the profile info for 
> a portal block that Reinhard proposed. If we want to use two portals 
> under the same Cocoon the portal block will be deployed in two instances 
> with different implementations of the profile contract. Also here is the 
> question is how we differ between the two instances.

Let's assume that you want to deploy two custom blocks that are based on the 
portal block. Doing so leds to two different blocks (--> different block IDs) 
which both extend the same block. Both blocks can use the same profile block to 
be customized or each gets its own - depends on your requirements.

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

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


View raw message