Simple Injector VS Guice

Compare Simple Injector vs Guice and see what are their differences.

Simple Injector

An easy, flexible, and fast Dependency Injection library that promotes best practice to steer developers towards the pit of success. (by simpleinjector)

Guice

Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google. (by google)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
Simple Injector Guice
4 31
1,180 12,341
- 0.3%
5.8 7.5
29 days ago 6 days ago
C# Java
MIT License Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

Simple Injector

Posts with mentions or reviews of Simple Injector. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-25.
  • Modular Dependency Injection in .NET
    2 projects | dev.to | 25 Mar 2024
    When I was building application with .NET Framework I always used libraries like Autofac and SimpleInjector for dependency injection. I really liked to create modules (Packages in SimpleInjector) to achieve higher cohesion and lower coupling in my class libraries. I made a module for every class library in which all dependencies inside of that class library were registered. Why should my web application (for example) know if MyBeautifulService in MyBeautifulClassLibrary should be transient or singleton?
  • Does anybody has a recommended resource about Dependency Injection?
    4 projects | /r/csharp | 7 Jul 2021
    My favorite DI container is LightInject. Very fast and has all the features that I need. Other good DI containers are Grace and SimpleInjector, IMO.

Guice

Posts with mentions or reviews of Guice. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-21.
  • Inversion of Control Containers and the Dependency Injection Pattern (2004)
    2 projects | news.ycombinator.com | 21 Feb 2024
    > Dependency injection has always been such a bad name for the concept. It is just passing dependencys as arguments.

    No.

    Dependency Injection means using tooling to "inject" the dependency, instead of passing an explicit argument.

    https://github.com/google/guice

    > Think of Guice's `@Inject` as the new `new`.

    Like many architecutral design patterns, toy examples don't illustrate the concept well. It's used for doing things like switching a large service-based system from using external databases and remote services for production, to in-memory everything for testing.

    2 projects | news.ycombinator.com | 21 Feb 2024
    “There are many advantages to using dependency injection, but doing so manually often leads to a large amount of boilerplate code to be written. Guice is a framework that makes it possible to write code that uses dependency injection without the hassle of writing much of that boilerplate code”

    This is a common misconception. Guice’s docs delineate between dependency injection as a pattern and Guice as a framework that supports that pattern.

    https://github.com/google/guice/wiki

  • Handling two contexts
    2 projects | /r/golang | 28 Mar 2023
    Usually each context has a different scope and lifetime associated with it. Here, it sounds like there are two distinct scopes: server and request (cf. how Guice models scopes: https://github.com/google/guice/wiki/Scopes). It is rarely sensible to merge the scopes or contexts together. If we think about a context, it contains several things:
  • Dependency Injection in Scala - cake pattern
    4 projects | dev.to | 18 Feb 2023
    using libraries from java world, such as Guice;
  • Dependency injection with AWS Lambdas in java
    4 projects | dev.to | 11 Feb 2023
    As said in the title, we will focus on the dependency inversion principle and one of its application : dependency injection. For production-ready applications, it would be better to rely on a framework and not implement its own container. For it, the java ecosystem have 3 frameworks available : Spring, Guice and Dagger.
  • "My Reaction to Dr. Stroustrup’s Recent Memory Safety Comments"
    11 projects | /r/rust | 2 Feb 2023
    And it doesn't really matter whether you have created circular reference structure of whether you have messed up your binding and now objects which was supposed to disappear after one request is only doing that when all database connections are quiescent (which happens easily in testing, but may not happen for days in production).
  • ᚣ the Rune Programming Language
    6 projects | news.ycombinator.com | 26 Nov 2022
  • Ask HN: Google Guice another abandonware from Google?
    2 projects | news.ycombinator.com | 17 Jan 2022
    https://github.com/google/guice/issues/1536
  • What is something you made in Java to automate/make your job easier?
    12 projects | /r/java | 24 Dec 2021
    ... with guice or Spring Boot,
  • About design patterns: Dependency Injection
    2 projects | dev.to | 13 Oct 2021
    The following section is an example of injecting our service using Guice, a dependency injection framework for Java made by Google. The concept is to reference bindings of every component you can inject in your program, so that the library can generate a class of any type, automatically.

What are some alternatives?

When comparing Simple Injector and Guice you can also consider the following projects:

Autofac - An addictive .NET IoC container

Dagger2 - A fast dependency injector for Android and Java.

Microsoft.Extensions.DependencyInjection

HK2

Unity - This repository contains all relevant information about Unity Container suit

Ninject - the ninja of .net dependency injectors

Weld - Weld, including integrations for Servlet containers and Java SE, examples and documentation

DryIoc - DryIoc is fast, small, full-featured IoC Container for .NET

LightInject - An ultra lightweight IoC container

Castle Windsor - Castle Windsor is a best of breed, mature Inversion of Control container available for .NET

Scrutor - Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection

Apache DeltaSpike - Mirror of Apache Deltaspike