Reputation: 57872
.NET's ProviderBase
was established in the 2.0 release of the .NET Framework. Have there been any new features since then that supercede or improve on this pattern that should be used as an alternative?
Upvotes: 4
Views: 1400
Reputation: 4931
The provider pattern definitely had its day, but these days dependency injection frameworks have become so powerful and easy to use that they are a better option.
Drawbacks I discovered when using the provider pattern:
found it really tedious to write the code for the neccessary configuration classes.
had to manage alot of painful and redundant configuration.
discovered that you must limit your inheritance class to ProviderBase.
If you need to stick with Microsoft stuff, then Unity can work. There are plenty of others DI frameworks such as Structuremap or Ninject that have a much more simple way of hooking up dependencies.
Upvotes: 2