in reply to Should it be database independent?

Unless you're working on a project that needs database independence -- such as an open source application -- a better goal with this abstraction is encapsulation. It's much easier to work on code that has database access all in one place than strewn about.

Replies are listed 'Best First'.
Re^2: Should it be database independent?
by Joost (Canon) on Mar 21, 2005 at 21:29 UTC
    I agree. Unless you can use a mostly database independent layer like Class::DBI (and that depends mostly on the kind of queries you need to do), IMO the best you can do is to at least make it easy to switch databases later. You usually don't need database-independence, you just don't want to make it too hard to switch. Factoring out the SQL from the application code is probably a good idea. For instance, you can probably go a long way just by putting the SQL statements in a seperate file.