Re: One class, many methods: PHP4.x: Q's

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/10/07, Micky Hulse <micky@xxxxxxxxxxxxx> wrote:
Micky Hulse wrote:
> Ah, well Chapter 6, page 144-145 have helped clear-up a little bit of my
> confusion:

Sorry, forgot to mention what book I was refering to:

O'Reilly Programming PHP By Rasmus Lerdorf & Kevin Tatroe
<http://snipurl.com/1k4ug>


--
Wishlists: <http://snipurl.com/1gqpj>
    Switch: <http://browsehappy.com/>
      BCC?: <http://snipurl.com/w6f8>
        My: <http://del.icio.us/mhulse>

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


If at all possible you're going to want to use PHP5 if you're doing
OOP.  I use it all the time in 4, but you're going to have to deal
with references until you are sick and it is just annoying when most
of those "problems" have been alleviated.

Also I would recommend always defining all of the class variables that
it will possibly use.  Some of the code I write lives for years and
working over dozens of different projects it is impossible to remember
everything completely.  Also it will help avoid bugs such as undefined
variables and all of that.

The get and set method's you wrote are part of the concept of
encapulation.  Read this:
http://en.wikipedia.org/wiki/Information_hiding for more information.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux