可移植的 C++ 组件设计
我过去一直使用 COM 和 .NET 程序集来开发基于组件的系统.现在我要处理一个跨平台的 C++ 项目,并且想在组件中构建代码......
I've been using COM and .NET assemblies in the past to develop component-based-systems. Now I'm going to work on a cross-plattform-C++-project and want to structure the code in components aswell…
显然 COM 和 .NET 不是一个选项,因为 COM 在任何地方都不可用,但 Windows 和程序集会将依赖项添加到目标系统可能不可用的 .NET 框架.
Obviously COM and .NET are not an option, as COM is not available anywhere but Windows and Assemblies would add dependencies to the .NET framwork which may be not available at the target system.
我知道由于 ABI 差异,我无法在不重新编译的情况下在不同操作系统之间移动组件,但我想以一种在源代码级别兼容的方式编写代码.
I'm aware that due to ABI-differences I won't be able to move components between different operating systems without recompilation, but I would like to write the code in a manner, that it's compatible at source-code-level.
是否有任何系统/框架可以在 C++ 中实现这样的架构?
Is there any system/framework that enables such a architecture in C++?
推荐答案
我过去曾使用过这样的系统 - 我们基本上重新发明了 COM.如果您对这种方法感兴趣,请查看这篇很棒的文章:http://msdn.microsoft.com/en-us/library/ms809983.aspx
I have worked with such a system in the past - we basically re-invented COM. If you are interested in that approach, check out this great article: http://msdn.microsoft.com/en-us/library/ms809983.aspx
相关文章