Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Portable C++ Component Design

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++?

like image 655
MFH Avatar asked Feb 26 '11 16:02

MFH


4 Answers

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

like image 138
Nemanja Trifunovic Avatar answered Nov 07 '22 08:11

Nemanja Trifunovic


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.

like image 42
David Given Avatar answered Nov 07 '22 08:11

David Given


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.

like image 2
Sascha Avatar answered Nov 07 '22 07:11

Sascha


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

like image 1
Edward Strange Avatar answered Nov 07 '22 07:11

Edward Strange