Home » C++ » Dependency Injection framework for C++ [closed]

Dependency Injection framework for C++ [closed]

Posted by: admin November 29, 2017 Leave a comment

Questions:

Is there a DI framework comparable to Google Guice? And what does Google use?

Answers:

There is nothing as mature or standard as Guice in the C++ world. However, some people have put together simplistic implementations on their own. Here’s a couple.

You’re unlikely to be satisfied by any of these.

If you really wanted to put in the effort to rally the world around a DI framework for C++, probably the way to go about it would be to make a proposal to the Boost guys.

Questions:
Answers:

I’m the author of wallaroo. It’s actively developed and has the following features:

  • it’s lightweight but powerful
  • its interface supports both C++11 and C++98 with boost
  • it’s type safe
  • it doesn’t need custom preprocessors / code generators
  • you can load classes defined in shared libraries
  • you can use a DSL syntax for object creation and wiring or
  • you can get object creation and wiring by parsing one or more xml / json file.

Any comment, suggestion or request are welcome.

Questions:
Answers:

There is a recent one that looks very interesting called Hypodermic, i haven’t tested it but it looks pretty active

Questions:
Answers:

I am currently authoring one called sauce, whose design (and name) is directly inspired by guice. I still consider it alpha, but you may find it useful.