Geeks With Blogs
Mario @ geeks with blogs Abstracting the world with .Net

There's allready been a lot written about the Provider Model pattern. But in my opinion this pattern is more powerfull than most people realize. That's my reason to do a contribution on sharing some knowledge about this pattern.

The Provider Model pattern was born while Microsoft was developping version 2.0 of the ASP.Net framework (Whidbey).  The name was given somewhere in the summer of 2002. The pattern was designed to give developers the abillity to have complete control over the internal implementation for a specified API.

Because it is currently only supplied within the ASP.Net framework and not in the whole .Net framework, I think that there is a mis understanding about the concept. In my opinion is the pattern more valuable than most people assume. So let's have a deeper look into what the pattern really ships to us.

A provider is a contract between an API and the Business Logic and/or the Data Abstraction Layer. The provider is the real implementation of the API separate from the API itself. So the API itself does not contain any business logic, instead it forwards a call to the configured provider for it. The provider is responsible for the implementation of the API (or a part of it) and can call whatever type of BLL or DAL. See the picture below for an illustration of this.

Provider_interaction

 

A provider implementation must always derive from an abstract base provider, which is used to define the contract for a particular feature of an API. The base provider class must always derive from the ProviderBase class, which can be found in the .Net framework under the System.Configuration.Providers namespace. The ProviderBase class is used to mark implementers as a provider and forces the implementation of a required method and property common to all providers. The picture below illustrates this inheritance chain.

 

 provider

 

Now we have exposed how the Provider Model pattern can help us from decoupling API interfaces and their implementations, it is the next step to show up the broad range we can use this decoupling for.

Posted on Saturday, October 20, 2007 2:02 AM | Back to top


Comments on this post: The Provider Model pattern exposed

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Mario | Powered by: GeeksWithBlogs.net