Daniel Schaffer
Daniel Schaffer

Reputation: 57872

The .NET ProviderBase pattern

.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

Answers (1)

Bermo
Bermo

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:

  1. found it really tedious to write the code for the neccessary configuration classes.

  2. had to manage alot of painful and redundant configuration.

  3. 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

Related Questions