Re: Beginner Tutorials for using CLASSES in PHP4

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

 



On 10/3/07, Tony Marston <tony@xxxxxxxxxxxxxxxxxxxxxxxx> 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

[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