Java Dependency Injection

Open-source Java projects categorized as Dependency Injection

Top 23 Java Dependency Injection Projects

  • Dagger2

    A fast dependency injector for Android and Java.

  • Project mention: Dagger 2.49 (KSP, @AssistedInject with @HiltViewModel, more) | /r/androiddev | 2023-12-05
  • Guice

    Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google.

  • Project mention: Hexagonal Architecture/Ports And Adapters: Clarifying Key Concepts Using Go | dev.to | 2024-03-21

    Historically, Ports and Adapters was born in the context where Dependency Inversion Principle (DIP) was getting hot, back in the beginning of the 2000’s. DIP was getting more present on development day to day, and an example of a framework that was a pioneer in such topic is Google Guice.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Bootique

    Bootique is a minimally opinionated platform for modern runnable Java apps.

  • Toothpick

    A scope tree based Dependency Injection (DI) library for Java / Kotlin / Android.

  • Project mention: Is dependency injection really a hard topic ? Or am i just dumb ? | /r/androiddev | 2023-07-10

    Just as an alternative, the library toothpick focused on one concept, scopes, much easier for anyone on Android to grasp. You have application scope, activity scope, fragment scope and custom scope. Even while reading this, I'm sure you already understand what each of those represent. Having said that, it wasn't able to solve most of the other implementation complexities beyond better conceptual abstractions.

  • Governator

    Governator is a library of extensions and utilities that enhance Google Guice to provide: classpath scanning and automatic binding, lifecycle management, configuration to field mapping, field validation and parallelized object warmup.

  • ActiveJ

    ActiveJ is an alternative Java platform built from the ground up. ActiveJ redefines core, web and high-load programming in Java, providing simplicity, maximum performance and scalability

  • apk-dependency-graph

    Android class dependency visualizer. This tool helps to visualize the current state of the project.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Weld

    Weld, including integrations for Servlet containers and Java SE, examples and documentation (by weld)

  • Feather

    Lightweight dependency injection for Java and Android (JSR-330) (by zsoltherpai)

  • transfuse

    :syringe: Transfuse - A Dependency Injection and Integration framework for Google Android

  • avaje-inject

    Dependency injection via APT (source code generation) ala "Server-Side Dagger DI"

  • Project mention: Apt-based dependency injection for server-side developers | news.ycombinator.com | 2023-11-21
  • Apache DeltaSpike

    Mirror of Apache Deltaspike

  • java-11-examples

    JDK 11 examples and demo projects.

  • JayWire

    JayWire Dependency Injection

  • EasyDI

    Easy Dependency Injection for Java (by manuel-mauky)

  • spring-examples

    Starter projects with Spring using Java and Kotlin. Contains modules that covers Security with JWT, Spring with Kotlin, Dependency injection simplified etc.

  • FlexiCore

    FlexiCore is a plugin based spring powered framework

  • colesico-framework

    Micro framework for creating server side applications in Java 17+

  • backbonefx

    Opinionated set of tools for creating JavaFX apps

  • Project mention: What library/framework would you recommend for creating a GUI desktop application? | /r/java | 2023-05-30
  • pouch

    Inversion of Control that's designed for ease of use and debugging (by cowwoc)

  • mockito-object-injection

    Mockito Object Injection for JUnit5. Inject Strings and other Objects directly into Mocks without needing setters or constructor injection.

  • Project mention: JEP 457: Class-File API for Parsing, generating, transforming | news.ycombinator.com | 2023-09-26

    This is pretty exciting... I've used them all libraries at this point in my career: CGLib, ASM, BCEL, ByteBuddy, Javassist, etc... each has its pluses and minuses. I've designed everything from profiling agents, to systems that pack decimals into EBCDIC and invoke COBOL programs on big IBM iron, to lightweight JIT compilers, all using these libraries.

    > In 2002, the visitor approach used by ASM seemed clever

    I couldn't agree more. The visitor pattern was very hard to explain/justify back then, and still difficult to explain to newbie programmers just entering the profession.

    Looking at the examples, I think this is going to be an official replacement for ASM, meaning it's going to be pretty low level. The use of streams pretty straightforward.

    If anyone from the JEP is reading this: I have two pieces of feedback!

    First, take some inspiration from the way CDI Portable Extensions work. This is probably the most delightful extension API I've ever used. The @Observe callbacks are super simple to explain to people and it's really easy to write extensions for the framework.

    Next, I wouldn't ignore the need for a higher-level API akin to ByteBuddy or Javassist. Sometimes I just want to write an interpreter or intercept a method call and thats it.

    For example in my Junit/Mockito extension https://github.com/exabrial/mockito-object-injection I need to intercept a call to the class under test in order to lazily inject dependencies at the last possible moment. While I certainly could do this with ASM, Javassist makes this fairly simple with it's MethodHandler api.

    Side note, it's a damn shame we don't have a mobile operating system that is JVM native :/ All this cool APIs simply never reach a huge number of devices.

  • WireDI

    WireDI is a IOC-Framework, that bridges compile time and runtime dependency injection

  • Jvault

    💙 Java DI library for package encapsulation

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

Java Dependency Injection related posts

Index

What are some of the best open-source Dependency Injection projects in Java? This list will help you:

Project Stars
1 Dagger2 17,311
2 Guice 12,343
3 Bootique 1,412
4 Toothpick 1,116
5 Governator 822
6 ActiveJ 817
7 apk-dependency-graph 740
8 Weld 374
9 Feather 353
10 transfuse 219
11 avaje-inject 195
12 Apache DeltaSpike 147
13 java-11-examples 57
14 JayWire 54
15 EasyDI 49
16 spring-examples 36
17 FlexiCore 22
18 colesico-framework 15
19 backbonefx 15
20 pouch 14
21 mockito-object-injection 8
22 WireDI 5
23 Jvault 5

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com