How to define common interface between C and Java modules.

M

Maneesh

Hi,

How can I define the interface between two subsystems where one is C
based and the other Java based. And once we define that interface, we
need to control it / baseline it.

Thereafter both subsystems should pick up the controlled interface file
and do their release builds with it.

So, if I define the interface using IDL(Interface Definition Language)
- I'd need a utility to generate Java classes and C header files from
the IDL.
And, if I define the interface using XML - I'd need a utility to
generate Java classes and C header files from the XML.

Can someone please help in identifying any other way to meet the
scenario.

-Maneesh
 
H

HalcyonWild

Maneesh said:
Hi,

How can I define the interface between two subsystems where one is C
based and the other Java based. And once we define that interface, we
need to control it / baseline it.


Hi Maneesh, try JNI. Its a bit tedious though.
There arent many good guides on JNI available, you can try Thinking in
Java 2nd Ed (its the appendix :) )(note that its not there in 3rd ed.
). The only other place is the Sun Java tutorial itself.
There is a framework called Jace. Search for it on Sourceforge.net. It
too is complicated though. It defines the interface for you.
If you want to map simple types like String, int, double etc, JNI is
not so complicated, but when you want to map your custom C++ classes to
Java classes or vice versa, it becomes pretty complicated. Try it out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top