Portable C++ Component Design

最后都变了- 提交于 2019-12-05 01:43:00

问题


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…

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.

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.

Is there any system/framework that enables such a architecture in C++?


回答1:


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




回答2:


The Mozilla suite uses a framework called XPCOM. Never used it myself, but the implication it's supposed to be like Microsoft's COM but portable. That's the only in-process component system I know of that's native code based; if you're working in Java, there's OSGi.

These days most Unix software appears to use distributed component models, where components live in different processes. The current fashionable system appears to be DBus; KDE3 used an alternative called DCOP; and of course if you want to go this route there's good old CORBA.




回答3:


If you can live with a Qt dependency (only core libraries, no GUI libs), you could have a look at the CTK Plugin Framework

It is licensed under Apache 2.0 and is a dynamic C++ component system with an API which is nearly identical to OSGi.




回答4:


Maybe this: http://blog.redshoelace.com/2007/09/what-is-boostextension.html



来源:https://stackoverflow.com/questions/5127981/portable-c-component-design

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!