Table of Contents
MinJect is a simple dependency injection framework, forked from a now-defunct repo from Wooga. It focuses on being minimalistic and easy to use.
Import the package into your project. If you want to get acquainted with the code, take a look at the Injector
class, more specifically the InjectDependenciesOf
method. Next, take a look at the InjectField
attribute.
To inject dependencies into a class, simply mark the injectable fields with the [InjectableField]
attribute, and then call injector.InjectDependenciesOf(instanceOfClass)
.
The package also includes a number of unit tests written using FluentAssertions for maximum readability. They may also be useful in understanding how the framework functions.
- Open the package manager.
- Click on the plus icon on the top left corner, and select 'Add package from git URL'.
- Paste in 'https://github.com/ninito-ph/MinJect.git'.
- Import it into your project!
Paulo Oliveira - paulo at ninito dot me
Project Link: https://github.com/ninito-ph/MinJect