More IServiceProvider
Damien Morton gave me a pointer to his blog about IServiceProvider. More good stuff J.
For all those out there that are paying attention, I know that this pattern of usage can and does lead to singleton use… and given my rant about singletons before, well you are just going to have to deal with it.
[Now Playing: Stone Temple Pilots - Silver Gun Superman (05:16)]
Comments
- Anonymous
August 04, 2004
I disagree about IServiceProvider leading to singleton use. It is in fact a way out of using singletons (where a singleton is defined as a single instance per type).
You still can have only one instance of a given type available at any level in the heirarchy, but you can have multiple heirarchies with multiple levels, so you can have one singleton instance per "context", where a "context" is a service heirachy and level.
With the TypeAlias outlined in my blog, the pseudo-singleton-ness restriction is completely removed.