You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Arnd Kohrs <ko...@castify.net> on 2002/12/19 18:53:50 UTC

[Beanutils] MethodUtils: private getMatchingAccessibleMethod()

Hi,

is there any particular reason why MethodUtils.getMatchingAccessibleMethod(...)
should have private access?

It would be nice if one could check if a method invokation is feasable
without invoking a method. 

Cheers,

Arnd.
-- 
Arnd Kohrs  -  Castify Networks


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Beanutils] MethodUtils: private getMatchingAccessibleMethod()

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On Friday, December 20, 2002, at 10:39 AM, Arnd Kohrs wrote:

<snip>

>     Robert> if you want it public, why not roll your own version from
>     Robert> the source?
>
> Overhead of duplication!
>
> I don't understand why a method which invokes a loosely specified method 
> is
> public, but a method which just tells me if a loosely specified method
> exists needs to be private?

you've hit on nail on the head :)

the methodutils API is poor and needs to be replaced by something more 
tightly specified. some work has been done on a new version of methodutils 
in the lang component but it's still under development.

> May be my reasoning has some merit, and
> MethodUtils.getMatchingAccessibleMethod() can be changed to public.  If
> this is not possible then maybe invokeMethod(...) should be deprecated.

i hope that the version of methodutils in beanutils will be deprecated as 
soon as the improved API taking shape in lang is finished. some other 
people may feel differently.

probably i'll see what other people think about changing 
MethodUtils.getMatchingAccessibleMethod() to public for the next release.

- robert


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Beanutils] MethodUtils: private getMatchingAccessibleMethod()

Posted by Arnd Kohrs <ko...@castify.net>.
>>>>> "Robert" == robert burrell donkin <ro...@blueyonder.co.uk> writes:

    Robert> On Thursday, December 19, 2002, at 05:53 PM, Arnd Kohrs

    Arnd> is there any particular reason why
    Arnd> MethodUtils.getMatchingAccessibleMethod(...)  should have
    Arnd> private access?

    Robert> yes - but it's a long story (and a little bit political) :)

I guess the reason is that it would be too hard to document its behavior
exactly ;-).  However, since I can use MethodUtils.invokeMethod(...), I have
implicitly access to it.

My use of it would be the validation of arguments for the creation of a
closure which evaluates to a call to MethodUtils.invokeMethod(...).  So
that if a closure is constructed without throwing an
"IllegalArgumentException", it is valid and may be executed without
anticipating a "NoSuchMethodException".

    Robert> if you want it public, why not roll your own version from
    Robert> the source?

Overhead of duplication!  

I don't understand why a method which invokes a loosely specified method is
public, but a method which just tells me if a loosely specified method
exists needs to be private?

May be my reasoning has some merit, and
MethodUtils.getMatchingAccessibleMethod() can be changed to public.  If
this is not possible then maybe invokeMethod(...) should be deprecated.

Cheers,

Arnd.

 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Beanutils] MethodUtils: private getMatchingAccessibleMethod()

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On Thursday, December 19, 2002, at 05:53 PM, Arnd Kohrs wrote:

> Hi,
>
> is there any particular reason why 
> MethodUtils.getMatchingAccessibleMethod(...)
> should have private access?

yes - but it's a long story (and a little bit political) :)

if you want it public, why not roll your own version from the source?

- robert


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>