commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: [CLI] new design possibly?
Date Fri, 07 Feb 2003 17:23:16 GMT

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

> Looks like an AOP-like system to intercept all logs of a package could
> help, but I'm lost here.

If you implement your own LogFactory, this is pretty straightforward,
since it is your LogFactory instance that creates all the Log instances
(even those declared static).

I once had to integrate some libraries using commons-logging into an app
that wanted to funnel log messages into logs (in the underlying
environment) with different names than those used by the calling packages.
This was accomplished by a trivially simple LogFactory implementation that
performed the log name mapping and delegated to the existing impl for the
work of actually creating the instance.

The same approach would work (for example) to return a Log instance that
was decorated AOP-style with extra functionality.

No, it's not the strict IOC pattern that Avaloners really like.  But
there's more than one useful design pattern in the world, and the factory
create pattern is pretty popular too :-).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message