Re: OOP slow -- am I an idiot?

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

 



"Roman Neuhauser" <neuhauser@xxxxxxxxxx> wrote in message 
news:20061012023956.GB27821@xxxxxxxxxxxxxxxxxxx
># stuttle@xxxxxxxxx / 2006-10-11 21:28:36 +0100:
>> 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.

I have to disagree as well. There is absolutely nothing wrong which the 
approach of creating one class for each table in the database. It cannot be 
wrong for the simple reason THAT IT WORKS! It is also the simplest approach 
as it keeps all the business rules for each database entity in a single 
class. Also, by keeping the structure of each object in sync with the 
structure of the database you don't have to introduce another pointless 
level of complexity with OR mappers.

Those OO "purists" who insist on creating object hierarchies which bear no 
resemblance to the database structure are making a rod for their own backs. 
That notion of "purity" is my idea of "putrefaction".

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org 

-- 
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