Hi Pablo,

The 3 main strong points of using OOP are:

1. Encapsulation
2. Inheritance
3. Polymorphism

I like using OOP instead of includes because of these points.  It helps me
alot in doing maintenance releases using this technique instead of having
to deal with thousands of codes which can be abstracted from me with
encapsulation for instance.

regards,
Jonel

> Hi, This is my first post. English is my 2nd language so I apologize for
>   any mistakes I might have.
>
> I would describe myself as an intermediate self-thaught PHP programmer,
>  which means I can do lots of stuff but probly my coding techniques
> sucks :P
>
> Anyway, Im reading a lot about OOP lately, and I've fixing other's
> people   scripts which use OOP for "small" stuff that could have been
> acomplished   with simple functions or includes maybe... so I started
> wondering, why use   OOP when you can use something simpler...
>
> Imagine the following example:
> A table of MySQL on a simple classifieds site holds the info for each Ad
>   posted ( timestamp, user who posted it, title, description, location,
>  country, etc).
> A php page called ads.php gets the ad ID via $_GET and prints out its
> information in a nicely formated page.
>
> What I usually do is to put all the "echo-ing" part of this page in a
> separate include (ie: ads_details.php ), so that if I need to also show
>  this in another page, I call the same include.  If I decide to do a
> change   later, I only have to change it in one part of the script
> alone.
>
> What I've seen a lot lately is that people do the same with classes
> (they   write a class that will output the same thing I output thru an
> include)...   so I guess there must be  pros and cons regarding using
> both methods...
>
> Could anyone point me to a good reading (free, internet) material to
> read   about this or any other advice so I continue learning about OOP
> and when   to use it ?
>
> If you read it all the way down here THANKS !  :D
>
> Pablo Fernandez-Stearns
> BA. Argentina.
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to