I have a quite complex project to migrate from C++ (Linux) to Java Currently, the C++ version is being distributed as a shared library (.so) followed by top-level interface header class. The implementation details are fully hidden from the final user.
This question is not about porting the C++ code to Java, but rather about creating similar distribution package.
Let's assume I have a very simple 'public' class in C++, topapi.h
:
class TopApi
{
public:
void do( const string& v );
}
The actual implementation is hidden from the API user. The actual project may contain another 100 files/classes do() will call.
The distribution will contain 2 files: topapi.so and topapi.h
Users will #include "topapi.h"
in their code, and link their applications with topapi.so
.
The questions are: 1. How can I achieve a similar effect in Java (hide the IP related code) 2. How do I show public methods to the user ( not related to code protection, just a java version of the header file above )