cocoacorbansproxy

CORBA on Mac OS X (Cocoa)


I am currently looking into different ways to support distributed model objects (that is, a computational model that runs on several different computers) in a project that initially focuses on Mac OS X (using Cocoa). As far as I know there is the possibility to use the class cluster around NSProxy. But there also seem to be implementations of CORBA around with Objective-C support.

At a later time there may be the need to also support/include Windows machines. In that case I would need to use something like Gnustep on the Windows side (which may be an option, if it works well) or come up with a combination of both technologies. Or write something manually (which is, of course, the least desirable option).

My questions are:

  1. If you have experience with both technologies (Cocoa native infrastructure vs. CORBA) can you point out some key features/issues of either approach? (EDIT: As I had already pointed out in this thread remote methods are unavailable for the iPhone and the iPad so far. On the other hand, there are CORBA implementations that work on either platform, e.g. "AdORB - CORBA ORB for Mac OS X and iPhone OS".)

  2. Is it possible to use Gnustep with Cocoa in the way explained above? [EDIT: According to the Gnustep FAQ entry 1.1.5 this is not possible, so using Cocoa's native infrastructure locks me into this technology.]

  3. Is it possible (and reasonably feasible, that is, simpler than writing a network layer manually) to communicate among all Mac OS clients using Cocoa's technology and with Windows clients through CORBA? [EDIT: From what I have learned now this is possible, but certainly not feasible. Messages would have to get forwarded both ways, i.e., one needs a "proxy" for forwarding messages from one system to the other and vice versa. This is essentially equivalent to writing a network layer manually with no practical benefit from either the NSProxy class cluster nor CORBA.]

UPDATE: CORBA seems to really be a better match when flexibility and extensibility is a concern. The downside is that it seems to be more complex to learn and also use initially, see this thread (link provided by Kristopher Johnson – thanks!) for different perspectives on the practical aspects. Webservices are a viable option as long as the communication pattern is simple enough, see this thread for options that work well on iOS. I have summarized my findings in this article.


Solution

  • The easiest way to implement distributed objects in Cocoa is with, well, Distributed Objects (or on Mountain Lion, XPC). This really is a very straightforward way to get RMI (here's a full example of DO). However these protocols are proprietary and can't be used with non-Apple platforms; while GNUstep does use DO and I've used their implementation successfully on cross-platform projects, their protocol is not compatible with Apple's. So you'd either have to use GNUstep in its gnu-gnu-gnu library combo on Mac OS X instead of Cocoa (which is not something I'd recommend), or choose a different approach.

    CORBA is one such "different approach". The main differences between CORBA and DO are: