[109] in java-interest
Re: Binding in Java
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Mon May 22 20:28:20 1995
Date: Mon, 22 May 1995 17:12:57 -0700
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: java-interest@java.Eng.Sun.COM
Hi David,
[stuff deleted...]
> > Changes the API of objects often means that you have
> > to recompile all the code that uses the API. This is avoided in
> > Java by determining the offset at link time.
>
> At link time? I haven't come across that solution before. Let me
> make sure I understand this.
>
> In the unlinked form of a class, method calls specify a global
> selector (the same on all systems, and unique to that method).
> When you link the class into a particular system, the calls are
> patched to use the local offsets for each selector (so the
> loader or whatever must maintain a map between these two forms).
> From then on, you can do binding much as in C++, providing you
> are calling objects declared as classes, not interfaces.
Exactly right!
> If you are calling something declared as an interface, the binding
> has to be determined entirely at run-time, similar to Smalltalk
> or Objective-C. Ie. you look up the global selector in a hashtable,
> then cache the results for later.
Right again.
[more stuff deleted...]
> > The C program must specify an exact method signature. If the
> > method signature doesn't match exactly you will get an exception
> > and the method won't be called.
>
> If I read the docs in http://java.sun.com/1.0alpha2/doc/rpi/rpi_1.html
> correctly, there is no way for the C program to know the call is safe.
> I'd really like some way of checking this from C (for arbitrary calls).
Good point.
Have fun,
Arthur van Hoff,
x47242, UPAL02-301
http://tachyon.eng/~avh/
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com