Re: Beginner Tutorials for using CLASSES in PHP4
| From: | Nathan Nobbe | Date: | Wed, 03 Oct 2007 17:07:07 +0000 |
| Subject: | Re: Beginner Tutorials for using CLASSES in PHP4 | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-262695@lists.php.net to get a copy of this message | ||
On 10/3/07, Tony Marston <tony@marston-home.demon.co.uk> wrote:
>
> Encapsulation is NOT data hiding. Take a look at
please stop putting words into my mouth. i never once said encapsulation is
data hiding.
I stated PublicPrivateProctected facilitates encapsulation. tonight when i
get home ill post
a snippet from an entry level oop book (such that i recommend earlier) that
says almost
verbatim what i have.
practically any non-trivial class will have member variables that it uses in
order to facilitate
its member functions. many of those variables have nothing to do w/ the
functionality the
class exposes to client code. if those variables are modified directly,
because they cant be
protected by ppp, then the functionality of the class can be distorted.
that is why ppp exists.
if a class has variables client code doesnt need to know about to do its
job, then client code
by no means should have access to it.
interfaces are a powerful mechanism. its a shame youre turning your back on
them.
-nathan