Alexey Panchenko <[EMAIL PROTECTED]> writes:

>[EMAIL PROTECTED] wrote:

>> Add Get and Set Executors that are smart about Maps. This should be a
>> significant speedup if you have context objects that are maps and use
>> get() and put() extensively. Makes VELOCITY-449 ready to be closed.

>//skipped

>> +    protected void discover (final Class clazz)
>> +    {
>> +        Class [] interfaces = clazz.getInterfaces();
>> +        for (int i = 0 ; i < interfaces.length; i++)
>> +        {
>> +            if (interfaces[i].equals(Map.class))
>> +            {
>> +                try
>> +                {
>> +                    if (property != null)
>> +                    {
>> +                        setMethod(Map.class.getMethod("get", new Class [] { 
>> Object.class }));
>> +                    }
>> +                }
>> +                /**
>> +                 * pass through application level runtime exceptions
>> +                 */
>> +                catch( RuntimeException e )
>> +                {
>> +                    throw e;
>> +                }
>> +                catch(Exception e)
>> +                {
>> +                    log.error("While looking for get('" + property + "') 
>> method:", e);
>> +                }
>> +                break;
>> +            }
>> +        }
>> +    }

>Is there any need in this method?

It is required by our current API, yes. :-) 

>I think it would be better to introduce new interface (e.g.
>IAbstractExecutor) with methods:

>Object execute(Object o) throws IllegalAccessException, 
>InvocationTargetException;
>String getMethodName();

>So MapGetExecutor implements only the needed two methods and does not
>care about other members.

I fully agree with you here (I don't like the I<xxx> thing though, we
don't use that naming convention anywhere else, but I agree with the
concept) but I'm a bit uneasy to apply this right before the 1.5
release. I'd be very happy with that patch for the 1.6 development
time frame.

If we can also unify the set/get stuff to be able to use a single
interface to discover getter and setter (thus reducing the number of
classes), that would also be great.

        Best regards
                Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
[EMAIL PROTECTED]        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

Social behaviour: Bavarians can be extremely egalitarian and folksy.
                                    -- http://en.wikipedia.org/wiki/Bavaria
Most Franconians do not like to be called Bavarians.
                                    -- http://en.wikipedia.org/wiki/Franconia

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

Reply via email to