Re: OOP slow -- am I an idiot?

From: Date: Wed, 11 Oct 2006 20:28:36 +0000
Subject: Re: OOP slow -- am I an idiot?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-243003@lists.php.net to get a copy of this message
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

« previous php.general (#243003) next »