Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Topics in Perl Programming: Table-Mutation Tolerant Database Fetches with DBI

by quidity (Pilgrim)
on Nov 29, 2000 at 00:20 UTC ( #43760=note: print w/ replies, xml ) Need Help??


in reply to Topics in Perl Programming: Table-Mutation Tolerant Database Fetches with DBI

If you expect to have to access a database with colums that change then it's time for you to embrace a buzzword or two.

Essentially you need to tuck away all the bits of your code which actually talk to the database. Make a module with an OO interface, ensure that remains constant in time, then any changes in the database structure (or even the method of actually storing the data) become moot.

Then to get at some data all you'd need to do is:

@values = $abstracted_db->beans_with_colour('red');

Now, doing that might take a bit of thought, but in the end it will pay off. The main drawback is that it slows you down a bit, but when you talk to databases, you're going to be fairly slow anyway.


Comment on Re: Topics in Perl Programming: Table-Mutation Tolerant Database Fetches with DBI
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-09-02 01:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (18 votes), past polls