# google/fruit

Fruit, a dependency injection framework for C++

Repository: https://github.com/google/fruit
Canonical: https://ross.abutalabs.com/products/fruit
Homepage: https://github.com/google/fruit/wiki
Language: C++
License: Apache-2.0
License Family: permissive
Last push: 2026-04-12T00:10:50+00:00

## Health v2 (maintenance only)
Score: 57/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 76, release rhythm 8, longevity 100
- inputs: {"age_days": 4461, "days_push": 144, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1887, forks 203 (observed 2026-08-28T04:05:49.191406+00:00)

## What it is
Fruit is a dependency injection framework for C++, loosely inspired by Java's Guice. It uses C++11 metaprogramming to catch most injection errors at compile time and organizes code into composable components from which injectors create instances.

## Use cases
- dependency injection in C++ projects
- bind interfaces to implementations at compile time
- split C++ code into composable modules/components
- catch missing bindings and dependency loops before runtime
- assisted injection and factory auto-registration in C++
- low-overhead DI for performance-sensitive C++ applications

## When to choose
- you want Guice-style DI in C++ with errors caught at compile time
- you need modular component assembly with minimal runtime overhead
- you want a mature, Google-backed DI framework with cross-platform CI

## When to avoid
- your project targets pre-C++11 compilers
- you prefer runtime-configured DI or reflection-based containers
- you need DI for languages other than C++

## Facets
- artifact type: framework
- maturity: stable
- function: developer-tools, middleware
- domain: developer-tools, cross-platform
- platform: cpp, windows, cross-platform
- tags: dependency-injection, compile-time-checks, guice-inspired, cpp11, metaprogramming, linux, macos

## Member repositories
- google/fruit (main) score 57

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:49.191406+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:13:32.829870+00:00, confidence not recorded.
  - readme: https://github.com/google/fruit (fetched 2026-08-28T04:05:49.191406+00:00, sha d47fd7a0beab)
  - homepage: https://github.com/google/fruit/wiki (fetched 2026-08-29T10:52:27.223784+00:00, sha de488d99fc37)
- Data as of 2026-08-30T08:39:29.467469+00:00.
