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

Re: Testing & Databases

by l3nz (Friar)
on Jan 28, 2004 at 11:58 UTC ( #324652=note: print w/replies, xml ) Need Help??

in reply to Testing & Databases

I think you should use a separate database; and that the database connection string should be held only in one place in your code. This will make it much simpler to connect to a different database for some useful purpouse but testing (say, having a parallel database running after a restore, or testing different versions of your app with different database schemas, and so on).

The time it'll take to insulate the connection string to a variable will be abundantly worth it.

By the way, you can very likely automate the task of finding-and-replacing, given that I guess you won't be opening a connection now and again and that the connection string - that I guess will be always the same - can be substituted to a global variable.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2022-08-12 05:19 GMT
Find Nodes?
    Voting Booth?

    No recent polls found