Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 18934 invoked from network); 11 Jan 2007 16:18:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jan 2007 16:18:54 -0000 Received: (qmail 20758 invoked by uid 500); 11 Jan 2007 16:18:55 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 20723 invoked by uid 500); 11 Jan 2007 16:18:55 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 20679 invoked by uid 99); 11 Jan 2007 16:18:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jan 2007 08:18:55 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Jan 2007 08:18:48 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E204C7142E4 for ; Thu, 11 Jan 2007 08:18:27 -0800 (PST) Message-ID: <25985021.1168532307922.JavaMail.jira@brutus> Date: Thu, 11 Jan 2007 08:18:27 -0800 (PST) From: "Dennis Kuehn (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Updated: (CONFIGURATION-248) Safeguard config source abstraction by using HierarchicalConfiguration as supertype for all configs In-Reply-To: <14615795.1168522347521.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CONFIGURATION-248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dennis Kuehn updated CONFIGURATION-248: --------------------------------------- Description: I hope I get this right: When I have a CompositeConfiguration, the nice thing about it is that I don't have to care in which file or file type a config entry has been defined. Now when part of my CompositeConfiguration has a hierarchical structure and I need the API provided by HierarchicalConfiguration, I lose the aforementioned abstraction: I need to cast a specific part of my CompositeConfiguration to HierarchicalConfiguration. This is a major design problem! It would be better to leverage the Composite Pattern here: derive all configuration classes from HierarchicalConfiguration. Put differently, move the HierarchicalConfiguration API to Configuration. Even if a config is not hierarchically structured, methods for hierarchical access will be present, but that's a minor drawback which is intrinsic to the Composite Pattern. This also happens when you are modelling a tree structure and you have a common supertype "Node" which has a method "getSubNodes()" which will also be present in leaf node instances (in this case, "getSubNodes()" would return null etc.). was: I hope I get this right: When I have a CompositeConfiguration, the nice thing about it is that I don't have to care in which file or file type a config entry has been defined. Now when part of my CompositeConfiguration has a hierarchical structure and I need the API provided by HierarchicalConfiguration, I lose the aforementioned abstraction: I need to cast a specific part of my CompositeConfiguration to HierarchicalConfiguration. This is a major design problem! It would be better to leverage the Composite Pattern here: derive all configuration objects from HierarchicalConfiguration. Put differently, move the HierarchicalConfiguration API to Configuration. Even if a config is not hierarchically structured, methods for hierarchical access will be present, but that's a minor drawback which is intrinsic to the Composite Pattern, like when you are modelling a tree structure and you have a common superclass "Node" which has a method "getSubNodes()" which will also be present for leaf nodes (in this case, "getSubNodes()" would return null etc.). > Safeguard config source abstraction by using HierarchicalConfiguration as supertype for all configs > --------------------------------------------------------------------------------------------------- > > Key: CONFIGURATION-248 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-248 > Project: Commons Configuration > Issue Type: Wish > Affects Versions: 1.3 Final > Environment: - > Reporter: Dennis Kuehn > > I hope I get this right: > When I have a CompositeConfiguration, the nice thing about it is that I don't have to care in which file or file type a config entry has been defined. Now when part of my CompositeConfiguration has a hierarchical structure and I need the API provided by HierarchicalConfiguration, I lose the aforementioned abstraction: I need to cast a specific part of my CompositeConfiguration to HierarchicalConfiguration. This is a major design problem! > It would be better to leverage the Composite Pattern here: derive all configuration classes from HierarchicalConfiguration. Put differently, move the HierarchicalConfiguration API to Configuration. Even if a config is not hierarchically structured, methods for hierarchical access will be present, but that's a minor drawback which is intrinsic to the Composite Pattern. This also happens when you are modelling a tree structure and you have a common supertype "Node" which has a method "getSubNodes()" which will also be present in leaf node instances (in this case, "getSubNodes()" would return null etc.). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org