"Roman Neuhauser" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
># [EMAIL PROTECTED] / 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

Reply via email to