Posts Tagged ‘.NET’

C# How-To: Creating a Driver Foundation

// September 22nd, 2008 // 2 Comments » // .NET, C#, Programming

“Driver Foundation”?
A driver foundation is a class that your program will go through to access several other types of classes that all have something in common (i.e.: A database driver).

Generic Outlook

dbf_flow1

Actual Example for Database Platform

dbf_flow2

Why would I need this? Is this really necessary?
If you’re not worried about expandability in your application, then forget about it. However, if you’re designing an application that would need to access and query different types of databases (MySQL, PostgreSQL, SQLite, MSSQL, etc), then having a driver foundation is ideal. Otherwise you will end up with an unmanageable mess of code – you would need to control (for each different database type) the output type for queries, query syntax, and a bunch of other stuff.

Using a driver foundation you really only deal with one type of object, and one type of output for all types of databases.

(more…)