in reply to The fine art of database programming
Despite what gmax says about not being afraid of writing raw SQL and using DBI directly I'd still say that you should try and route all your database access through one or two modules (either tools from CPAN, or home rolled) as a way of limiting your dependencies and avoiding the problem of a single change in the database leading to the Death of a thousand cuts as you trawl your codebase hunting down everything that deals with the affected tables.
The 'performance hit' you'll see as a result of doing this will be nothing compared to increase in 'cost of change' you see when scatter SQL throughout your code like an incontinent puppy. (Guess who's had to work with code like that recently. It's painful.) And then there's testability. When you access the database only through your 'mediator' modules, it becomes possible to drop in a replacement that only pretends to talk to a 'real' database. This can be a remarkably powerful testing technique...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: The fine art of database programming
by gmax (Abbot) on Apr 30, 2002 at 14:43 UTC | |
Re: Re: The fine art of database programming
by ignatz (Vicar) on Apr 30, 2002 at 15:41 UTC | |
by pdcawley (Hermit) on May 01, 2002 at 08:42 UTC |