Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 12999 invoked from network); 7 Dec 2004 13:34:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Dec 2004 13:34:35 -0000 Received: (qmail 47631 invoked by uid 500); 7 Dec 2004 13:34:28 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 47564 invoked by uid 500); 7 Dec 2004 13:34:28 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 47547 invoked by uid 99); 7 Dec 2004 13:34:28 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.hometree.net (HELO mail.hometree.net) (194.77.152.181) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 07 Dec 2004 05:34:27 -0800 Received: from tangens.hometree.net (mail.hometree.net [194.77.152.181]) by mail.hometree.net (8.12.11/8.12.11) with ESMTP id iB7DYOVE026257 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 7 Dec 2004 14:34:24 +0100 Received: (from news@localhost) by tangens.hometree.net (8.12.11/8.12.11/Submit) id iB7DYO1k026255 for commons-dev@jakarta.apache.org; Tue, 7 Dec 2004 14:34:24 +0100 To: commons-dev@jakarta.apache.org Path: not-for-mail From: "Henning P. Schmiedehausen" Newsgroups: hometree.jakarta.commons.dev Subject: Re: [CONFIGURATION] ClassPropertiesConfiguration Date: Tue, 7 Dec 2004 13:34:24 +0000 (UTC) Organization: INTERMETA - Gesellschaft fuer Mehrwertdienste mbH Lines: 63 Message-ID: References: <41B593D8.3040708@lfjr.net> <41B59B61.9020800@lfjr.net> <41B5A7B5.8040404@lfjr.net> Reply-To: hps@intermeta.de NNTP-Posting-Host: forge.intermeta.de X-Trace: tangens.hometree.net 1102426464 25914 194.77.152.164 (7 Dec 2004 13:34:24 GMT) X-Complaints-To: news@intermeta.de NNTP-Posting-Date: Tue, 7 Dec 2004 13:34:24 +0000 (UTC) X-Copyright: (C) 1996-2005 Henning Schmiedehausen User-Agent: nn/6.6.5 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Emmanuel Bourg writes: >Henning P. Schmiedehausen wrote: >>>new PropertiesConfiguration(locator.locate("config.properties)); >> >> I don't like that much. Once the locator has run, it has run. Passing >> the locator object allows the implementor to catch all the calls to >> locate() and maybe react differently. >I'm not sure to see the need, do you have a real use case in mind ? An idea that popped up was the "versioning locator" mentioned in the reply to Oliver. >> How about wrapping the name of the configuration file / the >> configuration parameters into the locator object: >> >> config = new PropertiesConfiguration (new FileLocator("config.properties")); >> config = new PropertiesConfiguration (new ClassPathLocator("config.properties")); >> >> config.load(new FileLocator("config.properties")); >Hmm no because a locator is a strategy to find a resource, it doesn't >define a resource, this is the role of the URL. The filename might not be part of the strategy but it is vital to locating the ressource. :-) Does it make sense to have a strategy without a filename / a filename without a strategy (other than defaults)? If no, then we will have to pull a pair of "resource name" / "Locator object") around anyway. >> This would simplify the method signatures. We might even be able to >> decouple things like JDBC and JNDI: >> >> config = new PropertiesConfiguration(new JDBCLocator(... jdbc params...)); >Is this really simpler than instanciating DatabaseConfiguration and >JNDIConfiguration ? :) It would reduce the number of C'tors and additional methods from the Configuration implementations. It might also reduce the duplication of code into classes. Having one set of objects that define the contents of a configuration resource (Properties, XML, whatever) and another set that defines the location of the resource (File, Classpath, JNDI, JDBC) seemed natural to me. Maybe just a brain fart. Regards Henning -- Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH hps@intermeta.de +49 9131 50 654 0 http://www.intermeta.de/ RedHat Certified Engineer -- Jakarta Turbine Development -- hero for hire Linux, Java, perl, Solaris -- Consulting, Training, Development What is more important to you... [ ] Product Security or [ ] Quality of Sales and Marketing Support -- actual question from a Microsoft customer survey --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org