Craig R. McClanahan wrote, On 07/02/2003 18.23:
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).
What if other packages decide to make their factory? Can I somehow be sure that I'm the top one deciding things?

Also, what about different classloaders. Would a single LogFactory work with all of them?

Just trying to understand better.

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.
Hmmm, seems cool.

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 :-).
Yes, and speaking personally (not too loud ;-) I use it too with things that are not coarse-grained components. Is simply does not make sense to micromanage every logger and handle it to all children IMHO.

--
Nicola Ken Barozzi [EMAIL PROTECTED]
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------



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

Reply via email to