Sunday, November 21, 2010

DOT NET FRAMEWORK: PROVIDERS IN DOT NET

It has always been a problem when it comes to understand provider in .Net and most of the people miss conceptualized it specially beginners, same was the case with me. So I decide to a post on it. I am writing this post for beginner and intermediate level audience.
What is provider in .Net implementation?
At grass root level provider is a dll (class library) which contains the some specific implementation. For instance:
ActiveDirectoryMembershipProvider this provider is used for authenticating user from active directory in domain environment. We refer to this provider by using its fully qualified name.
System.Web.Security.ActiveDirectoryMembershipProvider

SqlMembershipProvider this provider is used for user authentication from the database created by aspnet_regsql.exe command. We refer to this provider by using its fully qualified name.
System.Web.Security.SqlMembershipProvider


This dll knows the schema of the database created by aspnet_regsql.exe command. It also contains methods to authenticate user, create user, edit user, delete user etc.
When using these providers we don’t need to worry about writing code because Microsoft has already done that job for us. All we need to do is:

1.  Specify the provider and it configuration in web.config.
2.  Specify the provider in the ASP.Net login controls so that they can utilize this provider.

You can even write your own provider let’s say you want to authenticate users from Linux domain, so u can write your own provider which has the implementation for authenticating user from Linux domain.

There are several other providers shipped with .Net framework and all of them server different purpose.


Site map                     --   System.Web.XmlSiteMapProvider

Profile                         --   System.Web.Profile.SqlProfileProvider

Session state              --   System.Web.SessionState.InProcSessionStateStore
                                    --   System.Web.SessionState.OutOfProcSessionStateStore
                                    --   System.Web.SessionState.SqlSessionStateStore


So the rule of thumb is provider is nothing but a dll which server what it is written for. Hope this post help you people, have a nice day :).

2 comments:

  1. Every thing in .net is composed in dll (or assembly) and provider classess are no exceptions. Please provide details how to create providers and their standard architecture to implement them.

    ReplyDelete
  2. Please refer to these articles:
    http://www.15seconds.com/issue/050216.htm

    http://www.devx.com/asp/Article/29256/0/page/1

    ReplyDelete