Berin Loritsch wrote:

> Leo Simons wrote:
>
>> On Wed, 2002-09-18 at 15:19, Berin Loritsch wrote:
>>
>>> Leo Simons wrote:
>>>
>>>> On Tue, 2002-09-17 at 23:07, Berin Loritsch wrote:
>>>>
>>>>> avalon:name   java.lang.String   The name of a component (is this
>>>>>                                 really necessary?)
>>>>
>>>>
>>>>
>>>> +1. Seems useful to me (wrt logging, GUIs, etc). Regardless, I doubt
>>>> anyone would ever want to attach a different class or meaning to
>>>> "avalon:name" so I doubt it will lead to problems.
>>>
>>>
>>> Well, with logging the category can be assigned to the "avalon:name",
>>> and management GUIs would have another way to access that information.
>>> So my point is why would we need it to solve real problems?
>>
>>
>>
>> that doesn't compute....could you elaborate a bit...it seems to me if
>> you want to assign the category to avalon:name, you should define
>> avalon:name....?
>
>
> The container sets the Logger, and therefore the category for the 
> Component.  The component does not need to know what its name is to 
> create child loggers either because it can perform this:
>
> Logger classLoaderLogger = getLogger().getChildLogger( "classloader" );
> m_myLoader.setLogger( classLoaderLogger );


The avalon:name attribute has nothing to do with the logging.  These are 
completely different issues.

>
> In fact, that is prefered to explicitly setting the category because
> logging is performed within the scope that the container wants it
> performed.
>
> I still don't see any *compelling* reason to expose the component's
> name to itself.  


It is useful with respect to exception management.  If you have 
exceptions that are passed from one system to another, it is desirable 
to pass information on which a reasonably elegant message can be 
generated on a remote system.  This message is outside any logging 
context and naming strucrture implied by a containment hierachy.  

Cheers, Steve.

-- 

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:[EMAIL PROTECTED]
http://www.osm.net




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to