You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Berin Loritsch <bl...@apache.org> on 2003/10/22 18:55:13 UTC

ParentAware Components Revisited

I am still not clear on the purpose of Parent Aware components.  I can't really
see any compelling reason for them, or even how to alot for them in the Cocoon
container heirarchy.

I am going to procede without them for now.

-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin



Re: ParentAware Components Revisited

Posted by Berin Loritsch <bl...@apache.org>.
Sylvain Wallez wrote:

> Berin Loritsch wrote:
> 
>> I am still not clear on the purpose of Parent Aware components.  I 
>> can't really
>> see any compelling reason for them, or even how to alot for them in 
>> the Cocoon
>> container heirarchy.
>>
>> I am going to procede without them for now. 
> 
> 
> 
> A ParentAware component has visibility on the component having the same 
> role in the parent container of its own container.
> 
> This is mainly useful for selectors, to allow selectors in a subsitemap 
> to _augment_ the selector with the same role in the parent sitemap. 
> Implementing component inheritance between sitemap and subsitemap is 
> then just a matter of having a ParentAware selector. Upon select(), this 
> selector looks first in its own set of components, and if not found, 
> delegates to the selector in the parent container.
> 
> As I understand it, Fortress may not need this mechanism, since selector 
> is replaced by a lookup on the manager with a "role/hint" string. This 
> means that components with "variants" (don't know how are called these 
> hinted roles) will automatically be inherited by the parent/child 
> relationship of the container.
> 
> Now I don't know how this fits with looking up a selector in the old ECM 
> way...

If that is the case, then we really don't need this.  The CocoonContainer will
work kind of like that by default.

-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


Re: ParentAware Components Revisited

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Berin Loritsch wrote:

> I am still not clear on the purpose of Parent Aware components.  I 
> can't really
> see any compelling reason for them, or even how to alot for them in 
> the Cocoon
> container heirarchy.
>
> I am going to procede without them for now. 


A ParentAware component has visibility on the component having the same 
role in the parent container of its own container.

This is mainly useful for selectors, to allow selectors in a subsitemap 
to _augment_ the selector with the same role in the parent sitemap. 
Implementing component inheritance between sitemap and subsitemap is 
then just a matter of having a ParentAware selector. Upon select(), this 
selector looks first in its own set of components, and if not found, 
delegates to the selector in the parent container.

As I understand it, Fortress may not need this mechanism, since selector 
is replaced by a lookup on the manager with a "role/hint" string. This 
means that components with "variants" (don't know how are called these 
hinted roles) will automatically be inherited by the parent/child 
relationship of the container.

Now I don't know how this fits with looking up a selector in the old ECM 
way...

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Re: ParentAware Components Revisited

Posted by Berin Loritsch <bl...@apache.org>.
Leo Sutic wrote:
> The issue is this:
> 
> A component in a child container has access to all components in the
> parent 
> component manager - if the role isn't found in it's own CM, the lookup
> proceeds
> to the parent.
> 
> However, when looking up a component via a selector, this is not the
> case. Since
> the selector was found, lookup stops there, irrespective of whether the
> hint
> passed to the selector really results in a component.
> 
> The ParentAware interface enables this - if a selector for
> my.Generator/Selector doesn't
> have a component for hint "xyz" then it can look up
> my.Generator/Selector in the parent
> CM and try there.

This is no longer an issue with Fortress.  That is because the ServiceManager/
ServiceSelector are not *managing* the components, but accessing them.  There
is no longer any problem with that.


-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


RE: ParentAware Components Revisited

Posted by Leo Sutic <le...@inspireinfrastructure.com>.
The issue is this:

A component in a child container has access to all components in the
parent 
component manager - if the role isn't found in it's own CM, the lookup
proceeds
to the parent.

However, when looking up a component via a selector, this is not the
case. Since
the selector was found, lookup stops there, irrespective of whether the
hint
passed to the selector really results in a component.

The ParentAware interface enables this - if a selector for
my.Generator/Selector doesn't
have a component for hint "xyz" then it can look up
my.Generator/Selector in the parent
CM and try there.

/LS