commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <heg...@med.uni-marburg.de>
Subject Re: [lang] text.Interpolation, on to 2.2
Date Wed, 29 Jun 2005 06:52:58 GMT
Emmanuel Bourg wrote:
> Simon Kitching wrote:
> 
>> You mean that someone with special resolving requirements should provide
>> a custom class that implements Map?
> 
> 
> Yes that's what I mean.
> 
> 
>> However for the other cases the user has to implement the Map interface
>> which it's quite a lot of work. As the resolve method actually uses only
>> the "get" method on the map it seems a shame to require the user to
>> implement the full Map interface.
> 
> 
> On the other hand, if the resolve method guarantees that it will only 
> use the get() method from the Map interface, the user is free to let the 
> other methods unimplemented. The hint could be included in the javadoc, 
> this should be enough for the minority of users interested in 
> implementing a custom variable resolution.
> 
> Emmanuel Bourg
> 
> 

Okay, a map would be enough, but this would be a very minimalistic 
solution. So if nobody of the [lang] committers had strong feelings 
against such a simple VariableResolver interface (and a map-based 
default implementation), I would prefer this approach.

One benefit is that an interface is always a hint for a developer that 
it is possible to provide a different implementation. With an 
interpolation method that only takes a map it is probably not as obvious 
   that a specific map can be written to extend the existing functionality.

Oliver

---------------------------------------------------------------------
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