Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: The fine art of database programming

by Matts (Deacon)
on May 01, 2002 at 11:22 UTC ( #163237=note: print w/ replies, xml ) Need Help??


in reply to The fine art of database programming

Great post.

One module I'd like to point out that can come in really useful for cross-database applications is DBIx::AnyDBD. This follows the principle laid out above - knowing your database is extremely important, and so you should have access to it's features.

But beyond that, it ensures that you can always port your application to a new database in a clean and consistent manner, and in a way that your users won't have to care about (apart from changing the DBI connect string). It does this by simply providing a subclass for each database. So you write your default query stuff in a Default.pm file, and put Oracle specific stuff in Oracle.pm, Sybase specific stuff in Sybase.pm, and PostgreSQL specific stuff in Pg.pm. It then uses simple rules at connect time to give you the right class, and it does this correctly with the Windows abstraction layers ODBC and ADO too.

Another point in its favour is that DBIx::AnyDBD is going to be incorporated into DBI core in the next major DBI revision.


Comment on Re: The fine art of database programming

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://163237]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (18)
As of 2014-08-22 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (163 votes), past polls