[nycphp-talk] Learning to use OOP in PHP
Francisco Reyes
lists at natserv.com
Wed Mar 23 18:59:05 EST 2005
On Wed, 23 Mar 2005, Brian O'Connor wrote:
> Here is an example class I might write in order to retrieve
> information for my news page:
I think a class for something that specific is probably NOT a good idea.
A class, in my opinion, is meant to be something you use for several
programs.
The example you wrote is basically a one program/scenario class. I think
on a case like that it's probably counterproductive.
On the other hand if you wrote class that would take as a parameter a
connect string to the database and be able to insert/read data from ANY
table, that would be worth spending the time making a class out of it.
More information about the talk
mailing list