Publisher | ProGru |
---|---|
File size | 65.86kB |
Number of files | 86 |
Latest version | 1 |
Latest release date | 2024-10-03 10:14:17 |
First release date | 2024-10-03 10:14:18 |
Supported Unity versions | 2018.4.2 or higher |
Dependency Injection (DI) in general, improves code modularity, testability, and maintainability by decoupling components. It allows for easy swapping of dependencies, promotes cleaner architecture, and simplifies unit testing through mockable dependencies.
GruInject is a lightweight and flexible dependency injection framework ideal for rapid prototyping but capable of handling production needs. It simplifies dependency management with the following key features:
- Attribute Service Declaration:
- AutoSpawn: Automatically create service and inject dependencies.
- RegisterAsSingleInstance: Register a singleton service.
- RegisterInstance: Create a new instance each time it is requested.
- Flexible Injection: Inject dependencies through attributes for variables, properties, methods, and constructors using the Inject attribute.
- MonoBehaviour Support: Seamless dependency injection for Unity MonoBehaviours, requiring inheritance from a special base class provided by GruInject.
- Test-Friendly Tools: Built-in support for mocking dependencies, making unit testing easier and more efficient.
GruInject is designed for fast setups while offering the flexibility and power to scale with your project.