cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <andre.juf...@oulu.fi>
Subject Re: 2.2 Bean "heritance"
Date Fri, 15 Oct 2010 13:42:39 GMT
  I am not sure if I understand your question.

You have two beans 'Main' and 'Specific', each to be configured by 
Spring. Specific depends on Main. For you Java lasses, you something like

public class Specific()
{
...
}

public class Main() {
     ...
     private Specific specific;

     public void setMain(Specific specific)
     {
          this.specific = specific;
     }
}

and your bean configuration looks like

<bean id="com.foo.bar.Main" class="com.foo.bar.MainImpl">
</bean>

<bean id="com.foo.bar.Specific" class="com.foo.bar.SpecificImpl">
<property name="main" ref="com.foo.bar.Main" />
</bean>

Is you question whether or not you would need to include your bean 
configuration as local to a particular block or global to all blocks? My 
answer would be 'local' if these beans are required for particular 
blocks only. Otherwise take one of the blocks and include your beans as 
'global' and they will be the same to all blocks in your webapp.


On 10/15/2010 01:38 AM, florent andré wrote:
> Hi all,
>
> Newbie to 2.2 and not a star in spring, so maybe this question is non
> sense.
>
> The case :
>
> - I have a module "Main" where is defined an input-module (AnInput) in a
> "bean way"
>
> - I have a module "Specific" that depend on the "Main" and would like to
> use AnInput is his sitemap.
>
> I have to redeclare the input-module in the "Specific" module ? Or there
> is a way to use the "main" one ?
>
> I would prefer the second one is possible.
>
> Thanks for your lights.
>
> ++
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


-- 
Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email: andre.juffer@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
StruBioCat                   | WWW: www.strubiocat.oulu.fi
NordProt                     | WWW: www.nordprot.org
Triacle Biocomputing         | WWW: www.triacle-bc.com


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


Mime
View raw message