Publish a C++ Version of Your Java API
In the previous use cases we talked about leveraging Java code in your C++ application, but many of our customers are actually developing products in Java. They have decided that offering a C++ integration API for their product gives them a competitive advantage.
Using JunC++ion, our customers generate C++ proxy types for their product and then usually ship the header files and a set of libraries for their customers to use. The C++ developers compile against the supplied header files and link with the supplied libraries.
Now, to be fair, this approach is not for everyone. If you wish to have a pure C++ solution and you cannot have Java be a part of your solution, then this is not for you because at runtime the integrated product still requires a JVM and the Java types for which the C++ proxies were generated.
Some vendors, mostly those with a product that performs a communication service over sockets, can provide a pure C++ API for their product because at its heart is a wire protocol and not a Java type. Their Java APIs are often themselves just a bridge to the underlying protocol. This is not the general case.
If you publish a Java product with a sizable API that your customers use, you can take any one of several approaches with respect to C++:
Port it to C++ and maintain a C++ version in addition to a Java version.
Just say no. We have seen this before and it never ended well. The C++ version was never bug-compatible with the Java version, the only version where there was no feature lag between the two implementations was 1.0, the effort was usually abandoned after a few years because of cost and the few C++ customers were left stranded and angry.
Don't worry about providing C++ bindings.
This might be a legitimate option for you. Some Java products might not be able to compete in C++ or you decide that there is just not enough of a market to make it worth your while. If one of your customers really wants to do this, he can search the web, discover JunC++ion, and do the integration himself.
Don't do it yourself but investigate and recommend JunC++ion to your customers.
You always want to give your potential customer as few reasons to say "no" as possible. Being able to say: "We have tried this and it works. We can support you if you want to do this." can make a huge difference. All you need for this is a Starter Kit. It also helps to have a working relationship with us because then you can give us a heads-up before your customer approaches us and we know what to expect.
You do it and you proudly use the availability of C++ bindings as a competitive edge.
You can give your customers a working C++ integration solution that is always in sync with your Java product. Depending on your competitive position, you might charge your customer extra for the C++ API or you might use it as a distinguishing characteristic and give it away.
Which path is right for you depends on a lot of factors but we recommend that you make an educated choice and don't just ignore the question.