You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Upayavira <uv...@upaya.co.uk> on 2003/07/08 12:42:17 UTC

Cocoon and Component Manager (was RE: protected vs private instance members (in Woody))

On 8 Jul 2003 at 12:29, Carsten Ziegeler wrote:

> Has someone followed the changes to Cocoon.java regarding the
> component manager. It started as private was changed to protected and
> then changed to public by someone who needed it (also it was never
> meant to be public!). But as it's open source with so many developers,
> someone changes it and in most cases this goes unnoticed. Then someday
> someone noticed that and changed it back to protected. Later on it was
> changed to public again and this went on for a while! Now, finally we
> have a public getComponentManager method, although this was never
> meant to be publically available.

That was me! When I converted the CocoonBean to use ModifiableSources, I needed 
to get hold of a SourceResolver. As the bean isn't an Avalon component, it didn't 
have one itself. The only place I could think of to get it was the Cocoon instance itself. 
I'm quite happy to do this another way - all I need is to get hold of a SourceResolver 
from outside an Avalon component. My Avalon knowledge is weak, so I am unaware 
of another way.

Regards, Upayavira


Re: Cocoon and Component Manager (was RE: protected vs private instance members (in Woody))

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Carsten Ziegeler wrote:

>Upayavira wrote:
>  
>
<snip/>

>>That was me! 
>>    
>>
>I know :)
>  
>
>>When I converted the CocoonBean to use ModifiableSources, I needed to get hold of a SourceResolver. As the bean isn't an Avalon component, it didn't have one itself. The only place I could think of to get it was the Cocoon instance itself. 
>>I'm quite happy to do this another way - all I need is to get hold of a SourceResolver from outside an Avalon component. My Avalon knowledge is weak, so I am unaware of another way.
>>    
>>
>I don't condemn your changes, they are absolutely OK! I only took this as an example of what could happen with an instance member usual intended to be private. Don't worry :)
>  
>

Just to add my small POV of "the one that doesn't like public access" 
(that's my role today) : adding a _public_ ;-) 
Cocoon.getComponentManager() is ok since Cocoon used as a library isn't 
really useful if we can't access the components that are inside !

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: Cocoon and Component Manager (was RE: protected vs private instance members (in Woody))

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Upayavira wrote:
> 
> On 8 Jul 2003 at 12:29, Carsten Ziegeler wrote:
> 
> > Has someone followed the changes to Cocoon.java regarding the
> > component manager. It started as private was changed to protected and
> > then changed to public by someone who needed it (also it was never
> > meant to be public!). But as it's open source with so many developers,
> > someone changes it and in most cases this goes unnoticed. Then someday
> > someone noticed that and changed it back to protected. Later on it was
> > changed to public again and this went on for a while! Now, finally we
> > have a public getComponentManager method, although this was never
> > meant to be publically available.
> 
> That was me! 
I know :)

> When I converted the CocoonBean to use 
> ModifiableSources, I needed 
> to get hold of a SourceResolver. As the bean isn't an Avalon 
> component, it didn't 
> have one itself. The only place I could think of to get it was 
> the Cocoon instance itself. 
> I'm quite happy to do this another way - all I need is to get 
> hold of a SourceResolver 
> from outside an Avalon component. My Avalon knowledge is weak, so 
> I am unaware 
> of another way.
> 
I don't condemn your changes, they are absolutely OK! I only took this as
an example of what could happen with an instance member usual intended to
be private. Don't worry :)

Carsten