injector_io icon indicating copy to clipboard operation
injector_io copied to clipboard

Add support for interfaces

Open hkakutalua opened this issue 5 years ago • 2 comments

Is not possible to instantiate concrete classes from their base classes, this a severe limitation.

BaseClass base = get<BaseClass>(); // Instantiate ConcreteClass

The code below would probably be an API breaking change:

factory<CacheStore>(() => FileCacheStore(inject()))

hkakutalua avatar Sep 11 '19 03:09 hkakutalua

Hello. I was about to use this library.
Unfortunately, I realized during debugging that interface/abstract class injection is not supported. W/o being able to resolve base classes from given implementations this library is useless for me.

Is there any progress on this issue already? Or is it better to check for a working alternative?

PDDStudio avatar Feb 18 '20 16:02 PDDStudio

Hi @PDDStudio, thank you for bringing this topic to our attention as it was forgotten due to other priority tasks inside our company.

We'll see implement if possible in this week, but you're also welcome to contribute with a pull request.

Thank you.

hkakutalua avatar Feb 19 '20 08:02 hkakutalua