kiwi icon indicating copy to clipboard operation
kiwi copied to clipboard

Add possibility to resolve collection of types by super type

Open prokyhb opened this issue 6 months ago • 0 comments

Hello there,

I'm developing an app with bunch of flavors, each of flavor has different set of features based on some adapters (barcode processors for barcode scanners). I wonder if it makes sense to define available adapters in scoped containers for each flavor (different instances of an app) and then loading registered adapters by supertype.

So instead of trying to resolve specific instance using T? resolveAs<S, T extends S>, we could have something like List<T> resolveBunchOfGuysBySuperType<T>. (ofc not production name :-)

So the app could be universal, this way I could load all registered processors in scoped container for a flavor without need to know what is actually registered there.

Does this make sense to you? If so, can we make this happen? I can prepare MR myself i suppose. Thank you.

prokyhb avatar Aug 04 '24 18:08 prokyhb