NYCPHP Meetup

NYPHP.org

[nycphp-talk] Learning to use OOP in PHP

Brian O'Connor gatzby3jr at gmail.com
Wed Mar 23 22:39:26 EST 2005


That's assuming I have the news only in one spot.

I could have a news page and then a box with headlines etc somewhere
else that is displayed elsewhere (I don't, but I could).

More specifically, I was going to have a Comments and User class, with
different methods within each which could be used on multiple pages.


On Wed, 23 Mar 2005 18:59:05 -0500 (EST), Francisco Reyes
<lists at natserv.com> wrote:
> 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.
> 
> _______________________________________________
> New York PHP Talk Mailing List
> AMP Technology
> Supporting Apache, MySQL and PHP
> http://lists.nyphp.org/mailman/listinfo/talk
> http://www.nyphp.org
> 


-- 
Brian O'Connor



More information about the talk mailing list