[UPHPU] Data abstraction layer clarification

Nathan Lane nathamberlane at gmail.com
Wed Apr 16 14:16:23 MDT 2008


I was googling "PHP best practices" and came across this
website<http://www.odi.ch/prog/design/php/guide.php>,
and it states,

"In PHP there are no database-independent functions for database access
apart from ODBC (which nobody uses on Linux). You should not use the
PHPdatabase functions directly because this makes it expensive when
the
database product changes. Your customer may move from MySQL to Oracle one
day or you will need an XML database maybe. You never know. Moreover an
abstraction layer can ease development as the PHP database functions are not
very userfriendly."

Which seems to say to me, "don't ever use PHP to access the database
directly," yet I'm sure that's not what's it's saying. Can anybody clarify?
My intent was to create a layer of classes and functions that allow me to
access the database transparently for what I need - probably some sort of
Active Record methodology would be implemented. Is that what is being said
here, or is it saying what I perceived it to say?

-- 
Nathan Lane
Home, http://www.nathandelane.com
Blog, http://nathandelane.blogspot.com


More information about the UPHPU mailing list