6

I need to establish a communication model between C++ layer and Java layer in my application. Initially, I planned to use SOAP with XML, but my clients are interested in setting up a database communication channel.

I am new to DB and not sure how to proceed. I would like to take your sincere suggestions on the implementation of communication in terms of objects between C++ and Java layer using database.

Thanks, Geet

4
  • How do the two layers interact with the database? Do you need to call C++ code from Java or the other way round?
    – dirkgently
    Sep 1, 2010 at 16:20
  • No the expectation is to build the database of objects in the Java layer and query the details from C++ layer and populate the object properties. Sep 1, 2010 at 17:27
  • Convince your clients that CORBA will be a less masochist approach. Sep 1, 2010 at 17:33
  • Are you trying to convert objects from C++ to Java (i. e., convert C++ strings to Java strings, and vice versa)? Sep 8, 2012 at 22:35

3 Answers 3

6

Database as communication? shudder

http://en.wikipedia.org/wiki/Database-as-IPC

This is an anti-pattern. Can you change your clients' minds?

Sockets are easier than a full blown SOAP interface.

2

If you have 2 different applications communicating, sockets is the way to go. If your C++ layer is more like a library, you could also use JNI (http://en.wikipedia.org/wiki/JNI, google for tutorials).

1

The choice of communication channel and blocking model is largely application dependent but sockets will probably work best if you don't need to worry about security. SSL/Mutual auth is your next step up.

I rolled my own, but I would use google protocol buffers if I had to do it all again. http://code.google.com/p/protobuf/

They seem to capture much of what people wanted out of ASN1 (but not all messed up) and let you do what people often try to do with serializing java Properties.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.