« Your API, it's the law.. | Main | Conservation of Seriousness »

October 10, 2006


Ke Jin

QtIoCContainer is intrusive by mandating a container specific parent interface class. Therefore, it is not a POCO (Plain Old C++ Object) Ioc container. Besides, I recall it only supports property setter injection.... but not ctor and generic factories....

Pocomatic Software (www.pocomatic.com), is building a true non-intrusive IoC container for C++ at the moment, called Pococapsule/C++. And is to be alpha next month, and officially release by Q1 2007.

Besides being truely non-intrusive and supporting POCO, this container supports all 4 types of injections:

1. constructor injection
2. property setter injection (both method setter, as well as direct data field assign injection)
3. non-static method (factory) injection
4. static method injection (and even global function injection).

Other features include:

1. it is type safe (type error will be cought and reported)
2. life cycle management (for singleton bean)
3. small footprint and lowest compiler requirement
(we do not use RTTI, template, and minimumize
the usage of exception).

And most important of all, it supports so-called the zero-code customizability. One can easily customize and extend the container's deployment schema without writing C++ code. This feature is already available in Pococapsule/Java released last month, and is used by us to build our CORBA application framework (Pococapsule/CORBA).


Michael Feathers


Thanks for the info.. I suspected that someone out there was doing something like this, but I hadn't found while asking around.

I tried writing an IoC container for C++ a while ago, but I wanted to support POCOs and I kept wondering whether it is really possible. I'm very curious about how pococapsule will do constructor-based injection without reflection. I pulled my hair out trying to figure out some way to do it with templates.

Thanks again for the heads up.

Xibin Zeng

I checked www.pocomatic.com and it doesn't look like the IoC container for C++ is released yet. The time is Q4 of 2007. Do we know if this is going to happen?

Ke Jin

Please check the it again. It was released as an open source at:http://code.google.com/p/pococapsule



I implemented yet another C++ dependency
injection framework, which recently was proposed for boost – https://github.com/krzysztof-jusiak/di
library is macro less (free), header only, C++03/C++11/C++14 library providing type safe, compile time, macro free constructor dependency injection.

The comments to this entry are closed.