Re: OOP slow -- am I an idiot?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Lynch wrote:
On Tue, October 10, 2006 6:14 pm, Chris de Vidal wrote:
I want to create a "customer" class which fetches its attributes from
a MySQL database.

No, you don't. :-)

This is a classic example of the "obvious" OOP solution being wildly
inappropriate.

Ok, so I now find myself in the unusual position of disagreeing with the Lynchmeister. Why is this wildly inappropriate? IMHO this is what OOP is all about.

You can encapsulate everything to do with a customer in an object. This ensures that you don't duplicate any code that works on customer data. You avoid duplication of code. As a result you can ensure data integrity because there is only one route to read and write it.

If this is not what you think OOP is all about, do please enlighten us as to the error of our ways.

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux