Re: class usage
| From: | Ray Hauge | Date: | Fri, 29 Sep 2006 14:28:46 +0000 |
| Subject: | Re: class usage | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-242395@lists.php.net to get a copy of this message | ||
On Friday 29 September 2006 4:35 am, benifactor wrote:
> the real question is what
> are some real life examples of class usage and why is it used as opposed
> to regular non oop? thank you for any input into the subject that you may
> have.
I think people have pretty much hit the nail on the head with OOP. One thing
that I would like to point out is that OOP isn't necessarily needed in every
case. There are times when making a class to abstract a certain
feature/process is a good idea, and there there are times where it can go a
bit too far. This is definitely a very simple example, but the usual "Hello
World" script doesn't exactly need to be writen in a class structure.
I usually try to ask myself this question when I'm designing something:
"What are the benefits of using OOP?"
If the answer is simply "To use OOP" then you're probably headed in the wrong
direction, at which point I step back and look at the big picture again.
In short, OOP is something to be used to your advantage, but if overused can
just cause unnecessary overhead and confusion (IMO)
--
Ray Hauge
Application Development Lead
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099