On Fri, 7 Feb 2003, Nicola Ken Barozzi wrote:

Speaking as a potential user of commons-logging to your suggestions:

> Look, I have some requirements that I'd like to be addressed somehow,
> let's see if you can help me.
>
> 1) a library should be able to work even without commons-logging
>     in the classpath

I don't see how this can work without ensuring that another package,
commons-stub is in the classpath. I know I'm definitely not going to copy
and paste pieces of code from library to library to handle looking for
commons-logging.

I'm also not sure if this is possible in a way that will work in all JVMs.
I use a similar trick in the HEAD version of the String Taglib, basically
I have a static method call which checks to see if the necessary class is
available, this boolean is stored in a static variable which is checked
on each call to the method.

However I'm not sure if this will work on all JVMs. What if a JVM attempts
to pre-load all classes discussed in a class before loading the class,
even if the class being used is hidden inside a non-executing piece of
code.

> 2) it should be possible to pass the logger to the library instead
>     of having it search for it via static accessors

Explosion of API. This is unnecessary overloading. Why isn't it simply
handled via a factory mechanism? Akin to JNDI.

> 3) if commons logging is in the classpath and the logger is not set,
>     then it can log only if an environmental variable based on
>     the library package is set

Sub-clause of 2).

> This means that if I want to log, I have to add an environmental
> variable for every library I want to log, and put commons logging in the
> classpath, or set the logger on each package I want to log.
>
> What do you think? What of the above seems unreasonable to you?

All of the above :) Plus adding an envrionment variable per library is a
poor management technique. I want to store them all in a file, not as a
host of -D arguments or even in code.

Hen


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

Reply via email to