Return-Path: Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: (qmail 72526 invoked from network); 7 Jan 2005 19:50:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Jan 2005 19:50:53 -0000 Received: (qmail 16590 invoked by uid 500); 7 Jan 2005 19:50:52 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 16560 invoked by uid 500); 7 Jan 2005 19:50:51 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 16544 invoked by uid 99); 7 Jan 2005 19:50:51 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from exprod6ob5.obsmtp.com (HELO psmtp.com) (64.18.1.215) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 07 Jan 2005 11:50:50 -0800 Received: from source ([193.95.148.142]) by exprod6ob5.obsmtp.com ([64.18.5.12]) with SMTP; Fri, 07 Jan 2005 11:50:15 PST Received: from inner-relay-3.corp.adobe.com (inner-relay-3.sea.adobe.com [153.32.251.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id j07JulTG005473 for ; Fri, 7 Jan 2005 11:56:48 -0800 (PST) Received: from calsj-dev (calsj-dev.corp.adobe.com [153.32.1.193]) by inner-relay-3.corp.adobe.com (8.12.9/8.12.9) with ESMTP id j07Joj0v015609 for ; Fri, 7 Jan 2005 11:50:45 -0800 (PST) Received: from WOMACKXP (c-67-3.corp.adobe.com [153.32.67.3]) by mailsj-v1.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0I9Y0096DPSKHO@mailsj-v1.corp.adobe.com> for log4j-dev@logging.apache.org; Fri, 07 Jan 2005 11:50:44 -0800 (PST) Date: Fri, 07 Jan 2005 11:50:44 -0800 From: Mark Womack Subject: RE: [NEWS] Component and ComponentBase In-reply-to: <6.0.3.0.0.20050107182730.03937ff8@mail.qos.ch> To: "'Log4J Developers List'" Reply-to: womack@adobe.com Message-id: <0I9Y0096EPSKHO@mailsj-v1.corp.adobe.com> Organization: Adobe Systems MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable Thread-index: AcT0709rDiMYQBLXQv+k7LwgSQvS2QAAlN6w X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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=FClc=FC [mailto:ceki@qos.ch] > Sent: Friday, January 07, 2005 11:31 AM > To: Log4J Developers List > Subject: [NEWS] Component and ComponentBase >=20 >=20 > Curt et al., >=20 > 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). >=20 > 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. >=20 > 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. >=20 > 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. >=20 > -- > Ceki G=FClc=FC >=20 > The complete log4j manual: http://www.qos.ch/log4j/ >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org > For additional commands, e-mail: log4j-dev-help@logging.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org