commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <ebo...@micropole-univers.com>
Subject Re: [configuration] comma delimited properties
Date Wed, 25 Feb 2004 13:37:44 GMT
I wonder if we shouldn't even deprecate or remove the use of multiple 
properties on a single line. Currently we only support arrays for 
strings, but sooner or later I think we will add arrays for all the 
types supported (getIntArray, getByteArray, etc), and if we keep the 
property splitting, we will have to find a separator that works with all 
types simultaneously.

"," : conflicts with the grouping separator of a decimal format if we 
add a Configuration.getNumberFormat() method in the future.

":" : conflicts with URLs syntax if we add a Configuration.getURL() method.

";" : conflict with the DecimalFormat syntax. It may also be used in URLs.

"|" : maybe a good candidate for a default separator, until we want to 
add a basic type using it.

imho the multiple lines syntax is cleaner and easier to handle.

Emmanuel Bourg


Eric Pugh wrote:

> To be honest..  I think at some point we may be forced to do this in
> PropertiesConfiguration.(post 1.0!):
> 
> 1) If you want to do this: ldap.someproperty=this,is,a,real,list,of,values
> then you do this:
> ldap.someproperty=this
> ldap.someproperty=is
> ldap.someproperty=a
> ldap.someproperty=real
> ldap.someproperty=list
> ldap.someproperty=of
> ldap.someproperty=values
> 
> 2) setPropertyDelimator(";")
> ldap.java.naming.provider.url=ldap://server:390/ou=something,o=else,c=here
> ldap.someproperty=this;is;a;real;list;of;values
> 
> 
> In fact, maybe option 2 isn't so bad?  I mean, eventually you are going to
> have to make a decision, are ","'s a delimiter or not..  And why should it
> only be "," characters?  Would someone like to send in a patch and unit test
> for setStringSplitting and setListDelimiter?
> 
> Eric
> 
> 
> 
> 
> 
> 
>>-----Original Message-----
>>From: news [mailto:news@sea.gmane.org]On Behalf Of Stephane Bailliez
>>Sent: Wednesday, February 25, 2004 1:32 PM
>>To: commons-dev@jakarta.apache.org
>>Subject: Re: [configuration] comma delimited properties
>>
>>
>>"Emmanuel Bourg" <ebourg@micropole-univers.com> wrote in message
>>news:200402251024.LAA29028@vertigo-back.micropole.com...
>>
>>>I agree, i noticed this issue last month and suggested a patch :
>>>
>>>
>>
>>http://www.mail-archive.com/commons-dev@jakarta.apache.org/msg
>>33704.html
>>
>>>Basically it adds a setSplitString(boolean) method in the
>>>AbstractConfiguration class that enable or disable property
>>
>>splitting.
>>
>>Yes. Thought about that too, but I was wondering if it was
>>really judicious
>>to start adding such kind of methods here.
>>
>>Plus it does not really solve the problem at all because we
>>can have various
>>properties in the same subset that may need to be handled
>>differently and
>>I'm not sure it is the way to go to do
>>isSplitString()/setSplitString() in
>>retrieving properties. Think about this:
>>
>>ldap.java.naming.provider.url=ldap://server:390/ou=something,o
>>=else,c=here
>>ldap.someproperty=this,is,a,real,list,of,values
>>
>>Stephane
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message