What is PocoCapsule current status? Is it evolving? Has it been forked with some other product? What is about the whole idea of IoC for C++? If PocoCapsule is not evolving, is it because IoC was considered not useful for C++, unsafe, other patterns appeared or something else?
As far as I understand there are 2-3, maybe few more products, that implement IoC for C++, available and PocoCapsule is the most mature of them.
I see several disadvantages in current version (as I see it's 1.1 from google code):
- No separate namespace.
- Header files are required to be right in INCLUDE folder - better to place them in subfolder.
- Generation Tools depend on Java.
- No static linking libraries are built by default.
- Cannot generate source code out of setup.xml for compilation and link with my app 开发者_StackOverflowif I don't need reconfiguration feature.
Does anybody have the same thoughts? Does anybody work on something of this list? Are there any barriers to start working, like patents?
I emailed Ke Jin (maintainer) and his response was that it is not under current, active development as of Jul 14, 2011. He did not give a reason.
I have been looking for this myself for some time now, and came realize that there are no good IoC Containers in C++. There are a lot of problems implementing this. Getting something like the C# IoC Containers (Castle Windsor, Unity, etc.) is out of reach. My guess is that if you require something like this, you don´t do c++. And if you do C++, you roll your own or use singleton factories (little joke) ;)
An easy shortcut is to use Qt´s QML. It was build for declarative UIs but can be used for building any QObject based tree.
Another good look are CORBA Systems for C++, they may have some of the things you require.
Just my hints for other places to look...
I think that you can successfully use Qt metaobject system by reusing QtCore library and moc-compiler in your application.
With metaobject system you can create fully isolated modules by calling any method of module's interface via QMetaObject::invokeMethod().
And all will work without QCoreApplication object instance! Define your modules as subclasses of QObject, provide Q_OBJECT macro and mark all interface methods with Q_INVOKABLE ( of course, you should add moc-compiler as build step ).
精彩评论