Re: [configuration] Change Commons-Configuration getVector to getSet?
Emmanuel Bourg [EMAIL PROTECTED] writes: --ms080101070400050103080207 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit A Set is too restrictive i think, there are valid reasons for preserving duplicate configuration entries. I would use a Collection or better, a List when the element order matters. -1 on using a set -1 on deprecating getVector() +1 on using a Collection +1 on getCollection() I have use cases, where I need repeating keys in the sequence that was put into the configuration file - sequence: list org service. keys in turbine.properties - repeating keys: list of packages to search for an action/screen in turbine.properties (here I need the exact sequence, too) So changing this API to use a set without order would damage the current Turbine code (which might be one of the main users of commons-configuration). Regards Henning -- Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH [EMAIL PROTECTED]+49 9131 50 654 0 http://www.intermeta.de/ Java, perl, Solaris, Linux, xSP Consulting, Web Services freelance consultant -- Jakarta Turbine Development -- hero for hire Dominate!! Dominate!! Eat your young and aggregate! I have grotty silicon! -- AOL CD when played backwards (User Friendly - 200-10-15) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [configuration] Change Commons-Configuration getVector to getSet?
Is getCollection what is wanted, or getList()? I was under the impression that a collection isn't ordered.. And then you would have to cast to a List to pass the collection into anything that expects an ordered list. Eric -Original Message- From: Henning P. Schmiedehausen [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 10:02 AM To: [EMAIL PROTECTED] Subject: Re: [configuration] Change Commons-Configuration getVector to getSet? Emmanuel Bourg [EMAIL PROTECTED] writes: --ms080101070400050103080207 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit A Set is too restrictive i think, there are valid reasons for preserving duplicate configuration entries. I would use a Collection or better, a List when the element order matters. -1 on using a set -1 on deprecating getVector() +1 on using a Collection +1 on getCollection() I have use cases, where I need repeating keys in the sequence that was put into the configuration file - sequence: list org service. keys in turbine.properties - repeating keys: list of packages to search for an action/screen in turbine.properties (here I need the exact sequence, too) So changing this API to use a set without order would damage the current Turbine code (which might be one of the main users of commons-configuration). Regards Henning -- Dipl.-Inf. (Univ.) Henning P. Schmiedehausen INTERMETA GmbH [EMAIL PROTECTED]+49 9131 50 654 0 http://www.intermeta.de/ Java, perl, Solaris, Linux, xSP Consulting, Web Services freelance consultant -- Jakarta Turbine Development -- hero for hire Dominate!! Dominate!! Eat your young and aggregate! I have grotty silicon! -- AOL CD when played backwards (User Friendly - 200-10-15) - 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]
RE: [configuration] Change Commons-Configuration getVector to getSet?
Re: [configuration] Change Commons-Configuration getVector to getSet?Out of curiosity, what would be a usecase for multiple duplicate config entries that are the same? Maybe to count them or something? So, does anyone have an opinion on List? I definitly can understand why the Set wouldn't work. I suggested Set thinking order didn't matter, but you are right, it does.. I guess I just don't like the look of Vector in things... Eric -Original Message- From: Emmanuel Bourg [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 2:45 PM To: Jakarta Commons Developers List Cc: 'Turbine Developers List' Subject: Re: [configuration] Change Commons-Configuration getVector to getSet? A Set is too restrictive i think, there are valid reasons for preserving duplicate configuration entries. I would use a Collection or better, a List when the element order matters. Emmanuel Eric Pugh wrote: Hi all, I am looking at a chunk of code like this: Vector packages = Turbine.getConfiguration() .getVector(TurbineConstants.MODULE_PACKAGES); ObjectUtils.addOnce(packages, GenericLoader.getBasePackage()); from Layout Loader... And it seems to me that commons-configuration getVector should be deprecated in favor of getSet(). I can't think why you would want duplicate values, so getSet() makes more sense then getList(). Then, funky call's like the ObjectUtils.addOnce() wouldn't be needed... Opinons? And do we have to deprecate getVector() since we haven't released from sandbox yet? Eric Pugh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[configuration] Change Commons-Configuration getVector to getSet?
Hi all, I am looking at a chunk of code like this: Vector packages = Turbine.getConfiguration() .getVector(TurbineConstants.MODULE_PACKAGES); ObjectUtils.addOnce(packages, GenericLoader.getBasePackage()); from Layout Loader... And it seems to me that commons-configuration getVector should be deprecated in favor of getSet(). I can't think why you would want duplicate values, so getSet() makes more sense then getList(). Then, funky call's like the ObjectUtils.addOnce() wouldn't be needed... Opinons? And do we have to deprecate getVector() since we haven't released from sandbox yet? Eric Pugh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [configuration] Change Commons-Configuration getVector to getSet?
A Set is too restrictive i think, there are valid reasons for preserving duplicate configuration entries. I would use a Collection or better, a List when the element order matters. Emmanuel Eric Pugh wrote: Hi all, I am looking at a chunk of code like this: Vector packages = Turbine.getConfiguration() .getVector(TurbineConstants.MODULE_PACKAGES); ObjectUtils.addOnce(packages, GenericLoader.getBasePackage()); from Layout Loader... And it seems to me that commons-configuration getVector should be deprecated in favor of getSet(). I can't think why you would want duplicate values, so getSet() makes more sense then getList(). Then, funky call's like the ObjectUtils.addOnce() wouldn't be needed... Opinons? And do we have to deprecate getVector() since we haven't released from sandbox yet? Eric Pugh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] smime.p7s Description: S/MIME Cryptographic Signature