Tool

MinJect

year
2021
ABOUT THE PROJECT

MinJect is a dependency injection framework for Unity. Its focus is on being simple, minimalistic and easy to understand - to do this the project uses two classes: the Injector class and the [InjectableField] attribute. It is a straightforward alternative to ZenJect’s massive codebase. It is based on a now-defunct repo from Wooga.

DOWNLOAD

How It Provides More Value In Less Code

It's no secret that more is less when it comes to code. Less means less time reading and interpreting, less possible points of failure, less overhead, etc. MinJect is built upon this very concept. It aims to be a viable DI framework that will cover 80% of use cases with less than 20% of the code when compared to larger projects like ZenJect.

It aims to:

  • Allow new developers to become acquainted with it in 15 minutes or less.
  • Meet all the most common use cases for DI frameworks.
  • Be highly reliable and error-free.

To do so, MinJect primarily utilizes two classes, which together add up to 130 lines of code. It supports injecting, binding, injecting on binds, and nested injectors. The code is almost fully unit tested, adhering to Microsoft test standards, and using FluentAssertions for extra readability.

How It Impacted Projects

Over the projects I've used MinJect on as well as based on feedback I've received from other users, here's how it helped them:

  • It saved valuable memory on resource constricted platforms due to its extremely small size in comparison to other popular DI frameworks for Unity.
  • It saved developer time during debugging due to its thoroughly tested codebase, as well as its simple design.
  • It provided value while minimizing any necessary learning curves due to its minimal and fully documented code.
  • It helped introduce new developers to DI concepts in a simple manner so they could use more complex DI tools and frameworks.