Reply to Re: php 5 classes: public, protected and private

Your name:

Reply:


Posted by Tony Marston on 12/07/06 11:52

"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:uKCdnemKmvXicOvYnZ2dnUVZ_oOdnZ2d@comcast.com...
> Tony Marston wrote:
>> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>> news:heudnY0tgPFj7-jYnZ2dnUVZ_rCdnZ2d@comcast.com...
>>
>>>Tony Marston wrote:
>>>
>>>>"Michael Fesser" <netizen@gmx.de> wrote in message
>>>>news:4ud8n2dcgrj80p0c9dske38l4othi3c631@4ax.com...
<snip>
>>>>I am not wrong. I have made two simple statements that you cannot
>>>>disprove:
>>>>
>>>>(a) In PHP interfaces are not necessary.
>>>>(b) Enapsulation does not mean that all variables must be declared
>>>>private or protected.
>>>>
>>>>What's so difficult to understand about that?
>>>>
>>>
>>>You're wrong because:
>>>
>>> (a) Interfaces, as defined in OO terms (which is what we were
>>> discussing, and PHP is an OO language) are necessary.
>>
>> In PHP interfaces are NOT necessary.
>>
>>> They are how you interact with the object, and
>>
>> Wrong. You interact with an object by calling an object's method. The
>> fact that a method may have an optional interface declaration has nothing
>> to do with it.
>
> And in OO terms that is the INTERFACE! But you don't know anything about
> OO, that's obvious.

You are confusing the term inetrface (as in Application Programming
Interface or API) with the construct that uses the word "interface" and
"implements". An API is simply a function name with a list of arguments,
while interfaces are hings which exist in addition to the function
definition.

It is a simple fact that I can access an object's method by using the
function definition (API) and NOT tghe piece of code which contains the word
"interface".

The terms API and interface in OO terminology do not mean the same thing.

>>
>>> (b) Proper encapsulation means that all variables are defined as
>>> private,
>>
>>
>> Wrong. Encapsulation simply means putting all the data for an object, and
>> the operations which act upon that data, into a single class. There is no
>> requirement to make all the data private, as there is no requirement to
>> make any methods private.
>
> Wrong again, Troll Tony.

My definition of encapsulation is not wrong What is your definition?

I still stick to my original statements:

(a) In PHP interfaces are not necessary.
(b) Encapsulation does not mean that all variables must be declared private
or protected.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация