|
Authored by: Anonymous on Friday, April 20 2012 @ 05:14 PM EDT |
"I also recall reading something about tactics for
separating
your API from you implementation in c/c++ that give people a
usable header with out revealing anything about your
internal data structures."
Keep in mind that in this context, "without revealing
anything" has to do with prevention of programming errors.
It is not a security or licensing issue, at least not
primarily.
The interface (called "interface" in Java, class
declarations in C++, function prototypes in C) is what the
library maintainer promises not to change. It is how the
code looks from the outside, so to speak.
The programming reason to separate the interface from the
implementation is to keep the details hidden, mainly so that
any programmers using the library in their code will not
rely on these details. This allows library programmers to
rewrite the implementation of a function without causing
client programs to break when the library is upgraded.
Of course, proprietary companies will take advantage of this
separation to hide the implementation as their top-secret
"special sauce", and more recent languages like Java
facilitate this, but the original reason was one of dividing
responsibility in a clean and maintainable way.[ Reply to This | Parent | # ]
|
|
Authored by: Anonymous on Saturday, April 21 2012 @ 02:04 AM EDT |
Java doesn't have "headers" or separate interface definition files.
All of the
metadata is included in the compiled class file, even the documentation. [ Reply to This | Parent | # ]
|
|
|
|
|