|
Authored by: Anonymous on Wednesday, April 25 2012 @ 07:11 PM EDT |
...and instead describe it as it really is? Beacause it
really isn't THAT much more complicated than plugs and
sockets. But it's different enough that any analogy will
fail.
In order to understand it all, you just need to distinguish
clearly between API and ABI (Application Binary Interface).
What happens in a computer (on the instruction level) when a
subroutine (method in this case) is invoked is simple:
The arguments to that subroutine are stored in a globally
accessible location (the stack), one after another. Then the
computer is instructed to fetch the next instructions from
the subroutines memory adress. (Instead of the immediately
'adjacent ' ones) The subroutine then fetches the previously
stored arguments, one after another, exactly in the order
passed. (Maybe reversed order, depends, but same order
nevertheless). Thats it.
Because of that, the order is of utmost importance. If you
would put the arguments in the wrong order in the memory,
everything would go baloops.
So in order to call a subroutine, you need to know
a) the address of the subroutine in memory and
b) the order and type (int, float, string etc.) of its
arguments.
THAT is called the ABI. I dunno for sure, but I expect the
ABIs of the JVM and Dalvik to be very different, especially
since one is purely stack based and the other register
based... You can pass arguments in registers too, don't need
no stinkin' stack for that. In the JVM of course, there is
only the stack. Very different architecture, indeed.
Now since all of this is just machine/bytecode, and
programmers are writing source code, you need a way for the
compiler to know which address and order of arguments the
ABI expects. Out comes something like
java.lang.Math.atan2(float a, float b).
The order of arguments is given by the second part of a
method definition, like (float a, float b). a and b in this
example are just arbitrary identifiers, so (float arg0,
float arg1) would be a different definition to exactly the
same ABI...
The address is determined by the first part of a name, like
java.lang.Math.atan2. Which name you map to which subroutine
address is totally arbitrary, you could as well call it
android.Math.atan. Doesn't make a difference. Not a single
bit.
Even all that talk about packages is totally irrelevant,
because the dots in the name are just a way to make address
mapping easier. For the user of an API it has absolutely no
impact.
Except that you would expect all the java.lang stuff to be
there, and to have exactly the same definition. Because its
java.LANG, for gods sake!
So, thats what an API is: a collection of method
definitions, which are just a convenient way to use ABIs.
Which are ways to access subroutines in machine/bytecode.
What this all means legally i really can't say, but making
up tons of failing analogies for such a simple concept is
surely not helping to get the legalities sorted out.
No offense, just trying to give a concise and ACTUAL
description of the thing at dispute. To few of that going
on, i fear...[ Reply to This | Parent | # ]
|
|
|
|
|