|
Authored by: Ed L. on Thursday, April 19 2012 @ 09:20 PM EDT |
N'ere sipped the dll Kool-aid, but in general Google's description is correct.
Certainly for source code, which is what is at issue here, a class method is
defined by class name, method name, return type, and parameter list with
parameter order and type. Surprised a mere lawyer nailed it so well. Must have
paid attention to Mr. Page.
I'm not a Java programmer, and got no dog in
this fight. The usual Posix API to access a function in a shared library
is
void *dlsym(void *handle, const char
*symbol);
which takes a handle to the shared library as
returned by dlopen(), and the symbolic character name of the library function
the programmer wishes to access. The address of the function is returned. Note
that this is "C" code that may be wrapped by any other language that uses the
Linux (ELF) shared library mechanism. How that misapplies to Java with its VM
and .jar files, is something I just don't know. :-)
--- Real
Programmers mangle their own memory. [ Reply to This | Parent | # ]
|
- API names? - Authored by: greed on Thursday, April 19 2012 @ 10:08 PM EDT
- API names? - Authored by: Anonymous on Friday, April 20 2012 @ 01:12 PM EDT
|
Authored by: jbb on Thursday, April 19 2012 @ 09:31 PM EDT |
A method declaration is a statement that defines an
API
*element name*, return type, parameter type and order
This is
exactly what a method declaration is. I've never heard of calling functions or
methods by number before. That does not make sense. Calling them by address
makes a little more sense but AFAIK nobody does that.
Sometimes system
calls are done by number. For example, BIOS calls are numbered because interrupts are
used. If you have any more information about call-by-number I would be curious
to see it. Sounds a little like paint-by-number for
programmers.
---
Our job is to remind us that there are more contexts than the one that we’re in
— the one that we think is reality.
-- Alan Kay [ Reply to This | Parent | # ]
|
|
Authored by: Anonymous on Thursday, April 19 2012 @ 11:33 PM EDT |
You are thinking of COM.
On Windows, when making COM calls, they are all made by a numeric ID. You end up
always calling a method named InvokeEx with parameters for method id, input and
output.
There is actually a second method that lets you map names to ids, and another
way
to list the names, but these are optional. At least they are optional in C++.
I believe this is where Microsoft's "undocumented APIs" issues come
from. You can easily code in responses to undocumented, unnamed ids and there
is no easy way to
tell what they do or even that they exist. [ Reply to This | Parent | # ]
|
|
Authored by: BitOBear on Thursday, April 19 2012 @ 11:39 PM EDT |
Your experience with DLLs makes you wrong.
The actual "virtual machine" instruction to call a member function
(and all functions in java must be members of a class) takes the literal, case
sensitive, name of the function and causes a string lookup at runtime. There is
no other means of invocation.
The actual instruction is "invoke_method" (and friends).
The "just in time" compilers etc -may- substitute low level (real
machine) instructions for calls at runtime -after- evaluation by name and
-after- the -target- method from the class has been compiled to machine code as
well. But that that point the computer isn't running "java" any more,
its running "equivalent" assembly.
In java, just like in any interpreted language, you call by symbol name. Java is
compiled to byte-code and that byte-code is interpreted in almost every setting.
Certainly so in any setting/platform where JIT compilation and such exist.[ Reply to This | Parent | # ]
|
|
|
|
|