Dependency injection
This page explains how to use dependency injection, which provides a way to inject dependencies (instances of objects) into command classes
Lamp supports a simple form of dependency injection, allowing you to manage dependencies with ease. This feature simplifies the process of injecting dependencies into your command classes.
Adding Dependencies
Dependencies are added to the Lamp
instance using the builder.dependency(...)
method. You can provide dependencies as either a supplier or an object.
Injecting Dependencies
To inject dependencies into fields, use the @Dependency
annotation. This annotation tells the framework to inject the specified dependency into the annotated field.
Last updated
Was this helpful?