PDA

View Full Version : C++/Java interface


fconrotte
11-03-2008, 05:24 PM
Hello,

One of our customers needs to interface C++ libraries within a Java framework.

There are several options to do this: JNI or http://swig.sourceforge.net (http://swig.sourceforge.net/) (used by Quantlib).

Did anyone tried these solutions ? What's your experience ?

Kind regards,

Frederic

alain
11-03-2008, 06:21 PM
I have used JNI. It works but you have to keep in mind the memory model. I have heard a lot of good things about SWIG but I've never used it myself.

What do you plan to do? What kind of library are you planning to expose?

fconrotte
11-03-2008, 06:25 PM
Thanks for your answer.

The library to expose is FEA @Interest:
FEA - @INTEREST (http://www.fea.com/products/interest.asp)

What do you mean by memory model ? Heap and stack memory management ?

alain
11-04-2008, 10:15 AM
the main issue I have had in tha past is passing objects between different memory spaces. Things need to be passed between two different memory spaces and in one of them, Java, you have little control because of garbage collection.