|
Authored by: Anonymous on Thursday, April 26 2012 @ 12:19 AM EDT |
Is this any better?
You have a chef called main (chef::main) who has three other chefs that are used
to make a flour and egg dish.
The first of the three only whips eggs (chef::whip)
The second only mixed the flour and eggs (chef::mix)
The third only does the baking (chef::bake)
chef::main has 3 bowls ( bowl_egg, bowl_flour and bowl_mix) and one plate
(plate_done).
chef::main put 3 eggs into bowl_egg and flour into bowl_flour.
chef::main calls chef::whip and passes the bowl_egg.
chef::whip whips the eggs and returns the bowl _egg to Chef::main.
chef::main calls chef::mix and passes the Bowl_egg, the bowl_flour and the
bowl_mix.
chef::mix mixes the egg and flour and returns the result in bowl_mix.
chef::main calls chef::bake and passes the bowl_mix and the plate_done.
Chef::bake bakes the dish and returns the result on the plate_done.
There are three APIs here: chef::whip, chef::mix and chef::bake.
The definition and syntax of each API is:
Pass a bowl with eggs to chef::whip and get back a bowl with whipped eggs
Pass three bowls ( one with whipped eggs, one with flour and one empty to
chef::mix and get back a bowl with flour and eggs mixed.
Pass a bowl with mixes flour and eggs to chef::bake and get back a plate with
baked dish.
How each API is implement is up to the chef?
Chef::whip could use a hand whisk could use a whisking machine.
etc
[ Reply to This | Parent | # ]
|
- close... - Authored by: Anonymous on Thursday, April 26 2012 @ 12:59 AM EDT
|
Authored by: calris74 on Thursday, April 26 2012 @ 01:04 AM EDT |
* API name and syntax = the interface between
humans and computers.
The name and syntax are functional and
fixed because computers are absolutely
literal.
This is the interface. You said it yourself. This is the
API. It's a linguistic element. Name and syntax. Just like
the built-in
elements of an actual (uncopyrightable)
computer
language.
Not quite - The name and syntax is
the definition of
the API
The API really is that completely
intangible thing between
the part of your brain which has though I would
really
like this robot dog to play dead and the mechanical
components of
the dog which produce the play dead
position
(and there may be many
APIs in between)
Now this interface could have been some thought
reading
device attached to a radio transmitter which is then picked
up by a
receiver in the robot dog etc, etc, etc.
And that is why all this talk
of 'SSO of an API' is so much
nonsense - There is not 'SSO' to an API. SSO only
applies to
the definition and implementation of the
API.
Remember, in the computing world, you are very limited in
how you
define an API - You are limited by calling
conventions, register
usage, operating system
features, etc, etc. So, if you have a
program (let's
call it 'Spot the virtual dog') and you want anther program
running on the same computer (let's call it 'Bob the virtual
owner') you are
very
limited in how you can define and implement the API - You
can
connect a radio transmitter to Bob and a receiver to
Spot (well you could, but
that would be idiotic) - Bob has
to load up data in a bunch of CPU registers or
memory (and
Spot
has specified what registers and memory Bob must use)
and then call a function of Spot - e.g.
Spot.PlayDead()
Now,
somebody else could create an independent
implementation of Spot and Bob and
instead of calling the
function Spot.PlayDead(), they may have called it
Spot.DoTrick(string TrickName) and Bob would have to call
Spot.DoTrick("PlayDead") - But now you have fragmentation -
If you install Bob
on two computers with different versions
of Spot, how does it know how to make
Spot play dead?
These 37 APIs that are being argued over are exactly
Spot.PlayDead() - Sure, Google could have written an
entirely new set of APIs
but knowbody that knew Java would
have known how to program for Android - Sure,
the syntax is
the same, but everything else is completely different -
Java, to
every developer, is the Language + APIs (Classes,
methods etc). If Google had
done that, they would have had
Sun/Oracle suing them for fragmenting
Java.
If Google loose this case, Oracle will surely lose the war -
Google will develop a new language and APIs for Android,
submit them (like
VP8) to W3C, publish the lot as open
source and Java will die a slow, horrible
death.[ Reply to This | Parent | # ]
|
|
Authored by: Wol on Thursday, April 26 2012 @ 04:29 PM EDT |
You've just defined Forth :-)
Any and all programs are just extensions of the language :-)
Cheers,
Wol[ Reply to This | Parent | # ]
|
|
|
|
|