Skip to content

Setter Injection #197

@Blacksmoke16

Description

@Blacksmoke16

Currently the DI component only supports constructor injection. This is usually preferred/is more common, but supporting setter injection would also be nice to have. Esp when used in conjunction with modules and auto configuration. E.g. have a module of some type that when included into a service automatically registers a setter injection call on the service as well as defining the property/setter for it. This can work quite well for services that are optional versus littering the constructor with many nilable properties.

Marking this as blocked by crystal-lang/crystal#8835 just due to the complexities around resolving arguments. Being able to share/reuse that logic would make this much much easier to implement w/o making the code much much less readable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions