How to develop
ASP.NET 2.0 Application using
Provider Design Pattern
Provider Design Pattern is a new pattern that Microsoft formalized it in ASP.NET
Whidbey. The pattern was officially named in the summer of 2002 when Microsoft
was designing the new Personalization feature of ASP.NET Whidbey.
1- We won’t explicitly instantiate classes. We let .NET framework take care of
instantiating our classes. Framework will be responsible and will manage class
instantiation. Framework will re-use classes that have already been instantiated.
This will have great effect on memory management of your application.
2- If for some reason you want to change the source of data for your
application, for example, moving your database from SQL server to Oracle OR vise
versa OR changing your SQL database server to some sort of XML data source, you
will have very easy time to implement this requirement. All you have to do is to
replace your existing concrete (implementer) class with a new concrete
(implementer) class and inherit from your provider class. That’s all.
Your presentation and business logic layer will be kept intact. You don’t have to
make any changes into your presentation and business logic layers.
3- Learning Provider Design concept will make it very easy to customize built-
in .NET framework providers.
Note: Before we start, I would like to remind you that please use the same exact
naming convention and names that I used in this document to develop your solution.
Once you build your first application based on this new model and got the whole
picture, then you can use your own naming convention and naming.
Our solution will have 3 projects:
ASP.NET project (agds)
Business Logic project (BusinessLogicLayer)
Data Access project (DataAccessLayer)
Go to Visual Studio 2005 start page choose “Create Website” and name the project
agds. Go back to start page and choose “Create Project”, choose “Class library”
name the project BusinessLogicLayer and make sure choose add i