On Wed, 2006-03-01 at 18:22 +0100, Emmanuel Bourg wrote:
> There is no variable, this would be implemented with a static inner
> class in the Log interface, something like this:
>
> public interface Log {
>
> ...
>
> public static class Factory {
> public static Log getLog(String name) {
> ...
> }
> }
> }
Fascinating! I haven't seen that trick before. An interface containing a
static method (via a little indirection)...cool.
Are you serious about this proposed API for the Log class, though?
I'm hoping that people will agree that the current Log API is ok (even
if it isn't 100% perfect), as that makes 2.x more backwards-compatible.
However if a change is made, I think it would make more sense to move to
the j.u.l/log4j solution (Log is abstract class) rather than invent yet
another design. However if you think
Log.Factory.getLog("foo")
really should be considered then we can start debating pros/cons.
PS: Craig, I agree completely with your miminal LogFactory abstract
class which has just the minimal possible implementations for
getInstance and getLog. All that map-of-factory-by-classloader stuff can
be pushed down into a subclass.....
Cheers,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]