Women in Technology

Hear us Roar



Article:
  Transparent Database Access with ADO.NET
Subject:   Class factories and configuration are good
Date:   2003-01-07 07:56:40
From:   mogens
The mechanism used is what's generally known as a class factory (go look in the Gamma et al big book of patterns for more details).


The Pragmatic Programmers book says "Configuration is better than code". All the stuff you can push down into config files instead of hard-coding is good. This code is a great example of that.


At work we've actually taken a different approach, which is to wrap the classfactory and the general code access inside a custom provider, so we just use the custom provider and it figures out which database it's talking to on the fly.