Which item is this in Effective Java? He also makes a strong argument (Item 1) to use static factory methods instead of constructors.
I think that going down the constructor path can potentially lead to "parameter madness" as you add more "required" members that must be set at construction time. Just a comment, -Mark > -----Original Message----- > From: Ceki Gülcü [mailto:[EMAIL PROTECTED] > Sent: Friday, January 07, 2005 11:31 AM > To: Log4J Developers List > Subject: [NEWS] Component and ComponentBase > > > Curt et al., > > I had a long technical dicussion with a friend who mentioned that in > "Effective Java" Joshua Bloch makes a compelling case against the > setter approach (and in favor of constructors). > > The existing configuration code relies on Appenders, Layouts and > Receivers having a default constructor. However, the Component > interface and ComponentBase class do *not* prevent the use of > constructors taking an LR as argument in other classes, in particular > in the classes indirectly instanciated by Appenders, Layouts, etc. > > He also suggested a simple solution to the "default repository > configuration while in the context of 'myWebApp'" problem which > triggered all the recent changes. Basically, he suggests that in the > static initializer of LogManager the default repository be configured > before the repositorySelector is instantiated. During the > configuration of the default repository, the repositorySelector > field has to temporarily point to a default RepositorySelector, not > the real selector, not yet instantiated. > > This fix may imply that we can go back to the old internal logging > guidelines which only required instance Logger variables, without the > need to change every single class that log4j used internally. > > -- > Ceki Gülcü > > The complete log4j manual: http://www.qos.ch/log4j/ > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]