6

I am trying to evaluate some technologies for implementing a communication process between some Ada modules with some C++/OpenGL modules. There is an (Windows XP) Ada application which communicates with a C++ application using COM, but I intend to switch the COM to a new technology. Some suggestions came up, such as direct Sockets, DSA, Polyorb, Corba and DSS/Opensplice.

  • DSA appears to be just Ada -implemented (not sure)
  • Polyorb has its last implementation on 2006, according to http://polyorb.ow2.org/
  • Corba someone argumented that it could be not simple enough to justify its complexity for implementing simple applications
  • DSS/Opensplice appears to be just C/C++ implemented, so an Ada binding should be done. It also looks to be not very simple to be implemented too.

Personally I like COM, but due to the migration, I'd rather take the sockets option due to its simplicity, and the interface architecture could be implemented very easily.

So, what you think? Could you please comment about these technologies or even suggest other more?

Thanks very much.

Rego
  • 1,118
  • 1
  • 18
  • 40
  • 4
    Before you fall into the trap of thinking that sockets are "simple", consider the amount of stuff you'll have to build on top of your bare sockets layer to support a performant, flexible and scalable IPC mechanism. For more details, see this answer of mine from another question: http://stackoverflow.com/questions/6067538/restful-web-services-vs-socket-programming-for-a-data-intensive-application/6067635#6067635 – Brian Kelly Oct 20 '11 at 16:55
  • 1
    Polyorb appears to be actively maintained by AdaCore, with quite recent updates. You can browse the repository at http://libre2.adacore.com//viewvc/trunk/polyorb/ – Marc C Oct 20 '11 at 17:08
  • 1
    CORBA should do the trick, polyorb is an option, you could also develop as language binding for an existing oRB, we have for example already created a Ruby binding for TAO, a new C++11 binding for TAO and a JRuby binding for JacORB. Also check out http://www.orbzone.org. If you want to use DDS, consider creating an Ada binding for OpenDDS (see http://www.opendds.org/) – Johnny Willemsen Oct 20 '11 at 17:17

5 Answers5

5

A big factor in your choice is the size and complexity of the system you're reengineering. Is it a broadly distributed system with lots of complex messages? Is it a relatively small system with a handful of mundane message exchanges?

For small systems I used to just roll-my-own socket-based comm modules. Now, though, I lean more towards ZeroMQ (brokerless) or STOMP (text-based). And there's some Ada support for these, zeromq-Ada and TOMI_4_Ada (supports both).

While these handle the distribution mechanics, you would still need to handle the serialization of the messages into transportable form.

CORBA/PolyORB and DDS solutions are rather heavyweight, but are complete solutions. If you don't fear IDL and managing brokers, they can do well for large-scale distributed systems. Yeah, there may need to be some Ada bindings built, but if you can get C headers or a C API to bind to, it's typically not too bad if you focus on just binding the functions and data structures you require. Rather than creating a comprehensive binding, liberally employ opaque and void pointers (void_ptr, opaque_structure_def_ptr) for structs and parameters whose internal contents you don't care about.

Marc C
  • 8,664
  • 1
  • 24
  • 29
  • I took a look into zeromq-Ada, it sounds very interesting. Code is opened but there is the possibility of support if we need. Thank you Marc. – Rego Oct 20 '11 at 19:28
3

we intend to switch the COM to a new (suported) technology, since COM is not more supported by Microsoft

Whoever told you COM is no longer supported is totally clueless.

While COM has undergone many name changes (OLE, COM, OLE Automation, DCOM, COM+, ActiveX, WinRT) and extensions over the past decades, it is the single most important technology for MS platforms: past, present and future. The .NET runtime uses COM extensively. Much of the Win32 API is written in COM, and the portions that weren't, will be in Win8, since WinRT components are COM objects.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
  • Well, just had to discover why several COM apps from our framework stopped working after installing SP3 Win XP. If we did not migrate to a new COM-based as .NET, several features of our app would be compromised. For safe/critical sw it's not acceptable that the communication protocol is changed always the OS is upgraded (frequent with Windows), then we had to try a more stable approach. Also, Ada has the very good COM binding GNATCOM, which is not under development anymore. I appreciate your opinion, and agree that COM has sucessors, but do you have any suggestion to the question? Thanks – Rego Oct 20 '11 at 23:57
  • @Rego: These aren't successors to COM, they are COM. Or use COM. Any code that follows the COM rules still works, if some apps stopped working on XP SP3, I can only think that either (1) they used some particular component which was removed for security reasons or (2) they relied on undocumented behavior instead of following the documented rules. – Ben Voigt Oct 21 '11 at 00:26
  • @Rego: Also, there are multiple possible reasons for a product not being under development anymore. It could be abandoned, or it could be stable. It sounds like GNATCOM is stable. – Ben Voigt Oct 21 '11 at 00:28
2

Also take a look at AMQP (RabbitMQ for server), there seems to be Ada library available for it http://www.gti-ia.upv.es/sma/tools/AdaBinding/index.php.

If you could find binding for Ada, Apache thrift might also be a lightweight option. Maybe you could even write your own binding, it should not be more difficult that rolling something of your own over the sockets.

If you do go sockets route, than I would suggest ZeroMQ as "supersockets".

Marc C
  • 8,664
  • 1
  • 24
  • 29
Davorin Ruševljan
  • 4,353
  • 21
  • 27
  • That AMQP binding, "adaqpid", was very minimal and fragile, IIRC, and I finally gave up trying to extend its capabilities. Plus, it's a half-assed archive, also including the latest backup file versions made by the editor (indicated by the '~' suffix on several filenames), and not including *any* README or build guidance. In TOMI_4_Ada, linked above, I did my own partial AMQP binding based on OpenAMQ's WireAPI. – Marc C Oct 21 '11 at 12:00
1

One more option for your list should be to use Ada's distributed programming support, and write C/C++ wrappers to interface your C++ program into it.

I don't know that its the best option for your needs, but if your Ada compiler supports Annex E, it should be on the list.

T.E.D.
  • 44,016
  • 10
  • 73
  • 134
  • I will check Annex E. I guess my compiler supports it. Thanks TED. – Rego Oct 20 '11 at 23:58
  • Actually, when last I checked (admittedly quite a while ago), few Ada compilers supported that particular annex. However, if you happen to have one of the ones that does, you may be in business. – T.E.D. Oct 21 '11 at 13:08
0

Since this post, AdaCore published PolyORB on GitHub with regular updates :)

Frédéric Praca
  • 1,620
  • 15
  • 29