On 7/13/01 5:51 AM, "Geir Magnusson Jr." <[EMAIL PROTECTED]> wrote:

> Jon Stevens wrote:
>> 
>> on 7/11/01 8:44 PM, "Geir Magnusson Jr." <[EMAIL PROTECTED]> wrote:
>> 
>>> I dunno ...  I run across this a lot, and quite frankly it doesn't
>>> bother me to just do a new <FOO>.
>>> 
>>> The problem that I see is that this makes the API for VelocityContext
>>> different than that of Context - so if you get into the [bad] habit of
>>> using the helper methods instead of just using something like
>>> 
>>> context.put( "foo", new Integer(2));
>>> 
>>> then when you move that code into a more generic situation where you are
>>> passed a Context rather than a VelocityContext, all will break. (Don't
>>> even suggest this for the Context interface...:)
>>> 
>>> geir
>> 
>> More detail needed:
>> 
>>     Why exactly is it bad?
>> 
>> -jon
> 
> Why is adding to the Context interface bad?  Because then every
> implementation of Context then has to support those methods.  It takes
> the interface from 5 methods to 13 methods, with no real functional
> addition other than you can avoid typing 'new <CLASS>( arg )' when you
> want to convert a primitive to an Object.
> 
> It's a nice convenience, but is that worth it?

No. I don't think so.
 
> geir
> 
> 

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons


Reply via email to