|
Posted by Chung Leong on 01/01/06 05:21
Full Decent wrote:
> Hey all!
>
> I've been using PHP for a while and I'm hearing that I should look into
> using it OO. I'm looking into making changes to the program Camera Life
> (http://fdcl.sf.net). I want to abstract the connection to the database
> which is currently MYSQL and maybe implement another database, or just
> leave it open for addition. If I get lucky and get the hang of this,
> I'd also like to abstract calls to GD.
That's not a good approach. There is no point in abstracting calls to
the database, as the bulk of the differences between databases lies in
the sematics of the queries. What you really want to do is abstract the
entire data retrieval process. You application code doesn't need to
know that it's getting its data from a database. The data just needs to
be coming from somewhere: a MySQL database, a MS-SQL database, an
XML-file, or even a SOAP-compatible web-service. If your application is
agnostic in regards to data source, then it's automatically database
independent.
Navigation:
[Reply to this message]
|