Mac OS X 上的 CORBA (Cocoa)
我目前正在研究在一个最初专注于 Mac OS X(使用 Cocoa)的项目中支持分布式模型对象(即在多台不同计算机上运行的计算模型)的不同方法。据我所知,可以使用 NSProxy
周围的类集群。但似乎也有支持 Objective-C 的 CORBA 实现。
稍后可能还需要支持/包括 Windows 计算机。在这种情况下,我需要在 Windows 端使用类似 Gnustep 的东西(如果运行良好的话,这可能是一个选项),或者想出两种技术的组合。或者手动编写一些内容(当然,这是最不理想的选择)。
我的问题是:
如果您对这两种技术(Cocoa 本地基础设施与 CORBA)都有经验,您能指出这两种方法的一些关键特性/问题吗? (编辑:正如我已经在 此线程 远程方法到目前为止不适用于 iPhone 和 iPad。另一方面,有可在任一平台上工作的 CORBA 实现,例如“AdORB - 适用于 Mac OS X 和 iPhone OS 的 CORBA ORB"。)
是否可以按照上述方式将 Gnustep 与 Cocoa 一起使用? [编辑:根据Gnustep FAQ 条目 1.1.5 这是不可能的,因此使用 Cocoa 的本机基础架构将我锁定在这项技术中。]
是否可以(并且相当可行,即比手动编写网络层更简单)进行通信在所有使用 Cocoa 技术的 Mac OS 客户端和通过 CORBA 与 Windows 客户端之间? [编辑:从我现在了解到的情况来看,这是可能的,但肯定不可行。消息必须双向转发,即需要一个“代理”来将消息从一个系统转发到另一个系统,反之亦然。这本质上相当于手动编写一个网络层,而没有从
NSProxy
类集群或 CORBA 中获得任何实际好处。]
更新: CORBA 似乎在灵活性方面确实是更好的匹配可扩展性是一个问题。缺点是它的学习和使用似乎更复杂,请参阅此线程(链接由克里斯托弗·约翰逊提供 - 谢谢!)对实际方面的不同观点。只要通信模式足够简单,Web 服务就是一个可行的选择,请参阅 此线程 提供在 iOS 上运行良好的选项。我在本文中总结了我的发现。
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:
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".)
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.]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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 Cocoa 中实现分布式对象的最简单方法是 分布式对象(或在 Mountain Lion 上,XPC)。这确实是获取 RMI 的一种非常简单的方法(这里有一个完整的 DO 示例)。然而,这些协议是专有的,不能用于非 Apple 平台;虽然 GNUstep 确实使用 DO 并且我已经在跨平台项目上成功使用了它们的实现,但它们的协议与 Apple 的不兼容。因此,您要么必须在 Mac OS X 上的
gnu-gnu-gnu
库组合中使用 GNUstep,而不是 Cocoa(我不建议这样做),要么选择不同的方法。CORBA 就是这样一种“不同的方法”。 CORBA 和 DO 之间的主要区别是:
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:
FWIW,除非您有需要与之交互的现有基于 CORBA 的基础设施,否则我不会使用 CORBA。
CORBA 在当时还不错,但它是一种“垂死”的技术,并且您将很难获得未来必要的支持。还有一个相当陡峭的学习曲线。
如果你想要跨平台的东西,我也会远离 Cocoa/Gnustep 的东西,因为除了 OS X 和 iOS 之外,它确实没有得到很好的支持。
我认为您最好把时间花在弄清楚如何使用 Web 服务、SOAP 或其他主流跨平台集成技术上,而不是掌握这些遗留技术。
FWIW, I wouldn't use CORBA unless you have existing CORBA-based infrastructure you need to interface with.
CORBA was OK in its day, but it is a "dying" technology, and you are going to have a hard time getting the necessary support going forward. There is also a pretty steep learning curve.
I'd stay away from the Cocoa/Gnustep stuff too, if you want something cross-platform, as it really isn't very well supported anywhere other than OS X and iOS.
Rather than mastering these legacy technologies, I think your time would be better spent figuring out how to use Web Services, SOAP, or other mainstream cross-platform integration technologies.