https://github.com/google/fruit
Fruit, a dependency injection framework for C++
https://github.com/google/fruit
Last synced: 4 days ago
JSON representation
Fruit, a dependency injection framework for C++
- Host: GitHub
- URL: https://github.com/google/fruit
- Owner: google
- License: apache-2.0
- Created: 2014-06-16T20:43:26.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2025-02-03T07:01:25.000Z (2 months ago)
- Last Synced: 2025-04-03T16:06:47.927Z (11 days ago)
- Language: C++
- Homepage: https://github.com/google/fruit/wiki
- Size: 3.03 MB
- Stars: 1,831
- Watchers: 87
- Forks: 202
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: COPYING
Awesome Lists containing this project
- awesome-bazel - Fruit
README
[](https://github.com/google/fruit/actions/workflows/test-on-linux.yml)
[](https://github.com/google/fruit/actions/workflows/test-on-windows.yml)
[](https://github.com/google/fruit/actions/workflows/test-on-osx.yml)
[](https://scan.coverity.com/projects/google-fruit)
[](https://bestpractices.coreinfrastructure.org/projects/1040)Fruit is a [dependency injection](http://en.wikipedia.org/wiki/Dependency_injection) framework for C++, loosely inspired by the Guice framework for Java. It uses C++ metaprogramming together with some C++11 features to detect most injection problems at compile-time.
It allows to split the implementation code in "components" (aka modules) that can be assembled to form other components.
From a component with no requirements it's then possible to create an injector, that provides an instance of the interfaces exposed by the component.See the [wiki](https://github.com/google/fruit/wiki) for more information, including installation instructions, tutorials and reference documentation.