4

Pals,

I have a requirement to establish a communication channel between C++ and Java layer of my application for the exchange of objects and their properties.

I have got the following options:

  1. XML / SOAP
  2. Postgre SQL

Can you please advice me the Pros & Cons on these. Please share your experiences on the implementation complexities.

Thanks, Gtk

JSBձոգչ
  • 40,684
  • 18
  • 101
  • 169
  • 4
    Another option would be CORBA, which is designed for cross-language object support. – babbitt Sep 03 '10 at 18:43
  • 2
    Can you give us details on what your application does? – Alerty Sep 03 '10 at 18:43
  • 1
    Have you looked at google protocol buffers? – naikus Sep 03 '10 at 18:44
  • CORBA would be heavy, hence the clients are not interested in using it. The application has 2 layers(C++ & Java). The C++ layer builds its object information depending on the values returned from the Java layer. Java layer is also representing the same objects, but with different name, but same property. – pankaj pankaj Sep 03 '10 at 18:51
  • Can sockets be considered as an option? – Dr. Watson Sep 03 '10 at 18:57
  • Are your application's Java and C++ layers in a single process? There are simpler options for communications within a process. – Andy Thomas Sep 03 '10 at 19:12
  • CORBA heavier than SOAP.. hmm well library size might be bigger, but the consumed bandwith will MUCH lower.. – smerlin Sep 04 '10 at 01:03
  • 1
    @gtk: I might have not been clear. What is the purpose of your application (gaming, chatting, data input, etc.)? – Alerty Sep 04 '10 at 02:19
  • 1
    I do not believe it is possible to have an answer right now... We do not know the purpose of the application and depending on that it can change the pros and cons. – Alerty Sep 04 '10 at 02:25

5 Answers5

1

If the option is between those I would choose XML

Object <=> XML

Java side Simple, C++ side XML Objects

Reason, its simpler for what you want, i.e. pass language objects and not Data Base

Ah, could you specify the communication channel between the apps ?

UPDATE

If you can use JSON I would recommend it instead of XML, here is why.

Community
  • 1
  • 1
Hernán Eche
  • 6,529
  • 12
  • 51
  • 76
0

Another option would be JMS. There are C++ clients out there.

Nick
  • 1,340
  • 1
  • 15
  • 23
0

Every time I see XML I think RESTful web service. Both platforms you mentioned have some form of tooling to marshal & unmarshal XML. There are plenty of working examples out in the wild, so a Google/Bing search is good. A nice side-effect is once you have those interfaces built, anything can connect to them.

If you really want to bother with generating a WSDL, then feel free to go the SOAP route. However, speaking with several years of web service integration experience, RESTful is so gosh darned simple compared to anything else.

Tim Reddy
  • 4,340
  • 1
  • 40
  • 77
0

I would like to suggest a third option : YAML

You have parsing library in YAML for both java and C++. In my experience, it's easier to debug exchange in YAML that in XML (especially if you got full text field or cyclic data structure).

Guillaume Coté
  • 2,761
  • 2
  • 21
  • 28
0

I depends of the kind of message you transfer.

If your message are individual entity that have a short live, I would go for XML, YAML or something similar.

If your message contains information that is going to be used later on and refer to information in previous messages, I would use a database.

Guillaume Coté
  • 2,761
  • 2
  • 21
  • 28