Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference with other C++ Dependency Injection libraries #5

Closed
qqibrow opened this issue Mar 13, 2015 · 8 comments
Closed

Difference with other C++ Dependency Injection libraries #5

qqibrow opened this issue Mar 13, 2015 · 8 comments
Projects
Milestone

Comments

@qqibrow
Copy link

qqibrow commented Mar 13, 2015

Hi, I notice that there are another C++ DI libraries like wallaroo, and Boost.DI. What's the difference between fruit and them? How this library been used in Google internally?

@poletti-marco
Copy link
Contributor

I will include a page comparing Fruit to other C++ DI libraries in the Fruit website, thanks for the idea.
I'll work on the 1.1.0 release first though, once that is released I was already planning some work on the documentation (i.e., in 1 month or so).
I'll keep this issue open until I add that page, so that you know when it's there.

The TL;DR version is that Wallaroo is a completely different beast (run-time DI) while Boost.DI is more similar to Fruit, but there are some differences in the features (some are Fruit-only, some Boost.DI-only) and in performance (I expect Fruit to have noticeably faster compile time and slightly faster run-time, but I need to write/run some benchmarks to have actual data on this).

@qqibrow
Copy link
Author

qqibrow commented Mar 15, 2015

Cool. That's very helpful. Thanks.

@icnocop
Copy link

icnocop commented Sep 10, 2015

Thank you for Fruit.

I'm also interested in a comparison with hypodermic.

@poletti-marco
Copy link
Contributor

Hypodermic is also one of the runtime DI libraries, it's more similar to Wallaroo than to Fruit.
For example, if you forget to bind a type that's a compile-time error in Fruit (and Boost.DI) but it's a runtime error in Wallaroo and Hypodermic.

@soroshsabz
Copy link

ITNOA

@poletti-marco thanks for information, and what about autowiring?

@poletti-marco
Copy link
Contributor

poletti-marco commented Apr 5, 2019 via email

@ruipacheco
Copy link

And what about Kangaru? Seems to be pretty complete: https://github.com/gracicot/kangaru/wiki

@poletti-marco
Copy link
Contributor

From a quick look at the documentation it also seems to be runtime DI, so using an approach similar to Wallaroo and Hypodermic.
That means that it won't be able to report many compile-time errors that Fruit (and Boost.DI) can report, like missing bindings.

They provide a debugging facility for 1 class of errors:
https://github.com/gracicot/kangaru/wiki/11.-Debugging

But you need to modify your code in order to use it.
So I imagine that even for the few classes of errors where it does fail at compile-time, the errors are not very readable until you change your code to use that.

Fruit (and Boost.DI) give you the guarantee that certain classes of errors are always detected at compile-time, so if your code builds you're sure they won't happen at runtime. E.g. missing bindings (both libraries) or binding dependency cycles (Fruit only).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Fruit 3.x
Documentation
Development

No branches or pull requests

5 participants