Represents an method to inject for a component.
Used in initializer and method injections
Initializer style injection has the following advantages:
- Presents a clear contract to put the instance in the required state before use.
- No custom lifecycle methods (before/after property injection) are required.
Initializer injection has the following drawbacks:
- Not suitable for classes with a very large number of dependencies - a very large initializer method will create poor readability.
- Auto-injection by type is not supported.
- No type introspection for objects injected with a text representation.
Its generally recommended to use initializer-style injection, unless the above drawbacks will manifest.