FWIW, I am a committer and I would prefer to see Oliver's approach. I am
open to discuss alternatives too of course.

(I read the message about Velocity but I'm not sure if I want to carry
the whole Velocity engine):

Here is my wishful thinking for this feature:

- Oliver's VariableResolver interface and what I'd like to call a
VariableFormat class (which was called Interpolation/Interpolator, names
I am not fond of).
- Extensible by [configuration]: The VariableResolver allows for
extension by [configuration].
- Easy to use with a Map (from System.getProperties()), which means that
a VariableMapResolver should to be provided I think. I would still like
to see an API that takes a Map (and uses the VariableMapResolver
internally) for simple looking call sites.

Gary

-----Original Message-----
From: Oliver Heger [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 28, 2005 11:53 PM
To: Jakarta Commons Developers List
Subject: Re: [lang] text.Interpolation, on to 2.2

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to