It would be useful if the provide... functions would accept multiple tokens. This would be useful for describing interfaces that are implemented in an aggregate concretion, for example:
In this way, consumers can specify the interface they want, and get a concretion which provides that, even if it provides other things we don't care about.
At present we can specify multiple provide... calls, but in this case, the instance/value will be created for each token specified by a consumer, where we might actually intended to have a singleton or transient scope. Whilst it would be possible to provide a factory that deals with this, its somewhat obtuse and repetitive if we want to use the pattern extensively.
It would be useful if the
provide...
functions would accept multiple tokens. This would be useful for describing interfaces that are implemented in an aggregate concretion, for example:In this way, consumers can specify the interface they want, and get a concretion which provides that, even if it provides other things we don't care about.
At present we can specify multiple
provide...
calls, but in this case, the instance/value will be created for each token specified by a consumer, where we might actually intended to have a singleton or transient scope. Whilst it would be possible to provide a factory that deals with this, its somewhat obtuse and repetitive if we want to use the pattern extensively.