|
Authored by: Anonymous on Friday, April 27 2012 @ 01:39 PM EDT |
Pardon [ Reply to This | Parent | # ]
|
|
Authored by: Anonymous on Friday, April 27 2012 @ 09:09 PM EDT |
A hidden API can not exist if you have the source code publicly available.
The terms "Public" and "Private" in C++ and Java are only
design contracts telling the compiler that source code outside this class
(typically outside the file) can only interact with functions (methods) and
variables (fields) that are marked "Public".
The API is full of publicly known data that is marked "private" It's
no secret how the code will work, or that those functions and variables exist,
just that you can't access them from an external class.
"Protected" is also used. This means Only this class and any of it's
child classes (subclasses) that inherit from the class can access the field or
method. We know it's there, but if we're not a direct decedent then the
compiler won't let us use it. We can easily gain access to anything that's
protected by saying "I inherit form that thing over there wot has the
protected stuff" It's a bit difficult to gain access to the private bits,
you have to edit the source code of the private method / class.
You're free to modify the Java API and implementation, but the programs you
create won't run on someone else's version of the Java VM.
A Hidden API is really just an Undocumented API. It's a set of functions and
variables that do exist, but are unpublicized -- Windows has a lot of
Undocumented API. The hidden part is that it's the documentation that's hidden
-- If you figure out the function's location and it's signature, you can make
use the hidden API.
In C/C++ To make a hidden API, simply don't publish the header file. In Java?
There are no header files -- The header file information is mixed in with the
source code. The Javadoc tool extracts this data. Oracle is essentially suing
over Header Files (ring any SCO bells?).
In Java the compiled .class files contain all the function names, you can't hide
much because a decompiler directly reveals "Look! Functions that aren't in
the Docs"
Now, in C++, all of your class's "private" functions and variables
must be listed in the class's declaration -- In the header file, along with all
the "public" functions and variables.
"Public" / "Private" is really just an advisory. In C++ you
can totally ignore the advisory by using two lines of code before you #include
the API / header files:
#define protected public
#define private public
Now the compiler will replace all occurrences of "protected" or
"private" with "public" and you can ignore any such
artificial restrictions.
In C++ if you remove the header files, then the code can't compile. In Java the
header file data is within the source code, so it's a part of the implementation
files. The Javadoc tool extracts the ideas about how the implementation works
-- That's the API. The "how to use this"
In short: A hidden API is one that exists that someone hasn't disclosed the
documentation for. If you can figure out how it works, you can still use it.
To note: When Sun licensed Java under the GPLv2, they agreed to license the
source code as well as its API (Application Programmer's INTERFACE):
"The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all the
source code for all modules it contains, plus ANY ASSOCIATED INTERFACE
DEFINITION FILES, plus the scripts used to control compilation and installation
of the executable."
-GNU GPL
Caps emphasis mine... That Application Programmer's Interface (API) is an
associated file that defines the interface.
This whole case should be thrown out. The patent claims are the only thing that
should be considered. I mean, unless SCO should have won, and Linus is wrong
about header files, and Linux is infringing on Unix.[ Reply to This | Parent | # ]
|
|
|
|
|