On 4/3/02 1:53 PM, "Jon Scott Stevens" <[EMAIL PROTECTED]> wrote:

> on 4/3/02 10:46 AM, "Geir Magnusson Jr." <[EMAIL PROTECTED]> wrote:
> 
>> Right - and with what I am thinking about, be defensive.  Don't just use
>> 'logger' - wrap it with a check.
>> 
>> Or have an internal log method that does that....
> 
> So, for every class, I now also need to copy/paste in some log method?
> 
> <sarcastic>
> Now that is smart OO engineering.
> </sarcastic>

<stunned by the pointlessness of this>
  or you could just derive your components from a base class
</stunned by the pointlessness of this>


> 
>>> 
>>> I really don't understand why that is better than the Pull model which would
>>> be more like this:
>>> 
>>> class MyComponent
>>>   implements Component, LogEnabled
>>> {
>>>   private static Logger logger = Log.getLogger();
>>> 
>>>   myMethod() 
>>>   {
>>>       logger.info("Hello World!");
>>>   }
>>> }
>>> 
>>> Seems so much cleaner of a design to me and it is impossible to get an NPE.
>> 
>> Except that forces there to be something called Log in the classpath.  In
>> the case where you are using the component/tool in an environment where that
>> doesn't exist, you'll get a different exception, out of your control...
> 
> Isn't the point of the Commons project to come up with a set of re-usable
> components? Isn't the point of the Commons-Logging project to come up with a
> small .jar file that you can just drop into your classpath and use with
> whatever logging system you want?

Could be - if that is all it is, I think it's missing something major :

defining a standard interface for logging for which implementations
beyond the current loggers can be created.

So if I have an existing application with a logging system, I don't need to
throw it away - I just put a wrapper around it that implements o.a.c.l.Log,
and all compoenents that use Log can use it.  We took the same approach in
Velocity, and it works great - I have linked the velocity log flow into
existing log systems at my clients...

I think forcing the singleton approach sucks.

> 
> Seems that we are trying to avoid the point of why we write software for
> Jakarta.

Which is what?  Not invented here?  :)

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

-- 
Geir Magnusson Jr.                                     [EMAIL PROTECTED]
System and Software Consulting
"He who throws mud only loses ground." - Fat Albert


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

Reply via email to