Question

Is there any library out there that will allow developers to pass objects from one language to another and then manipulate/change the objects and pass them back?

This would be a great and simple alternative to Messaging and XML systems out there. I read about Colors which seemed to be what I was searching for but from what I understand it hasn't been released yet.

In my Java application (or any language, but java for this example) I'd like to use something like:

import beans.Person;

...

PythonObj pythonObj = new PythonObj("http://192.168.1.54/personGET/myusername/mypassword"); 
Person person = pythonObj.getPerson();

Which would consume an object published by Python via GET.

So I'm guessing there would need to be a library for each language. No need for any external boilerplate strings/files (xml, json, csv, proto, etc etc) for configurations, etc. Just the library import...

Was it helpful?

Solution

If you only need to project the existing objects information and pass it through the systems, XML and JSON would be enough (I would also recommend BSON to improve performance and lower throughput).

If you want a different approach, I would suggest you to take a look at Google ProtoBuffers, for a more elegant and securely mantainable solution.

For example, you can define your communication contract in a Proto message file as the following (e.g.: person.proto):

message Person {
  required int32 id = 1;
  required string name = 2;
  optional string email = 3;
}

And then you can generate Java and C# objects to handle this message, allowing you to easily communicate between the systems.

EDIT: Also, take a look at Apache Thrift.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top