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?


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.

Need Your Help

Entity Framework and Anonymous Types in F#

entity-framework f#

Trying to get a query with an anonymous type working:

GC.Collect() and PerformanceCounter

c# .net memory-leaks performancecounter

A colleague of mine is convinced there is a memory leak in Oracle's implementation. He has written a test program to test this theory and is doing the following after calling dispo...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.