跨平台替代COM [英] Cross-platform alternative to COM

查看:183
本文介绍了跨平台替代COM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢使用基于组件的编程(无论是COM,另一个系统,还是使用纯C ++中的范例)。它需要一点习惯,如果一个通常用于传统的OOP模型,但它是definetely值得的。它使我的代码更易于维护和更容易扩展。

I've been enamoured with component based programming (be it with COM, another system, or just using the paradigm in plain C++). It requires a bit of getting used to, if one is usually used to the "traditional" OOP model, but it's definetely worth it. It's made my code more maintainable and easier to extend.

我目前工作的项目是使用范式,但没有设置系统。但是,我真的想找到某种系统,我可以使用以下要求。从现在我切换到一个新的系统将需要一点时间,但我会节省一个倍数的时间后。

The project I'm currently working on is using the paradigm, but no set system. However, I'd really like to find some sort of system I could use with the following requirements. Switching over from what I have now to a new system would take a bit of time, but I'd save a multiple of that time later.

要求:


  1. 跨平台

  2. 快速

  3. 与C ++搭配使用

  4. 支援跨进程编组

  1. Cross-platform
  2. Fast
  3. Works well with C++
  4. Supports cross-process marshalling

让我详细说明这些要求:

Let me elaborate on those requirements:

跨平台

基本上,我需要它在Windows和Mac上工作。 Linux会很好,但不是绝对必要的。此外,它真的需要满足所有平台的其他要求。有一个COM的Mac,这将是理想的,但它不支持要求4.此外,它必须支持GCC和MSVC。

Basically, I need it to work on Windows and Mac. Linux would be nice, but is not in any way essential. Also, it really needs to fulfil the other requirements for all platforms. There's a COM for Mac, which would be ideal but it doesn't support requirement 4. Additionally, it must support both GCC and MSVC.

快速

这是CORBA不幸失败的地方,其他三个要求。进程内方法调用需要尽可能快(理想情况下,像COM),因为一些例程也可能从音频中断调用。

This is where CORBA unfortunately loses, even though it fulfils the other three requirements. In-process method calls need to be as fast as possible (ideally, like COM), since some of the routines might also be called from an audio interrupt.

适用于C ++

...我想这个明显。我不介意不使用C ++类来实现组件,虽然这将是有益的,替代品仍然必须易于使用,尤其是最终我打算发布第三方扩展API。

... I guess this one is mostly obvious. I don't mind not using C++ classes to implement components, though that would definetely be helpful, and the alternative must still be easy to use, especially since eventually I intend to release an API for 3rd party extensions.

支持跨进程编组

以串行化呼叫。如果这是通过从IDL生成的代码完成,这是完全正确的我,我也不介意实施跨进程通信本身。

By that I mean at least being able to serialize the calls. If this is done via code generated from an IDL, that's perfectly fine with me, and I also don't mind implementing the cross-process communication itself.

COM将是巨大的,但它不完全满足要求1。 CORBA也会很棒,但它不满足要求2(即使有最快的ORB)。 XPCOM可能不满足要求2,并且不与MSVC一起使用,因此不满足要求1.

COM would be great, but it doesn't meet requirement 1 fully. CORBA would be great too, but it doesn't meet requirement 2 (even with the fastest ORB out there). XPCOM might not meet requirement 2, and doesn't work with MSVC so doesn't meet requirement 1.

任何想法还有什么?我的下一步是使用protobuf或类似的东西滚动我自己,但当然我想避免这样。

Any ideas what else is out there? My next step would be to roll my own using protobufs or something similar, but of course I'd like to avoid that.

更新

Update

中断在这种情况下可以低至2-3ms。这个时间甚至不能完全提供给我,因为其他组件需要在那段时间进行处理,我的软件本身包装了需要在那段时间处理的另一个软件。这就是为什么在进程和跨进程编组需要非常快。

To elaborate - an audio interrupt in this context can be as low as 2-3ms. That time isn't even available in full to me, as other components need to process in that time, and my software is itself wrapping another piece of software that needs to process in that time. This is why both in-process and cross-process marshalling needs to be extremely fast.

推荐答案

ICE from ZeroC http://www.zeroc.com/ 是另一种选择。

ICE from ZeroC http://www.zeroc.com/ is another alternative.

对于那些CORBA老朋友,Michi Henning是天。他现在有了ZeroC。它是一个开源的跨平台,包括所有的目标(包括Linux),系统。

For those CORBA old-timers, Michi Henning was one of the gurus of the day. He is now with ZeroC. It is an open-source, cross-platform, including all your targets (including Linux), system.

C ++只是其中一种语言,ICE的C ++绑定显着优于CORBA C ++绑定。

C++ is only one of the languages, and ICE's C++ bindings are significantly better than the CORBA C++ bindings are.

这篇关于跨平台替代COM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆