Find out how to protect your code from changes by taking advantage of the Provider Model, which lets you swap components at run time.
by Paul D. Sheriff
December 26, 2007
evelopers constantly face problems brought on by changing technologies. When Microsoft releases a new version of a data provider, or a customer decides to switch databases from Oracle to SQL Server, you may have to rework code you've already written. But you can avoid much of this rework if you take the time to plan and code for such changes. One recommended way to do this is to develop components that take advantage of the Provider Model.
A provider is a class or a component that provides specific functionality to an application. However, the Provider class used will not be known until run time. In this article, you will see how to create a data provider that lets you change from using SQL Server to a generic OLE DB provider with no code changes! You will just have to change a setting in a configuration file. Using the Provider Model gives you a great amount of flexibility and upgradeability to your source code.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!