Although I agree completely with the performance options noted here, it's worth
mentioning that the compiler isn't on your side when using reflection. Method
invocations aren't statically bound, nor do they enjoy the compiler-friendly
late binding semantics of polymorphism. This just emphasizes the "use
intelligently" warning of Rickard's post.
Mike
won't help much reflection requires a little extra care
Rickard �berg wrote:
> On Tue, 1 Aug 2000 15:04:20 -0400, James Cook <[EMAIL PROTECTED]> wrote:
>
> >Reflection is extremely fast for method invocation. To minimize your method
> >lookups, store them as you use them in a hashtable.
> >
> >You should notice no (negligible) performance hit using reflection.
>
> Absolutely. For example, the jBoss EJB container uses reflection to
> invoke the methods on the EJB instances, and the performance is very
> nice. And as James suggests, we store the methods in a hashtable for
> fast access.
>
> So:
> 1. Method invocation using reflection is fast
> 2. Method lookup from java.lang.Class is slow
>
> Use intelligently and it is ok.
>
> /Rickard
>
> --
> Rickard �berg
>
> Email: [EMAIL PROTECTED]
> http://www.telkel.com
> http://www.jboss.org
> http://www.dreambean.com
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
--
//////////////////////////////////////////////////////
//
// Mike Clark
//
// Clarkware Consulting
// Enterprise Java Architecture, Design, Development
//
// http://www.clarkware.com
// [EMAIL PROTECTED]
// +1.720.851.2014
//
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".