commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <ebo...@apache.org>
Subject Re: [logging] JCL2.0 design - API
Date Wed, 01 Mar 2006 17:22:42 GMT
Craig McClanahan wrote:

>> It's possible to keep a Log interface and having one less class to
>> import by adding a static class in the Log interface. It would look like
>> this:
>>
>>      Log log = Log.Factory.getLog("foo");
>>
> 
> I presume this would be implemented by making "Factory" a static variable?
> That doesn't offer much protection against malicious applications trying to
> replace it and potentially messing up other users.

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) {
             ...
         }
     }
}

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message