Skip to content

Registering different implementations of the same interface. #108

@shtlrs

Description

@shtlrs

I think the issue title says it all, but one issue i faced a lot is registering 2 or more different implementations of the same interface.

This can turn out to be useful for example when introducing abstractions in the form of chains of responsibility.

Just like middlewares work for example in web frameworks, you have multiple middlewares and then we iterate on them and each one handle the request per the same interface.

Also, it should be possible to make named registrations of instances of the same interface, so that when you need a particular instance that you define based on some key, you can get it from the container.

This is possible in frameworks like Autofac or SimpleInjector.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions