This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Objective-C vs. gcj (was: Re: Newbie questions)


Maury Markowitz wrote:
> > Objective-C has a neat feature which makes it extremely simple to write
> > delegate classes.  The runtime attempts to dispatch a method invocation
> > [snip]
> > Similar tricks could be performed with Java reflection, I'd guess.
> 
>   That's interesting.  Ahhh, do you mean that we could use the
> reflection API in the runtime to see if the method is there and then
> re-dispatch?  Hmmm, that might be a "better" (as in leveraging
> existing functionality) solution that Obj-C's in fact.

Yes, Java reflection can do that.  In fact, if we fully supported JNI,
you could implement a proxy in Obj-C that would forward messages to the
libgcj runtime.  Essentially you could wrap a Java class in an Obj-C
class that way.

Without JNI, it would be harder... the libgcj runtime is mostly C++ and
Java, and you'd have to find some way to interact with the GC.

-- 
Jeff Sturm
jsturm@sigma6.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]