commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Pugh <ep...@upstate.com>
Subject Re: [configuration] Property Substitution Policy
Date Tue, 30 Aug 2005 02:05:22 GMT
Does this suggest that we need to be able to hand in a  
"InterpolationStrategy" object to Commons Config?  Maybe start out  
with a default that is based around the existing logic, and then  
allow other people to provide there own?  Versus adding more booleans  
and flags to the existing logic?

Eric

On Aug 26, 2005, at 10:02 AM, Oliver Heger wrote:


> Moran Ben-David wrote:
>
>
>
>> Hi guys,
>>
>> Thanks again for inspecting this problem with me and hashing out  
>> my various
>> options.  I have taken the liberty of making some modifications to  
>> 2 classes
>> in Commons Configuration (attached) in order to get it to do what  
>> I wanted.
>>
>> Is it possible to contribute this to Commons Configuration?  I've  
>> tried to
>> do a good job in this code change by providing the test case.  I  
>> plan to use
>> commons configuration for as long as I can think and would hate to  
>> have to
>> make this change for every new version I get.
>>
>> The summary of these changes is that I added a Boolean flag to  
>> tell the
>> interpolation algorithm whether to substitute using the entire  
>> multi-valued
>> property or just the first value.  I.e., an if statement  
>> determining whether
>> getString or getPoroperty are used.  I added a test case for this  
>> in what I
>> think is the appropriate place.
>>
>>
>>
> Hm, I am wondering if we need the flag and the handling of multi  
> valued properties at all.
>
> The interpolate() method is called at two different places: in  
> getString() for interpolating the return value and in getStringArray 
> () for processing the single array elements. This context IMO makes  
> it quite clear that its result should always be a single value and  
> not a somehow to a string converted list of values. This will then  
> be consistent with how getString() itself deals with multi-valued  
> properties.
>
> IIRC your original question was how to turn off those multiple  
> return values. So I suppose you do not have a concrete use case for  
> this behavior either, do you?
>
> So I would suggest to fix interpolate() to always return the first  
> value if there are multiple.
>
> Oliver
>
> <snip>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>



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


Mime
View raw message