Michael Feathers wrote:
Why aren't there many libraries for Dependency Injection in C++. It's
been a very useful pattern in the Java community, but I run into many
teams that could use it in C++, but it never occurs to them to write a
framework to do it.
I read Roland Piebingers link,
http://www.objectmentor.com/omReports/articles/dip.pdf and think it's
an interesting, very flexible and "enterprisey" pattern. However, I
fail to grasp the difference from the simple rule: "Use abstract
interface classes everywhere." (Doesn't the QT framework favor this?)
I hope I'm not terribly dense but if I understand this correctly this
automatically means using "virtual" all over the place. If you are
interested in FLOPS this is a killer. Again, I might be completely
wrong, but I think on the lower software layers, this technique is
unusable performancewise. At least I personally always try to define
functional interfaces for templates and get rid of as many virtuals as
possible when writing scientific code.
So maybe JAVA has better use for it, as it is used more as an
integrative, "scripty" language than C++ ? Or maybe the C++ community
is used more to following design patterns, without a framework
enforcing it?