Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

php 5 classes: public, protected and private

6 views
Skip to first unread message

jopperdepopper

unread,
Nov 27, 2006, 10:18:18 AM11/27/06
to
Hi,

finally giving php 5 a go, and going over the new approach to classes.
Can someone clarify the public, private and protected to me?

I quote the php manual: "The visibility of a property or method can be
defined by prefixing the declaration with the keywords: public,
protected or private. Public declared items can be accessed
everywhere."

But should I read "...can be accessed everywhere within a given class."
or "...can be accessed by all other classes." ?

Job

Jerry Stuckle

unread,
Nov 27, 2006, 10:28:07 AM11/27/06
to

Job,

You should read "can be accessed everywhere".

Private members can be accessed by members of the class only.
Protected members can be accessed by members of the class or a derived
class.
Public members can be accessed by anyone, including other classes,
functions and any other code.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

jopperdepopper

unread,
Nov 27, 2006, 11:19:20 AM11/27/06
to

>
> You should read "can be accessed everywhere".
>
> Private members can be accessed by members of the class only.
> Protected members can be accessed by members of the class or a derived
> class.
> Public members can be accessed by anyone, including other classes,
> functions and any other code.


Thanks Jerry. I'm trying to make a bit of sense of the php 5 approach
to classes, and so far having a hard time. I fail to see the 'why'
behind the 'public, protected and private' and stuff like abstraction,
interfaces and whatnot. Feels like things are being over-complicated
somehow... or it's just my being inexperienced on this...

Any other reading material on this suggested, someone?

Jerry Stuckle

unread,
Nov 27, 2006, 11:38:46 AM11/27/06
to

Look for some good books on OO theory and design.

Two of the concepts in OO are 'encapsulation' and 'methods'.

Encapsulation means the internals of an object are managed only by that
object and are not available to anyone else. In PHP these are private
members.

Methods are implemented as functions in PHP. They operate on the object.

The idea is to completely separate the implementation of the class from
the use of it. It means you can change the class any way you want. As
long as the public interface remains the same, it makes no difference.

A good example of this is floating point numbers. They are stored as a

x * 2^y

X is the mantissa, y is the base 2 exponent. For instance, 8 would be
stored as x=1 and y=3, because 8 is 1 * 2^3. But all of this is hidden
behind the scenes; you can do operations on a floating point number such
as add, subtract, print, etc.

And if at some other time PHP changed the implementation to something
else, none of your code would change.

jopperdepopper

unread,
Nov 27, 2006, 2:15:00 PM11/27/06
to

> Look for some good books on OO theory and design.
>

Thanks Jerry, maybe the php 5 approach is a better implementation than
the php 4 approach? I have always felt that in php 4 using classes (or
at least my way of using them) was more a convenient way to organise
code, grouping some related functions in one class, other related ones
in another...

Gotta get me some books & hope it's going to be a loooong coooold
winter ;)

Jerry Stuckle

unread,
Nov 27, 2006, 2:40:29 PM11/27/06
to

Yes, I think it is - but then I've been doing OO programming for a
number of years, both in C++ and Java.

Classes are a good way to organize code - but more importantly, they are
a way of organizing code AND DATA. A properly constructed class should,
as much as possible, manage it's own data independent of other classes
and code.

It's a whole different way of thinking which is usually quite a jump for
experienced programmers. In fact, I find newer programmers typically
have less problems, because structured code techniques are not so deeply
ingrained in their mind. :-)

But it's well worth it; the resulting code can be much more readable and
maintainable.

A good example. I needed to implement some pages based on a database.
However, the particular host being used at the time did not have MySQL
available (they claimed they did, but it wasn't very reliable...).

So I implemented the code in flat files using a class for the data being
displayed, and pages to use that class. Later, when they changed to a
host which had MySQL, all I had to do was go back to the class and
change it to read from a database instead of a flat file. No changes to
the pages were needed at all. Very clean and easy to do, because I
segregated the operations on the data in the class, and used the web
page code just to display the data.

Tony Marston

unread,
Nov 27, 2006, 6:32:24 PM11/27/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:Ib6dna_BtYQSifbY...@comcast.com...

> jopperdepopper wrote:
>>>You should read "can be accessed everywhere".
>>>
>>>Private members can be accessed by members of the class only.
>>>Protected members can be accessed by members of the class or a derived
>>>class.
>>>Public members can be accessed by anyone, including other classes,
>>>functions and any other code.
>>
>>
>>
>> Thanks Jerry. I'm trying to make a bit of sense of the php 5 approach
>> to classes, and so far having a hard time. I fail to see the 'why'
>> behind the 'public, protected and private' and stuff like abstraction,
>> interfaces and whatnot.

Intefaces are not necessary in PHP. Once you have defined a method it is a
total waste to time to also define an interface. Interfaces are a "fix" in
those languages as a means of dealing with optional arguments and statyic
typing. PHP has ifferent ways of dealing with bth of these, therefore
interfaces serve no useful purpose.

>> Feels like things are being over-complicated
>> somehow... or it's just my being inexperienced on this...
>>
>> Any other reading material on this suggested, someone?
>>
>
> Look for some good books on OO theory and design.
>
> Two of the concepts in OO are 'encapsulation' and 'methods'.
>
> Encapsulation means the internals of an object are managed only by that
> object and are not available to anyone else. In PHP these are private
> members.

Wrong. Encapsulation means that the data and the functions which operate on
that data are contained (encapsulated) within a single object. While the
methods (functions) thenselves may be visible the code behind those methods
(i.e. the implementaton behind those methods) is not. Encapslation is NOT
about hiding information, it is about hiding the implementation. It is not
necessary to use public/private/protected on any methods or properties. It
does not add any functionality, it merely creates restrictions which often
get in the way.

> Methods are implemented as functions in PHP. They operate on the object.

That's one thing you got right.

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


Michael Fesser

unread,
Nov 27, 2006, 7:14:59 PM11/27/06
to
.oO(Tony Marston)

>Intefaces are not necessary in PHP. Once you have defined a method it is a
>total waste to time to also define an interface. Interfaces are a "fix" in
>those languages as a means of dealing with optional arguments and statyic
>typing. PHP has ifferent ways of dealing with bth of these, therefore
>interfaces serve no useful purpose.

What's called an interface in PHP is a completely different mechanism
than what you described above.

>Wrong. Encapsulation means that the data and the functions which operate on
>that data are contained (encapsulated) within a single object. While the
>methods (functions) thenselves may be visible the code behind those methods
>(i.e. the implementaton behind those methods) is not. Encapslation is NOT
>about hiding information, it is about hiding the implementation. It is not
>necessary to use public/private/protected on any methods or properties.

Of course it is necessary.

>It
>does not add any functionality, it merely creates restrictions which often
>get in the way.

It prevents developers from doing things that shouldn't be done, for
example calling an internal method out of context. I don't want all my
methods being publicly available, simply in order to avoid errors and
unpredictable results.

Micha

Jerry Stuckle

unread,
Nov 27, 2006, 10:07:09 PM11/27/06
to
Tony Marston wrote:
> "Jerry Stuckle" <jstu...@attglobal.net> wrote in message
> news:Ib6dna_BtYQSifbY...@comcast.com...
>
>>jopperdepopper wrote:
>>
>>>>You should read "can be accessed everywhere".
>>>>
>>>>Private members can be accessed by members of the class only.
>>>>Protected members can be accessed by members of the class or a derived
>>>>class.
>>>>Public members can be accessed by anyone, including other classes,
>>>>functions and any other code.
>>>
>>>
>>>
>>>Thanks Jerry. I'm trying to make a bit of sense of the php 5 approach
>>>to classes, and so far having a hard time. I fail to see the 'why'
>>>behind the 'public, protected and private' and stuff like abstraction,
>>>interfaces and whatnot.
>
>
> Intefaces are not necessary in PHP. Once you have defined a method it is a
> total waste to time to also define an interface. Interfaces are a "fix" in
> those languages as a means of dealing with optional arguments and statyic
> typing. PHP has ifferent ways of dealing with bth of these, therefore
> interfaces serve no useful purpose.
>

Ah, the great Tony Marston is back to trolling again.

Wrong. In OO terms, the interface is the way to interact with the
object. It consists of all public members - both methods (functions, in
PHP) and variables. And for derived classes, the base class adds
protected members.

A PHP interface is something entirely different.

>
>>>Feels like things are being over-complicated
>>>somehow... or it's just my being inexperienced on this...
>>>
>>>Any other reading material on this suggested, someone?
>>>
>>
>>Look for some good books on OO theory and design.
>>
>>Two of the concepts in OO are 'encapsulation' and 'methods'.
>>
>>Encapsulation means the internals of an object are managed only by that
>>object and are not available to anyone else. In PHP these are private
>>members.
>
>
> Wrong. Encapsulation means that the data and the functions which operate on
> that data are contained (encapsulated) within a single object. While the
> methods (functions) thenselves may be visible the code behind those methods
> (i.e. the implementaton behind those methods) is not. Encapslation is NOT
> about hiding information, it is about hiding the implementation. It is not
> necessary to use public/private/protected on any methods or properties. It
> does not add any functionality, it merely creates restrictions which often
> get in the way.
>

Wrong again, Tony. Encapsulation means internal representations of the
object are not visible outside of the class. Just like the base &
mantissa are not visible outside of a floating point number.

>
>>Methods are implemented as functions in PHP. They operate on the object.
>
>
> That's one thing you got right.
>

More than you got right. Go crawl back into your hole and don't come
out again until you know what you're talking about.

Tony Marston

unread,
Nov 28, 2006, 5:23:47 AM11/28/06
to

"Michael Fesser" <net...@gmx.de> wrote in message
news:fdvmm2hngste2mc3v...@4ax.com...

> .oO(Tony Marston)
>
>>Intefaces are not necessary in PHP. Once you have defined a method it is a
>>total waste to time to also define an interface. Interfaces are a "fix" in
>>those languages as a means of dealing with optional arguments and statyic
>>typing. PHP has ifferent ways of dealing with bth of these, therefore
>>interfaces serve no useful purpose.
>
> What's called an interface in PHP is a completely different mechanism
> than what you described above.

I disagree. It is possible to define a function (method) within a class,
then to define a separate thng called an "interface". It is possible access
he function without using the interface, therefore the inteface is not
necessary.

>>Wrong. Encapsulation means that the data and the functions which operate
>>on
>>that data are contained (encapsulated) within a single object. While the
>>methods (functions) thenselves may be visible the code behind those
>>methods
>>(i.e. the implementaton behind those methods) is not. Encapslation is NOT
>>about hiding information, it is about hiding the implementation. It is not
>>necessary to use public/private/protected on any methods or properties.
>
> Of course it is necessary.

I disagree. it is *not* necessary for the simple reason that the code will
perform exactly the same function whether methods and properties are marked
as public/private/protected or not.

>>It
>>does not add any functionality, it merely creates restrictions which often
>>get in the way.

That is why I said "It does not add any functionality, it merely creates
restrictions"

> It prevents developers from doing things that shouldn't be done, for


> example calling an internal method out of context. I don't want all my
> methods being publicly available, simply in order to avoid errors and
> unpredictable results.

That is a matter for programmer discipline, it is not a matter of additional
functionality. The code will do exactly the same with or without it.

Tony Marston

unread,
Nov 28, 2006, 5:31:05 AM11/28/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:j9-dnQB80fVLOvbY...@comcast.com...

I disagree. It is possible to define a function (method) within a class,
then to define a separate thing called an "interface". It is possible access
the function without using the interface, therefore the interface is not
necessary.

>>
>>>>Feels like things are being over-complicated
>>>>somehow... or it's just my being inexperienced on this...
>>>>
>>>>Any other reading material on this suggested, someone?
>>>>
>>>
>>>Look for some good books on OO theory and design.
>>>
>>>Two of the concepts in OO are 'encapsulation' and 'methods'.
>>>
>>>Encapsulation means the internals of an object are managed only by that
>>>object and are not available to anyone else. In PHP these are private
>>>members.
>>
>>
>> Wrong. Encapsulation means that the data and the functions which operate
>> on that data are contained (encapsulated) within a single object. While
>> the methods (functions) thenselves may be visible the code behind those
>> methods (i.e. the implementaton behind those methods) is not.
>> Encapslation is NOT about hiding information, it is about hiding the
>> implementation. It is not necessary to use public/private/protected on
>> any methods or properties. It does not add any functionality, it merely
>> creates restrictions which often get in the way.
>>
>
> Wrong again, Tony. Encapsulation means internal representations of the
> object are not visible outside of the class. Just like the base &
> mantissa are not visible outside of a floating point number.

I disagree. Encapsulation means that both the data and the methods which
operate on that data are contained within a single unit or "capsule". The
data names and the method names may be visible, it is only the code which
lies behind each method name which is invisible. A piece of data may be
accessed directly, as in $object->var, or it may be accessed through a
getter, as in $object->getVar().

If you bothered to read the right books you will see that encapsulation
means "implementation hiding" and not "information hiding".

>>
>>>Methods are implemented as functions in PHP. They operate on the object.
>>
>>
>> That's one thing you got right.
>>
>
> More than you got right. Go crawl back into your hole and don't come out
> again until you know what you're talking about.

I do know what I'm talking about..

Jerry Stuckle

unread,
Nov 28, 2006, 7:00:54 AM11/28/06
to

Tony,

You really need to learn about OO before spouting off. In OO terms, an
interface is something entirely different than a PHP interface.

PHP is not the only OO language. Some don't even have a term
"interface" as part of the language. But the still have an interface.

Try some of the books by James Rumbaugh, Grady Booch and/or Ivar Jacobson.

Again, read the experts before spouting off. You have repeatedly shown
how little you understand about OO programming techniques.

And yes, encapsulation is "implementation hiding". And the variables
are part of the IMPLEMENTATION.

>
>>>>Methods are implemented as functions in PHP. They operate on the object.
>>>
>>>
>>>That's one thing you got right.
>>>
>>
>>More than you got right. Go crawl back into your hole and don't come out
>>again until you know what you're talking about.
>
>
> I do know what I'm talking about..
>

Then why do you continually disagree with the recognized experts in the
OO community, like the ones I mentioned above?

Tony Marston

unread,
Nov 28, 2006, 12:50:08 PM11/28/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:PeudnRKltLJsufHY...@comcast.com...

How so? All the documentation I have seen describes how an interface simply
describes a method which it imlements. If it is possible to access a method
(a function in PHP) without going though an interface, ten an interface is
not necessary in any language.

I disagree. Inplementation is code, information is data. If you don't
believe me then read "Encapsulation is not information hiding" at
http://www.javaworld.com/javaworld/jw-05-2001/jw-0518-encapsulation.html and
also "Abstraction, Encapsulation, and Information Hiding" at
http://www.itmweb.com/essay550.htm

>>
>>>>>Methods are implemented as functions in PHP. They operate on the
>>>>>object.
>>>>
>>>>
>>>>That's one thing you got right.
>>>>
>>>
>>>More than you got right. Go crawl back into your hole and don't come out
>>>again until you know what you're talking about.
>>
>>
>> I do know what I'm talking about..
>>
>
> Then why do you continually disagree with the recognized experts in the OO
> community, like the ones I mentioned above?

I disagree with YOU simply because you clam to be a recognised expert when
in fact you are no such thing. I keep finding papers on the internet which
disagree with your explanations, yet you persist in claiming that you are
right and everybody who dares to disagree with you is wrong. Such arrogance!

Jerry Stuckle

unread,
Nov 28, 2006, 4:25:31 PM11/28/06
to

You need to understand the difference between an interface as described
in OO terms and the PHP interface.

The PHP interface defines a set of methods (function) which are required
by the classes which implement the interface. Java is similar in that
respect. But both are a subset of the total interface.

OK, so you quote a couple of blogs by people who have their own opinions.

Read books by the authors I mentioned. They are the experts on OO, not
just anyone who can post a blog or essay on the web.

>
>>>>>>Methods are implemented as functions in PHP. They operate on the
>>>>>>object.
>>>>>
>>>>>
>>>>>That's one thing you got right.
>>>>>
>>>>
>>>>More than you got right. Go crawl back into your hole and don't come out
>>>>again until you know what you're talking about.
>>>
>>>
>>>I do know what I'm talking about..
>>>
>>
>>Then why do you continually disagree with the recognized experts in the OO
>>community, like the ones I mentioned above?
>
>
> I disagree with YOU simply because you clam to be a recognised expert when
> in fact you are no such thing. I keep finding papers on the internet which
> disagree with your explanations, yet you persist in claiming that you are
> right and everybody who dares to disagree with you is wrong. Such arrogance!
>

No, you disagree with every recognized expert in the field. Read what
the authors I mentioned have to say about it. THEY are the recognized
experts in the field.

I can create a paper on the internet saying the sun rises in the west.
It's quite simple to do. But that doesn't make it a fact.

Now go home and do some reading. You might actually learn something.

Michael Fesser

unread,
Nov 28, 2006, 4:47:45 PM11/28/06
to
.oO(Tony Marston)

>I disagree. it is *not* necessary for the simple reason that the code will
>perform exactly the same function whether methods and properties are marked
>as public/private/protected or not.

Then why do we use OOP and high-level languages like PHP at all? Pure
hand-written assembler code will perform exactly the same function.

>> It prevents developers from doing things that shouldn't be done, for
>> example calling an internal method out of context. I don't want all my
>> methods being publicly available, simply in order to avoid errors and
>> unpredictable results.
>
>That is a matter for programmer discipline, it is not a matter of additional
>functionality. The code will do exactly the same with or without it.

The code written in a language like Delphi for example will also do
exactly the same with all type checks, range checks, overflow checks
etc. turned off. But does it make sense to do that and just rely on
"programmer discipline"? No, it doesn't, because it will lead to
erroneous code on the long run.

Compilers are able to automatically check a lot of things and warn the
developer if he made a mistake. Such checks and restrictions don't add
any functionality, but are necessary in order to write reliable code.

The same goes for visibility declarations. I don't rely on discipline or
a comment like "please don't call this method". If a method is not meant
to be called directly then it's declared as such - problem solved.

Micha

Jerry Stuckle

unread,
Nov 28, 2006, 9:08:33 PM11/28/06
to

Micha,

Tony and I have been into this before. He breaks into conversations
trying to spout his version of OO, with a few blogs from people no one
every heard of to back him up.

It's not worth getting into the argument. He's just a troll with
delusions of competency.

He'd never survive in a corporate programming shop.

Tony Marston

unread,
Nov 29, 2006, 5:39:59 AM11/29/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:bpudnWTDrLPbNPHY...@comcast.com...

It is possible to access the method directly without an interface, therefore
an interfae is not necessary.

Oh, I see. Only those people who agree with you can be called experts, while
everyone else is a charlatan. Even Martin Fowler says that "Encapsulation
Wasn't Meant To Mean Data Hiding" at
http://homepage.mac.com/keithray/blog/2006/02/22/, so are you saying that
Martin Fowler is not an expert?


>>
>>>>>>>Methods are implemented as functions in PHP. They operate on the
>>>>>>>object.
>>>>>>
>>>>>>
>>>>>>That's one thing you got right.
>>>>>>
>>>>>
>>>>>More than you got right. Go crawl back into your hole and don't come
>>>>>out again until you know what you're talking about.
>>>>
>>>>
>>>>I do know what I'm talking about..
>>>>
>>>
>>>Then why do you continually disagree with the recognized experts in the
>>>OO community, like the ones I mentioned above?
>>
>>
>> I disagree with YOU simply because you clam to be a recognised expert
>> when in fact you are no such thing. I keep finding papers on the internet
>> which disagree with your explanations, yet you persist in claiming that
>> you are right and everybody who dares to disagree with you is wrong. Such
>> arrogance!
>>
>
> No, you disagree with every recognized expert in the field. Read what the
> authors I mentioned have to say about it. THEY are the recognized experts
> in the field.

There is no such thing as a single view upon which all "experts" agree.
Wherever you look, either in books or on the internet, you will come across
examples where different sets of "experts" have different opinions and
views. Therefore it does not matter which set of "experts" you choose to
follow as a different set of "experts" will always say that you are wrong.

> I can create a paper on the internet saying the sun rises in the west.
> It's quite simple to do. But that doesn't make it a fact.

In your opinion it does if an "expert" says so. You have to know when an
"expert" is spouting wisdom and when he is spouting bulls*t.

> Now go home and do some reading. You might actually learn something.

The only thing I can learn from you is how NOT to do things.

Tony Marston

unread,
Nov 29, 2006, 5:49:24 AM11/29/06
to

"Michael Fesser" <net...@gmx.de> wrote in message
news:loapm2tvbcm1d41a5...@4ax.com...

> .oO(Tony Marston)
>
>>I disagree. it is *not* necessary for the simple reason that the code will
>>perform exactly the same function whether methods and properties are
>>marked
>>as public/private/protected or not.
>
> Then why do we use OOP and high-level languages like PHP at all? Pure
> hand-written assembler code will perform exactly the same function.

You can write OO code that uses pubic/private/protected and it will perform
exactly the same function as code which does not use
public/private/protected, therefore the use of public/private/protected does
not add any value. It is therefore optional and not mandatory.

>>> It prevents developers from doing things that shouldn't be done, for
>>> example calling an internal method out of context. I don't want all my
>>> methods being publicly available, simply in order to avoid errors and
>>> unpredictable results.
>>
>>That is a matter for programmer discipline, it is not a matter of
>>additional
>>functionality. The code will do exactly the same with or without it.
>
> The code written in a language like Delphi for example will also do
> exactly the same with all type checks, range checks, overflow checks
> etc. turned off. But does it make sense to do that and just rely on
> "programmer discipline"? No, it doesn't, because it will lead to
> erroneous code on the long run.

You are missing the point. If a piece of code does exactly the same thing
whether a feature is turned ON or OFF then that feature is optional.

> Compilers are able to automatically check a lot of things and warn the
> developer if he made a mistake. Such checks and restrictions don't add
> any functionality, but are necessary in order to write reliable code.

I disagree. I do not need a statically typed language to write software. I
can do just as well with a dynamically typed laguage. So can all the
millions of other programmers who use dynamically typed languages.

> The same goes for visibility declarations. I don't rely on discipline or
> a comment like "please don't call this method". If a method is not meant
> to be called directly then it's declared as such - problem solved.
>
> Micha

Whether a method or variable is marked visible or not does not make the
software run any differently, therefore it is optional, not mandatory.


Tony Marston

unread,
Nov 29, 2006, 6:01:10 AM11/29/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:VomdnXOSpecHdvHY...@comcast.com...

I see. So in your opinion Martin Fowler is of of these "people no one ever
heard of "? He says, like I do, that "Encapsulation Wasn't Meant To Mean

Are you saying that YOU are more of an expert than Martin Fowler? What
arrogance!

> It's not worth getting into the argument. He's just a troll with
> delusions of competency.

If everyone who disagrees with you is incompetent then the world is full of
idiots. Your opinion is not the only opinion, and there are plenty of
"experts" who have opposing views.

Michael Fesser

unread,
Nov 29, 2006, 6:29:09 AM11/29/06
to
.oO(Tony Marston)

>"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
>news:bpudnWTDrLPbNPHY...@comcast.com...
>>

>> The PHP interface defines a set of methods (function) which are required
>> by the classes which implement the interface. Java is similar in that
>> respect. But both are a subset of the total interface.
>
>It is possible to access the method directly without an interface, therefore
>an interfae is not necessary.

RTFM!

Object Interfaces
http://www.php.net/manual/en/language.oop5.interfaces.php

Micha

Jerry Stuckle

unread,
Nov 29, 2006, 8:27:17 AM11/29/06
to

No, I'm saying Booch, Rumbaugh and Jacobson, among others, are more
expert than Martin Fowler. And yes, I've heard of him.

But you're not quoting Martin Fowler. You're quoting Keith Ray's
INTERPRETATION if Martin Fowler.

>
>>It's not worth getting into the argument. He's just a troll with
>>delusions of competency.
>
>
> If everyone who disagrees with you is incompetent then the world is full of
> idiots. Your opinion is not the only opinion, and there are plenty of
> "experts" who have opposing views.
>

No, I disagree with a lot of competent people. It's YOU who are an
incompetent troll. And you continue to prove it.

Try these - with direct quotes from recognized experts, and examples:

http://www.research.umbc.edu/~tarr/dp/lectures/OOPrinciples-2pp.pdf
http://www.nnwj.de/encapsulation.html

Or better yet, read the real books by these authors.

But I know you won't, because you disagree with what they say, and don't
want to burst your little bubble.

Troll.

Jerry Stuckle

unread,
Nov 29, 2006, 8:33:33 AM11/29/06
to

"Possible" != "CORRECT"

First of all, this is not Martin Fowler's text. It is Keith Ray's
interpretation of what Martin fowler said.

And Booch, Rumbaugh and Jacobson are generally considered to be THE
experts on the OO world.

>
>
>>>>>>>>Methods are implemented as functions in PHP. They operate on the
>>>>>>>>object.
>>>>>>>
>>>>>>>
>>>>>>>That's one thing you got right.
>>>>>>>
>>>>>>
>>>>>>More than you got right. Go crawl back into your hole and don't come
>>>>>>out again until you know what you're talking about.
>>>>>
>>>>>
>>>>>I do know what I'm talking about..
>>>>>
>>>>
>>>>Then why do you continually disagree with the recognized experts in the
>>>>OO community, like the ones I mentioned above?
>>>
>>>
>>>I disagree with YOU simply because you clam to be a recognised expert
>>>when in fact you are no such thing. I keep finding papers on the internet
>>>which disagree with your explanations, yet you persist in claiming that
>>>you are right and everybody who dares to disagree with you is wrong. Such
>>>arrogance!
>>>
>>
>>No, you disagree with every recognized expert in the field. Read what the
>>authors I mentioned have to say about it. THEY are the recognized experts
>>in the field.
>
>
> There is no such thing as a single view upon which all "experts" agree.
> Wherever you look, either in books or on the internet, you will come across
> examples where different sets of "experts" have different opinions and
> views. Therefore it does not matter which set of "experts" you choose to
> follow as a different set of "experts" will always say that you are wrong.
>

Yes, you can always find so-called "experts" who disagree. But the ones
I've named are generally considered to be the experts in the field by
most experienced OO designers and other knowledgeable people.

>
>>I can create a paper on the internet saying the sun rises in the west.
>>It's quite simple to do. But that doesn't make it a fact.
>
>
> In your opinion it does if an "expert" says so. You have to know when an
> "expert" is spouting wisdom and when he is spouting bulls*t.
>

So you're saying Booch, et. al. are spouting "bullshit" because they
disagree with little Tony? ROFLMAO!

>
>>Now go home and do some reading. You might actually learn something.
>
>
> The only thing I can learn from you is how NOT to do things.
>

To home and do some reading, troll. And have fun with your incompetence.

Tony Marston

unread,
Nov 30, 2006, 5:52:03 AM11/30/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:2aadnScWrfowF_DY...@comcast.com...

If you bothered to follow the link to Martn Fowler's page at
http://martinfowler.com/bliki/GetterEradicator.html you would see in
paragraph 4 tha it is a direct quotation, not an interpretation.

>>
>>>It's not worth getting into the argument. He's just a troll with
>>>delusions of competency.
>>
>>
>> If everyone who disagrees with you is incompetent then the world is full
>> of idiots. Your opinion is not the only opinion, and there are plenty of
>> "experts" who have opposing views.
>>
>
> No, I disagree with a lot of competent people. It's YOU who are an
> incompetent troll. And you continue to prove it.
>
> Try these - with direct quotes from recognized experts, and examples:
>
> http://www.research.umbc.edu/~tarr/dp/lectures/OOPrinciples-2pp.pdf
> http://www.nnwj.de/encapsulation.html
>
> Or better yet, read the real books by these authors.
>
> But I know you won't, because you disagree with what they say, and don't
> want to burst your little bubble.
>
> Troll.

Whether you like it or not there is no such thing as a single opinion as to
what OOP is and is not, and there are multiple interpretations as to the
real meaning of encapsulation, inheritance, polymorphism, implementation
hiding and information hiding. Just because you quote sources who agree with
you does not mean you are right and everybody else is wrong. Here are
sources with the opinion that "Encapsulation is NOT information hiding":

http://homepage.mac.com/keithray/blog/2006/02/22/
http://martinfowler.com/bliki/GetterEradicator.html
http://www.javaworld.com/javaworld/jw-05-2001/jw-0518-encapsulation.html?page=1
http://www.itmweb.com/essay550.htm
http://nat.truemesh.com/archives/000498.html

The world is full of different opinions, so who is to say which ones are
right and which ones are wrong?

Tony Marston

unread,
Nov 30, 2006, 5:55:43 AM11/30/06
to

"Michael Fesser" <net...@gmx.de> wrote in message
news:dlrqm2phbf1khsc30...@4ax.com...

That just tells me what interfaces ARE, but it certainly does not say that
interfaces are REQUIRED. It is possible to define a class method and access
it directly WITHOUT going through an interface, therefore an interface IS
NOT NECESSARY.

Tony Marston

unread,
Nov 30, 2006, 6:02:20 AM11/30/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:n9GdnZYmX_-4EfDY...@comcast.com...

That's just your opinion. Where does it say that I *MUST* define and use an
interface before I can access a class method? Interfaces are optional
(especuially in PHP) so it is not wrong to excercise the option NOT to use
them. I can define a class method and access that method without using an
interface, and that is what I choose to do.

Jerry Stuckle

unread,
Nov 30, 2006, 8:08:25 AM11/30/06
to

Yes, and did you actually read that page? To quote from Martin Fowler:

"For me, the point of encapsulation isn't really about hiding the data,
but in hiding design decisions, particularly in areas where those
decisions may have to change. The internal data representation is one
example of this..."

This is in perfect agreement with Booch, Rumbaugh, Iverson and others.
And a direct CONTRADICTION to troll Tony Marston.

Yea, and some, like yours, troll, are just wrong.

Read the experts I've mentioned several times. You might actually learn
something.

But I know you won't. Like all trolls you know everything and anyone
who disagrees with you is wrong - no matter how much of a recognized
expert he is.

Go and crawl back into your hole, troll. And take your delusions of
competence with you.

Jerry Stuckle

unread,
Nov 30, 2006, 8:12:43 AM11/30/06
to

When are you going to get it through that pea-sized mind of yours that a
PHP interface is not the same as an interface as defined in OO terms?

In OO terms, a public method is part of the interface. The PHP keyword
interface just defines a set of functions which must be implemented by
the class.

They are two entirely different things.

Michael Fesser

unread,
Nov 30, 2006, 6:03:34 PM11/30/06
to
.oO(Tony Marston)

>That just tells me what interfaces ARE, but it certainly does not say that
>interfaces are REQUIRED. It is possible to define a class method and access
>it directly WITHOUT going through an interface, therefore an interface IS
>NOT NECESSARY.

Forget it. Obviously you haven't understood what interfaces in PHP are
used for and what you can do/ensure with them. Just an example: Without
these interfaces it wouldn't be possible to use 'foreach' to iterate
over any arbitrary object:

foreach ($directory as $file) {...}
foreach ($resultSet as $record) {...}

Micha

Tony Marston

unread,
Dec 1, 2006, 4:26:19 AM12/1/06
to

"Michael Fesser" <net...@gmx.de> wrote in message
news:m8oum29ju6gvvvt9h...@4ax.com...

> .oO(Tony Marston)
>
>>That just tells me what interfaces ARE, but it certainly does not say that
>>interfaces are REQUIRED. It is possible to define a class method and
>>access
>>it directly WITHOUT going through an interface, therefore an interface IS
>>NOT NECESSARY.
>
> Forget it. Obviously you haven't understood what interfaces in PHP are
> used for and what you can do/ensure with them.

My point is that in PHP interfaces are OPTIONAL, not MANDATORY. It is a
simpe point which you cannot disprove, so why are you continuing to argue
about it?

> Just an example: Without
> these interfaces it wouldn't be possible to use 'foreach' to iterate
> over any arbitrary object:
>
> foreach ($directory as $file) {...}
> foreach ($resultSet as $record) {...}
>
> Micha

With PHP 5 it is possible to use 'foreach' on an object without the use of
interfaces, so your argument is not valid.

Tony Marston

unread,
Dec 1, 2006, 4:30:03 AM12/1/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:DuWdndxBr5xeRfPY...@comcast.com...
< snip>

>>>>>The PHP interface defines a set of methods (function) which are
>>>>>required by the classes which implement the interface. Java is similar
>>>>>in that respect. But both are a subset of the total interface.
>>>>
>>>>
>>>>It is possible to access the method directly without an interface,
>>>>therefore an interfae is not necessary.
>>>>
>>>
>>>"Possible" != "CORRECT"
>>
>>
>> That's just your opinion. Where does it say that I *MUST* define and use
>> an interface before I can access a class method? Interfaces are optional
>> (especuially in PHP) so it is not wrong to excercise the option NOT to
>> use them. I can define a class method and access that method without
>> using an interface, and that is what I choose to do.
>>
>
> When are you going to get it through that pea-sized mind of yours that a
> PHP interface is not the same as an interface as defined in OO terms?
>
> In OO terms, a public method is part of the interface. The PHP keyword
> interface just defines a set of functions which must be implemented by the
> class.
>
> They are two entirely different things.

The fact that a method and an interface are different things is irrelevant.
I am just pointing out that in PHP an interface is not necessary as I can
access the method directly without going through an interface. Is this
statement true or false?

Tony Marston

unread,
Dec 1, 2006, 4:56:34 AM12/1/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:rNidnZrE3O5fSvPY...@comcast.com...
> Tony Marston wrote:
< snip>

>>>>>Tony and I have been into this before. He breaks into conversations
>>>>>trying to spout his version of OO, with a few blogs from people no one
>>>>>every heard of to back him up.
>>>>
>>>>
>>>>I see. So in your opinion Martin Fowler is of of these "people no one
>>>>ever heard of "? He says, like I do, that "Encapsulation Wasn't Meant To
>>>>Mean Data Hiding" at http://homepage.mac.com/keithray/blog/2006/02/22/
>>>>
>>>>Are you saying that YOU are more of an expert than Martin Fowler? What
>>>>arrogance!
>>>>
>>>
>>>No, I'm saying Booch, Rumbaugh and Jacobson, among others, are more
>>>expert than Martin Fowler. And yes, I've heard of him.
>>>
>>>But you're not quoting Martin Fowler. You're quoting Keith Ray's
>>>INTERPRETATION if Martin Fowler.
>>
>>
>> If you bothered to follow the link to Martn Fowler's page at
>> http://martinfowler.com/bliki/GetterEradicator.html you would see in
>> paragraph 4 tha it is a direct quotation, not an interpretation.
>>
>
> Yes, and did you actually read that page? To quote from Martin Fowler:
>
> "For me, the point of encapsulation isn't really about hiding the data,
> but in hiding design decisions, particularly in areas where those
> decisions may have to change. The internal data representation is one
> example of this..."

The full quote is "The internal data representation is one example of this,
** but not the only one and not always the best one.**" The significant
point is the sentence which reads "point of encapsulation isn't really about
hiding the data, but in hiding design decisions". If you follow the link he
provides to
http://www.craiglarman.com/articles/The%20Importance%20of%20Being%20Closed%20-%20Larman%20-%20IEEE%20Software.pdf
by Craig Larman there is an interesting chapter with the title "Information
hiding is PV, not data encapsulation". The hiding of design decisions was
supposed to mean hiding the code which manipulates the data, not the data
itself.

As I have said several times, and quoted from other resources, encapsulation
is NOT about INFORMATION hiding but about IMPLEMENTATION hiding. There is a
subtle difference which you fail to grasp.

In your opinion they are wrong, but I do not value your opinion.

> Read the experts I've mentioned several times. You might actually learn
> something.
>
> But I know you won't. Like all trolls you know everything and anyone who
> disagrees with you is wrong - no matter how much of a recognized expert he
> is.

All the "experts" in the world do not agree. "My" experts disagree with
"your" experts. Just because I, and many others, disagree with your opinion
does not make me/us wrong.

> Go and crawl back into your hole, troll. And take your delusions of
> competence with you.

Typical reaction of a moron. When you start losing the argument out come the
insults.

Jerry Stuckle

unread,
Dec 1, 2006, 7:52:47 AM12/1/06
to

No, the point YOU fail to grasp, which ALL the experts, including Martin
Fowler, is the actual variables used are PART OF THE IMPLEMENTATION.

I never said you should hide the information. But you should hide HOW
THE INFORMATION IS STORED. That is one of the DESIGN DECISIONS he is
talking about.

This is something on which EVERY expert agrees. But you fail to understand.

And the same thing with Craig Larman's article. He agrees that
encapsulation is good because it hides the design details. No one ever
claimed it hid information.

Wrong on both counts, Tony the Troll. Learn to read.

I really don't give a flying fuck if you or any other troll values my
opinion, Tony. Your idiocy is beyond comprehension.


>
>>Read the experts I've mentioned several times. You might actually learn
>>something.
>>
>>But I know you won't. Like all trolls you know everything and anyone who
>>disagrees with you is wrong - no matter how much of a recognized expert he
>>is.
>
>
> All the "experts" in the world do not agree. "My" experts disagree with
> "your" experts. Just because I, and many others, disagree with your opinion
> does not make me/us wrong.
>

Where did your "experts" get their training? The great Tony Martson
School of Bullshit?

These are experts recognized by the INDUSTRY - not me, not Tony Marston.
They are recognized by top programmers, university professors,
industry groups, publishers and more.

And quite frankly, troll Tony Marston's opinion on who an expert is
isn't important.

>
>>Go and crawl back into your hole, troll. And take your delusions of
>>competence with you.
>
>
> Typical reaction of a moron. When you start losing the argument out come the
> insults.
>

Yep, you've labeled yourself for sure. I am not "losing the argument".
Rather, you are just too thick-headed and stubborn to listen to the
real experts in the field.

You've done a little programming in one (or maybe even two) languages.
You think reading some of the crap on the Internet makes you an expert
in the matter.

Let me clue you in, Tony. You are far from an expert in anything. A
web site with some copied (and incorrect) information does not make you
an expert. Posting your bullshit in this and other newsgroups does not
make you an expert. And quoting people no one ever heard of does not
make you an expert.

Try working on an OO project with > 100 programmers. Learn how to do
proper OO. Then spend another 5-10 years or so working your way up in
the OOAD field, until you're managing projects like the one above. Then
your opinions might count. I've done all of that over the years.

Or even read the books I mentioned by those authors.

But I know you won't. Like all trolls, you're just plain stupid, and
are totally afraid the bullshit you've been espousing might be wrong.

Go away, troll.

Jerry Stuckle

unread,
Dec 1, 2006, 7:54:30 AM12/1/06
to

Micha,

Tony is just a troll who is beyond stupid. He can't even understand the
"experts" he quotes. They contradict what he says, but he can't see that.

Jerry Stuckle

unread,
Dec 1, 2006, 7:57:47 AM12/1/06
to

No, the fact that they are different are VERY RELEVANT. The fact you
can't understand the difference is also VERY RELEVANT. Or is it just
that you disregard facts which don't support with your stupidness?

Losing the argument so you need to disregard the facts? Typical troll
behavior.

Whether or not a PHP interface is required is immaterial - we are
talking about the OO concept of an interface, not PHP interfaces.

But that's way too deep for you to understand - the same word having
different meanings in different contexts? Hope your head didn't explode.

Buddy

unread,
Dec 1, 2006, 8:51:31 AM12/1/06
to
Python does what LISP does with better syntax. So I would say Python
bets both LISP and PHP and with mod_python (for Apache), maybe you
should learn it.

Michael Fesser

unread,
Dec 1, 2006, 9:39:32 AM12/1/06
to
.oO(Tony Marston)

>> Just an example: Without
>> these interfaces it wouldn't be possible to use 'foreach' to iterate
>> over any arbitrary object:
>>
>> foreach ($directory as $file) {...}
>> foreach ($resultSet as $record) {...}
>

>With PHP 5 it is possible to use 'foreach' on an object without the use of
>interfaces, so your argument is not valid.

It's a huge difference whether you just loop through all of the object's
properties like an array (that's what you described above) or if each
iteration automatically calls a particular method, which for example
fetches the next record from a database.

The latter is the basis of the SPL extension and not possible without
interfaces. Maybe IYHO the entire extension is not valid as well?

Micha

Michael Fesser

unread,
Dec 1, 2006, 9:39:32 AM12/1/06
to
.oO(Jerry Stuckle)

>Tony is just a troll who is beyond stupid.

I start to believe that. ;(

Micha

Tony Marston

unread,
Dec 2, 2006, 6:38:18 AM12/2/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:kv-dnVmk7pteu-3Y...@comcast.com...

This is a PHP newsgroup, so I am explaining how interfaces work within PHP.
It is a simple fact that interfaces ARE NOT NECESSARY in PHP. The fact that
interfaces are treated differently in other languages is totally irrelevant.
The fact that YOU think that interfaces in PHP should behave exactly the
same as in other languages is also irrelevant.

Tony Marston

unread,
Dec 2, 2006, 7:01:36 AM12/2/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:WfCdnZm7SJgKuO3Y...@comcast.com...

I suggest you learn to read. The article by Craig Larman clearly states "In
it, Parnas introduces information hiding. Many people have misinterpretted
this term as meaning data encapsulation, and some books erroneously define
the concepts as synonyms"
Do you see? "Encapsulation" is not supposed to mean "data encapsulation".


> This is something on which EVERY expert agrees. But you fail to
> understand.

Not EVERY export. Some agree, some don't..

> And the same thing with Craig Larman's article. He agrees that
> encapsulation is good because it hides the design details. No one ever
> claimed it hid information.
>
> Wrong on both counts, Tony the Troll. Learn to read.

"Encapsulation" is not supposed to mean "data encapsulation". It is supposed
to hide the implemetation (code), not the information (data).

>>
>>>This is in perfect agreement with Booch, Rumbaugh, Iverson and others.
>>>And a direct CONTRADICTION to troll Tony Marston.
>>>
>>>
>>>>>>>It's not worth getting into the argument. He's just a troll with
>>>>>>>delusions of competency.
>>>>>>
>>>>>>
>>>>>>If everyone who disagrees with you is incompetent then the world is
>>>>>>full of idiots. Your opinion is not the only opinion, and there are
>>>>>>plenty of "experts" who have opposing views.
>>>>>>
>>>>>
>>>>>No, I disagree with a lot of competent people. It's YOU who are an
>>>>>incompetent troll. And you continue to prove it.

I see. I agree with some of the people that you disagree with, yet that
makes me a troll.

Neither is yours.

>>>Go and crawl back into your hole, troll. And take your delusions of
>>>competence with you.
>>
>>
>> Typical reaction of a moron. When you start losing the argument out come
>> the insults.
>>
>
> Yep, you've labeled yourself for sure. I am not "losing the argument".
> Rather, you are just too thick-headed and stubborn to listen to the real
> experts in the field.

As I keep on saying, there is no such thing as one set of experts with whom
EVERYBODY agrees, just as there is no such thing as one programming style
with which EVEYBODY agrees.In every walk of life there are different
opinions, and all I am doing is expressing an opinion which isdifferent from
yours.

> You've done a little programming in one (or maybe even two) languages.

I have done a lot of programming in many languages.

> You think reading some of the crap on the Internet makes you an expert in
> the matter.

Just as the crap you read makes you an expert.

> Let me clue you in, Tony. You are far from an expert in anything. A web
> site with some copied (and incorrect)

It is only your opinion that it is incorect. Other people do not think so.

> information does not make you an expert. Posting your bullshit in this
> and other newsgroups does not make you an expert.

Posting your bullsh*t does not make you an expert either.

> And quoting people no one ever heard of does not make you an expert.

Just because you haven't heard of them does no mean that they do not exist,
nor hat their opinions are worthless.

> Try working on an OO project with > 100 programmers. Learn how to do
> proper OO.

I once worked on a project with a team of so-called OO "experts", and it was
the worst technical disaster of my entire career. They were so full of their
fancy ideas they coud not tell which way was up. They were so incompetent
they could not find their own backsides in the dark if you let them use both
hands and gave them a map and compass.

> Then spend another 5-10 years or so working your way up in the OOAD
> field, until you're managing projects like the one above. Then your
> opinions might count. I've done all of that over the years.
>
> Or even read the books I mentioned by those authors.
>
> But I know you won't. Like all trolls, you're just plain stupid, and are
> totally afraid the bullshit you've been espousing might be wrong.
>
> Go away, troll.

No, I won't. I will keep contradicting your opinions until hell freezes over
for the simple reason that I, and others, do not agree with your opinions.

Tony Marston

unread,
Dec 2, 2006, 7:02:48 AM12/2/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:WfCdnZi7SJhguO3Y...@comcast.com...

> Michael Fesser wrote:
>> .oO(Tony Marston)
>>
>>
>>>That just tells me what interfaces ARE, but it certainly does not say
>>>that interfaces are REQUIRED. It is possible to define a class method and
>>>access it directly WITHOUT going through an interface, therefore an
>>>interface IS NOT NECESSARY.
>>
>>
>> Forget it. Obviously you haven't understood what interfaces in PHP are
>> used for and what you can do/ensure with them. Just an example: Without
>> these interfaces it wouldn't be possible to use 'foreach' to iterate
>> over any arbitrary object:
>>
>> foreach ($directory as $file) {...}
>> foreach ($resultSet as $record) {...}
>>
>> Micha
>
> Micha,
>
> Tony is just a troll who is beyond stupid. He can't even understand the
> "experts" he quotes. They contradict what he says, but he can't see that.

They also contradict what you say, and you can't see that.

--

Tony Marston

unread,
Dec 2, 2006, 7:06:59 AM12/2/06
to
"Buddy" <buddyw...@gmail.com> wrote in message
news:1164981091.8...@73g2000cwn.googlegroups.com...

> Python does what LISP does with better syntax. So I would say Python
> bets both LISP and PHP and with mod_python (for Apache), maybe you
> should learn it.

What has this got to do with the topic being discussed?

Tony Marston

unread,
Dec 2, 2006, 7:05:40 AM12/2/06
to

"Michael Fesser" <net...@gmx.de> wrote in message
news:u4f0n2tpfkfscou9b...@4ax.com...

I have no opinion on the SPL extension as I have never used it. That
argument is irrelevant anyway. The point being debated here is whether
interfaces in PHP are necessary, and it is my opinion that they are NOT.

Jerry Stuckle

unread,
Dec 2, 2006, 9:44:16 AM12/2/06
to

Yes, I suggest you learn to read, Tony. Start with the real experts.

You're just a stupid troll who looks around for someone to support his
position. Read the authors I recommended.

And no, I don't need to read any more of your "experts". I've read
enough to see that you really don't understand what they're talking about.

>
>
>>This is something on which EVERY expert agrees. But you fail to
>>understand.
>
>
> Not EVERY export. Some agree, some don't..
>

OK, every RECOGNIZED expert. That does not include the "experts" trolls
like you recognize. Nor anyone who posts an essay or blog on the web.

>
>>And the same thing with Craig Larman's article. He agrees that
>>encapsulation is good because it hides the design details. No one ever
>>claimed it hid information.
>>
>>Wrong on both counts, Tony the Troll. Learn to read.
>
>
> "Encapsulation" is not supposed to mean "data encapsulation". It is supposed
> to hide the implemetation (code), not the information (data).
>

Encapsulation includes bot DATA AND CODE. How information is stored is
part of the implementation, also. But that's what you can't get through
your thick skull.

Maybe if you stood up and took a load off of your brain you could think
more clearly. I'd suggest you take a shit but I'm afraid you'd loose
what ever brains you might have.

>
>>>>This is in perfect agreement with Booch, Rumbaugh, Iverson and others.
>>>>And a direct CONTRADICTION to troll Tony Marston.
>>>>
>>>>
>>>>
>>>>>>>>It's not worth getting into the argument. He's just a troll with
>>>>>>>>delusions of competency.
>>>>>>>
>>>>>>>
>>>>>>>If everyone who disagrees with you is incompetent then the world is
>>>>>>>full of idiots. Your opinion is not the only opinion, and there are
>>>>>>>plenty of "experts" who have opposing views.
>>>>>>>
>>>>>>
>>>>>>No, I disagree with a lot of competent people. It's YOU who are an
>>>>>>incompetent troll. And you continue to prove it.
>
>
> I see. I agree with some of the people that you disagree with, yet that
> makes me a troll.
>

No, you're a troll because you come into a tread and start arguing your
case. You refuse to read industry-recognized experts, but quote blogs
by people who agree with you.

And even when you post a page of someone who agrees with me and I point
it out, you refute it and change the subject - finding another unknown
"expert" to support your claim.

Also, I challenge you to find even ONE college level OO course in the
U.S. which agrees with you. I bet you can't. So I guess all those
professors are wrong, also.

You are a troll because you have absolutely no idea of which you talk.
You have no real experience outside of your little bubble, yet claim you
are an expert. You would never last in a corporate programming
environment - or any other serious programming group.

IOW, you're a total idiot, and proving it every day.

No, but my opinion is supported by Jacobson, Booch and Rumbaugh, among
other industry-recognized experts. Yours is only supported by bloggers
who, like you, are trying in vain to get noticed in this world.

And you won't even read the industry experts. Your mantra is:

"I've made up my mind. Don't confuse me with the facts".


>
>>>>Go and crawl back into your hole, troll. And take your delusions of
>>>>competence with you.
>>>
>>>
>>>Typical reaction of a moron. When you start losing the argument out come
>>>the insults.
>>>
>>
>>Yep, you've labeled yourself for sure. I am not "losing the argument".
>>Rather, you are just too thick-headed and stubborn to listen to the real
>>experts in the field.
>
>
> As I keep on saying, there is no such thing as one set of experts with whom
> EVERYBODY agrees, just as there is no such thing as one programming style
> with which EVEYBODY agrees.In every walk of life there are different
> opinions, and all I am doing is expressing an opinion which isdifferent from
> yours.
>
>
>>You've done a little programming in one (or maybe even two) languages.
>
>
> I have done a lot of programming in many languages.
>

ROFLMAO! Basic? Javascript?

>
>>You think reading some of the crap on the Internet makes you an expert in
>>the matter.
>
>
> Just as the crap you read makes you an expert.
>

Yea, Booch, Jacobson and Rumbaugh are "crap". That shows just how much
of a stupid troll you are, Tony.

>
>>Let me clue you in, Tony. You are far from an expert in anything. A web
>>site with some copied (and incorrect)
>
>
> It is only your opinion that it is incorect. Other people do not think so.
>

It's the opinion of a lot of people on this newsgroup, Tony. You've
made a complete ass of yourself too many times.

>
>>information does not make you an expert. Posting your bullshit in this
>>and other newsgroups does not make you an expert.
>
>
> Posting your bullsh*t does not make you an expert either.
>

The difference is my "bullshit" is supported by industry-recognized
techniques. Yours is only supported by unknown people who are trying to
get their names out.

>
>> And quoting people no one ever heard of does not make you an expert.
>
>
> Just because you haven't heard of them does no mean that they do not exist,
> nor hat their opinions are worthless.
>

And it also doesn't mean they have any credibility. As a reference,
their opinions are worthless.

>
>>Try working on an OO project with > 100 programmers. Learn how to do
>>proper OO.
>
>
> I once worked on a project with a team of so-called OO "experts", and it was
> the worst technical disaster of my entire career. They were so full of their
> fancy ideas they coud not tell which way was up. They were so incompetent
> they could not find their own backsides in the dark if you let them use both
> hands and gave them a map and compass.
>

Right. And the great Tony Marston was the only competent programmer
there. Are you familiar with the term "megalomaniac"? Looks like we
need to add that to your description, also.

>
>> Then spend another 5-10 years or so working your way up in the OOAD
>>field, until you're managing projects like the one above. Then your
>>opinions might count. I've done all of that over the years.
>>
>>Or even read the books I mentioned by those authors.
>>
>>But I know you won't. Like all trolls, you're just plain stupid, and are
>>totally afraid the bullshit you've been espousing might be wrong.
>>
>>Go away, troll.
>
>
> No, I won't. I will keep contradicting your opinions until hell freezes over
> for the simple reason that I, and others, do not agree with your opinions.
>

And you'll keep making a complete ass of yourself, Tony. Almost
everyone here is laughing at you and your pitiful attempts to show how
little you know.

Jerry Stuckle

unread,
Dec 2, 2006, 9:46:29 AM12/2/06
to

The subject of interfaces came up in the OO context, not a PHP interface.

However, you're too stupid to understand there's a difference between
the two. So you keep trying to change the subject then justifying your
change - just like any troll.

Curtis

unread,
Dec 3, 2006, 2:00:47 AM12/3/06
to
> That's just your opinion. Where does it say that I *MUST* define and use an
> interface before I can access a class method? Interfaces are optional
> (especuially in PHP) so it is not wrong to excercise the option NOT to use
> them. I can define a class method and access that method without using an
> interface, and that is what I choose to do.

No one is saying that you have to use interfaces. The point is that it
is there to help in organizing and creating classes, the same goes for
visibility keywords. Just because you don't have to use these, doesn't
mean that you should not use them.

I can see an advantage in using interfaces and/or visibility keywords
in PHP, if one is creating a large library, or to help communications
between a team of developers. These features can help track down where
a problem is if something isn't working right, or just for clarifying
the particular usage for the class or its members.

BTW, I do not believe there is any controversy over what encapsulation
is; if so, I haven't heard about it.

Tony Marston

unread,
Dec 3, 2006, 4:47:53 AM12/3/06
to

"Curtis" <dye...@gmail.com> wrote in message
news:1165129247.1...@80g2000cwy.googlegroups.com...

>> That's just your opinion. Where does it say that I *MUST* define and use
>> an
>> interface before I can access a class method? Interfaces are optional
>> (especuially in PHP) so it is not wrong to excercise the option NOT to
>> use
>> them. I can define a class method and access that method without using an
>> interface, and that is what I choose to do.
>
> No one is saying that you have to use interfaces.

Exactly. All I am saying is that interfaces are not necessary, just as the
use on private/protected is not necessary. Others keep arguning the
opposite.

> The point is that it
> is there to help in organizing and creating classes, the same goes for
> visibility keywords. Just because you don't have to use these, doesn't
> mean that you should not use them.
>
> I can see an advantage in using interfaces and/or visibility keywords
> in PHP, if one is creating a large library, or to help communications
> between a team of developers. These features can help track down where
> a problem is if something isn't working right, or just for clarifying
> the particular usage for the class or its members.
>
> BTW, I do not believe there is any controversy over what encapsulation
> is; if so, I haven't heard about it.

To some people encapsulation means "implementation hiding" while to others
it means "information hiding". This is discussed in the following documents:
http://www.itmweb.com/essay550.htm
http://homepage.mac.com/keithray/blog/2006/02/22/
http://www.javaworld.com/javaworld/jw-05-2001/jw-0518-encapsulation.html

There is no single view as to what OOP actually IS or IS NOT. People cannot
agree on what the basic terminology means, which leads to greater arguments
on how it should be implemented.

There are some people in this newsgroup who do not like views which differ
from their own. They consider their way to be the RIGHT way, the ONLY way,
just like religious fanatics. All I am trying to do is point out that there
is no single truth, no single point of view.

Tony Marston

unread,
Dec 3, 2006, 5:07:18 AM12/3/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:4qOdnXfE6PHdDOzY...@comcast.com...
> Tony Marston wrote:
<snip>

>> I suggest you learn to read. The article by Craig Larman clearly states
>> "In it, Parnas introduces information hiding. Many people have
>> misinterpretted this term as meaning data encapsulation, and some books
>> erroneously define the concepts as synonyms"
>> Do you see? "Encapsulation" is not supposed to mean "data encapsulation".
>>
>
> Yes, I suggest you learn to read, Tony. Start with the real experts.
>
> You're just a stupid troll who looks around for someone to support his
> position. Read the authors I recommended.
>
> And no, I don't need to read any more of your "experts". I've read enough
> to see that you really don't understand what they're talking about.
>
>>
>>
>>>This is something on which EVERY expert agrees. But you fail to
>>>understand.
>>
>>
>> Not EVERY export. Some agree, some don't..
>>
>
> OK, every RECOGNIZED expert. That does not include the "experts" trolls
> like you recognize. Nor anyone who posts an essay or blog on the web.

Oh I see. Someone is not an expert unless you personally give them your seal
of approval. That is NOT how it works.

>>>And the same thing with Craig Larman's article. He agrees that
>>>encapsulation is good because it hides the design details. No one ever
>>>claimed it hid information.
>>>
>>>Wrong on both counts, Tony the Troll. Learn to read.

I suggest YOU learn to read. Encapsulation is NOT the same as data hiding.

>> "Encapsulation" is not supposed to mean "data encapsulation". It is
>> supposed to hide the implemetation (code), not the information (data).
>>
>
> Encapsulation includes bot DATA AND CODE. How information is stored is
> part of the implementation, also. But that's what you can't get through
> your thick skull.

Encapsulation means "implementation hiding" not "information hiding". I do
not need private/protected variables to implement encapsulation.

> Maybe if you stood up and took a load off of your brain you could think
> more clearly. I'd suggest you take a shit but I'm afraid you'd loose what
> ever brains you might have.
>
>>
>>>>>This is in perfect agreement with Booch, Rumbaugh, Iverson and others.
>>>>>And a direct CONTRADICTION to troll Tony Marston.

And other experts, such as Martin Fowler.

>>>>>>>>>It's not worth getting into the argument. He's just a troll with
>>>>>>>>>delusions of competency.
>>>>>>>>
>>>>>>>>
>>>>>>>>If everyone who disagrees with you is incompetent then the world is
>>>>>>>>full of idiots. Your opinion is not the only opinion, and there are
>>>>>>>>plenty of "experts" who have opposing views.
>>>>>>>>
>>>>>>>
>>>>>>>No, I disagree with a lot of competent people. It's YOU who are an
>>>>>>>incompetent troll. And you continue to prove it.
>>
>>
>> I see. I agree with some of the people that you disagree with, yet that
>> makes me a troll.
>>
>
> No, you're a troll because you come into a tread and start arguing your
> case.

That is what newsgroups are for, to expose different points of view.

> You refuse to read industry-recognized experts, but quote blogs by people
> who agree with you.

I read from a different set of experts, as do many others.

> And even when you post a page of someone who agrees with me and I point it
> out, you refute it and change the subject - finding another unknown
> "expert" to support your claim.

So you agree that there are others out there, expert or not, who share MY
opinion and which contradicts YOUR opinion.

> Also, I challenge you to find even ONE college level OO course in the U.S.
> which agrees with you. I bet you can't. So I guess all those professors
> are wrong, also.

If they are teaching that there is only one way to interpret what OO means,
and only one way to implement that interpretation, then they ARE wrong. Just
like those religious fanatics who preach that theirs is the ONE and ONLY
"true" faith.

> You are a troll because you have absolutely no idea of which you talk.

I have an open mind. I am prepared to listen to all arguments before I
decide which path to follow. And I choose NOT to follow your particular
path.

> You have no real experience outside of your little bubble, yet claim you
> are an expert.

I have never claimed to be an expert, unlike YOU. All I have done is pointed
out that other experts have opinions which differ from yours.

< snip>

> And you won't even read the industry experts. Your mantra is:
> "I've made up my mind. Don't confuse me with the facts".

That's funny. I thought that was YOUR mantra.

<snip>

> The difference is my "bullshit" is supported by industry-recognized
> techniques. Yours is only supported by unknown people who are trying to
> get their names out.

So Martin Fowler is not a recognised expert?

< snip>

>>>Try working on an OO project with > 100 programmers. Learn how to do
>>>proper OO.

That's the problem. Different people have a totally different idea as to
what "proper OO" actually is. You are the arrogant one who keeps insisting
that YOUR opinion is the ONLY opinion worth having.

Tony Marston

unread,
Dec 3, 2006, 5:11:13 AM12/3/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:4qOdnXbE6PFYDOzY...@comcast.com...
> Tony Marston wrote:

<snip>

>> This is a PHP newsgroup, so I am explaining how interfaces work within
>> PHP. It is a simple fact that interfaces ARE NOT NECESSARY in PHP. The
>> fact that interfaces are treated differently in other languages is
>> totally irrelevant. The fact that YOU think that interfaces in PHP should
>> behave exactly the same as in other languages is also irrelevant.
>>
>
> The subject of interfaces came up in the OO context, not a PHP interface.
>
> However, you're too stupid to understand there's a difference between the
> two. So you keep trying to change the subject then justifying your
> change - just like any troll.

This is a PHP newsgroup. All my arguments concern PHP. I do not care that
other languages have different implementations because that is totally
irrelevant. The simple fact is that in PHP it is not necessary to use
interfaces.

Jerry Stuckle

unread,
Dec 3, 2006, 9:53:16 AM12/3/06
to
Tony Marston wrote:
> "Jerry Stuckle" <jstu...@attglobal.net> wrote in message
> news:4qOdnXfE6PHdDOzY...@comcast.com...
>
>>Tony Marston wrote:
>
> <snip>
>
>>>I suggest you learn to read. The article by Craig Larman clearly states
>>>"In it, Parnas introduces information hiding. Many people have
>>>misinterpretted this term as meaning data encapsulation, and some books
>>>erroneously define the concepts as synonyms"
>>>Do you see? "Encapsulation" is not supposed to mean "data encapsulation".
>>>
>>
>>Yes, I suggest you learn to read, Tony. Start with the real experts.
>>
>>You're just a stupid troll who looks around for someone to support his
>>position. Read the authors I recommended.
>>
>>And no, I don't need to read any more of your "experts". I've read enough
>>to see that you really don't understand what they're talking about.
>>
>>
>>>
>>>>This is something on which EVERY expert agrees. But you fail to
>>>>understand.
>>>
>>>
>>>Not EVERY export. Some agree, some don't..
>>>
>>
>>OK, every RECOGNIZED expert. That does not include the "experts" trolls
>>like you recognize. Nor anyone who posts an essay or blog on the web.
>
>
> Oh I see. Someone is not an expert unless you personally give them your seal
> of approval. That is NOT how it works.
>

That's hilarious. You think you're an expert because you one time
worked on one failed OO project. Try working on a few dozen successful
ones. Then maybe you'll learn someone.

And these are experts recognized by the INDUSTRY. People who have been
doing OOAD for years. University Professors. Industry giants. And so on.

But you think anyone who doesn't agree with you doesn't know anything.
You are beyond stupid, Tony. And people laugh at you.

>
>>>>And the same thing with Craig Larman's article. He agrees that
>>>>encapsulation is good because it hides the design details. No one ever
>>>>claimed it hid information.
>>>>
>>>>Wrong on both counts, Tony the Troll. Learn to read.
>
>
> I suggest YOU learn to read. Encapsulation is NOT the same as data hiding.
>

And I suggest you learn to read. I never said encapsulation had
anything do to with data hiding. But you're too stoopid to understand
that, either.

>
>>>"Encapsulation" is not supposed to mean "data encapsulation". It is
>>>supposed to hide the implemetation (code), not the information (data).
>>>
>>
>>Encapsulation includes bot DATA AND CODE. How information is stored is
>>part of the implementation, also. But that's what you can't get through
>>your thick skull.
>
>
> Encapsulation means "implementation hiding" not "information hiding". I do
> not need private/protected variables to implement encapsulation.
>

Exactly. And how data is stored is part of the implementation. But
again, you're too stoopid to understand that part.

>
>>Maybe if you stood up and took a load off of your brain you could think
>>more clearly. I'd suggest you take a shit but I'm afraid you'd loose what
>>ever brains you might have.
>>
>>
>>>>>>This is in perfect agreement with Booch, Rumbaugh, Iverson and others.
>>>>>>And a direct CONTRADICTION to troll Tony Marston.
>
>
> And other experts, such as Martin Fowler.
>

And no, your beloved Martin Fowler is not a widely recognized expert.
Not like Booch, Rumbaugh and Iverson, for three. But even so, Martin
Fowler agrees with the other three experts. But you're too stoopid to
understand that, either.

>
>>>>>>>>>>It's not worth getting into the argument. He's just a troll with
>>>>>>>>>>delusions of competency.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>If everyone who disagrees with you is incompetent then the world is
>>>>>>>>>full of idiots. Your opinion is not the only opinion, and there are
>>>>>>>>>plenty of "experts" who have opposing views.
>>>>>>>>>
>>>>>>>>
>>>>>>>>No, I disagree with a lot of competent people. It's YOU who are an
>>>>>>>>incompetent troll. And you continue to prove it.
>>>
>>>
>>>I see. I agree with some of the people that you disagree with, yet that
>>>makes me a troll.
>>>
>>
>>No, you're a troll because you come into a tread and start arguing your
>>case.
>
>
> That is what newsgroups are for, to expose different points of view.
>

Yea, but the problem is you can't keep people like Tony Marston with
shit for brains out, either. But that's ok, there are a lot of people
getting a big laugh at you.

Imaging - calling yourself an "expert" when you've only worked on one
project - which failed. ROFLMAO!

>
>> You refuse to read industry-recognized experts, but quote blogs by people
>>who agree with you.
>
>
> I read from a different set of experts, as do many others.
>

And your "experts" are not recognized by the industry. They're just
like you - poor wanna-be's with a web site and delusions of competence.
People who are so desperate for attention they'll post any bullshit
they can find, just to get attention.

>
>>And even when you post a page of someone who agrees with me and I point it
>>out, you refute it and change the subject - finding another unknown
>>"expert" to support your claim.
>
>
> So you agree that there are others out there, expert or not, who share MY
> opinion and which contradicts YOUR opinion.
>

Sure, there are people who don't understand OO, encapsulation and the
rest. In fact, I'll bet bet Hillary Clinton would agree with you. And
she's even famous!

>
>>Also, I challenge you to find even ONE college level OO course in the U.S.
>>which agrees with you. I bet you can't. So I guess all those professors
>>are wrong, also.
>
>
> If they are teaching that there is only one way to interpret what OO means,
> and only one way to implement that interpretation, then they ARE wrong. Just
> like those religious fanatics who preach that theirs is the ONE and ONLY
> "true" faith.
>

So now you're saying even all the colleges and universities in this
country are wrong, also, because they don't agree with Tony Marston?

ROFLMAO!

>
>>You are a troll because you have absolutely no idea of which you talk.
>
>
> I have an open mind. I am prepared to listen to all arguments before I
> decide which path to follow. And I choose NOT to follow your particular
> path.
>

That is the best line you've come up with yet, Tony!

No, you don't have an open mind. Your mind is fixated on how YOU think
things should be, and the rest of the world should conform to YOUR
ideas. And anyone who disagrees with you is wrong - including all
colleges, universities, industry-recognized experts...

That is not an open mind, Tony. That's a sign of megalomania. And
you're a troll, on top of it.

>
>>You have no real experience outside of your little bubble, yet claim you
>>are an expert.
>
>
> I have never claimed to be an expert, unlike YOU. All I have done is pointed
> out that other experts have opinions which differ from yours.
>

You have posted no "experts" who's opinions differ from mine. All
you've posted are blogs and other website entries by people no one else
knows.

> < snip>
>
>>And you won't even read the industry experts. Your mantra is:
>>"I've made up my mind. Don't confuse me with the facts".
>
>
> That's funny. I thought that was YOUR mantra.
>

Nope, the facts I have are from recognized experts. You have no real
experience in OO, you have not read industry experts, you haven't even
taken a college course on OOAD. And yet you think everyone else is wrong.

> <snip>
>
>>The difference is my "bullshit" is supported by industry-recognized
>>techniques. Yours is only supported by unknown people who are trying to
>>get their names out.
>
>
> So Martin Fowler is not a recognised expert?
>

Not as widely recognized as Booch, Rumbaugh and Iverson, amongst others.
And even so, if you really read what he says, he does agree with the
three above.

> < snip>
>
>>>>Try working on an OO project with > 100 programmers. Learn how to do
>>>>proper OO.
>
>
> That's the problem. Different people have a totally different idea as to
> what "proper OO" actually is. You are the arrogant one who keeps insisting
> that YOUR opinion is the ONLY opinion worth having.
>

Yes, you are arrogant, Tony. And I can see why they fired your ass from
the project.

Jerry Stuckle

unread,
Dec 3, 2006, 9:54:34 AM12/3/06
to

This discussion has to do with interfaces in the OO context. They are
not the same as PHP interfaces.

But you're too stoopid to understand the difference, so like a troll you
try to change the subject.

Go away, troll.

Jerry Stuckle

unread,
Dec 3, 2006, 10:10:49 AM12/3/06
to

Hi, Curtis,

Actually, there is. Tony is claiming that variables should not be
private because they are not part of the implementation.

All of the industry-recognized experts, college level OOAD courses, etc.
disagree with him. So do the people who designed Java.

And even the PHP designers disagree with him - otherwise why would they
have bothered adding private and protected to variables, for instance?

Data should be private because it hides how the data is being stored. A
SQL database is a perfect example. You can't access the data directly,
but you can do it through SQL. And even if the internal representation
of the data changes (i.e. switch from MyISAM to InnoDB engines in MySQL,
or upgrade MySQL), you can still access the data with no changes to the
program. The data is encapsulated, but it is not hidden (it's all
available).

From one of the examples Tony quoted for an example of "proper" OO
coding. The user is storing:

public $longitude = 12.3456;
public $latitude = 23.4567;

The problem with having public variables is you may need to change them
later. There are other ways of storing this data, i.e.

public $longdeg = 12;
public $longmin = 34;
public $longsec = 56;

Or
public $longitude = array('deg'=>12, 'min'=>34, 'sec'=>56);

Or
public $longitude = 45678; // number of seconds
Or
public $longitude = "12.34.56"

and so on.

If these variables are public, you can never change them. But what
happens if you need to - i.e. for performance? Or accuracy?

For instance, if your database stores the long/lat in "12.34.56" format,
and all you need to do is display it, converting to and from
degrees/decimal is unnecessary and inefficient.

Or what if your database is stored as number of seconds, and you just
need to pull out the degrees, minutes and seconds? Again, unnecessary
overhead.

Rather, if you encapsulate the longitude and latitude, making them
private, with accessor functions, the data is not hidden - but the
implementation is.

This is where the disagreement lies. And it's why Tony is wrong.

Michael Fesser

unread,
Dec 3, 2006, 6:55:19 PM12/3/06
to
.oO(Tony Marston)

>I have no opinion on the SPL extension as I have never used it.

No surprise.

>That
>argument is irrelevant anyway. The point being debated here is whether
>interfaces in PHP are necessary, and it is my opinion that they are NOT.

So just because you don't use them they are not necessary?
That perfectly sums it all up and explains a lot.

A last short statement: There are some really convenient new features in
the OOP handling in PHP 5, which _require_ interfaces. No interfaces, no
such features. If you haven't used them yet, fine. But that doesn't mean
that they are not necessary. For many other people who make use of all
the benefits PHP 5 has to offer they _are_ necessary.

I'm out.

EOT
Micha

Michael Fesser

unread,
Dec 3, 2006, 6:58:01 PM12/3/06
to
.oO(Tony Marston)

>This is a PHP newsgroup, so I am explaining how interfaces work within PHP.

OK, please do that, no empty promises. Please explain, what interfaces
in PHP are and what you can do with them. Or can't do. I'm listening!

Micha

Curtis

unread,
Dec 4, 2006, 4:03:38 AM12/4/06
to
> Hi, Curtis,

Hello :)

<snip>


> If these variables are public, you can never change them. But what
> happens if you need to - i.e. for performance? Or accuracy?

<snip>


> Rather, if you encapsulate the longitude and latitude, making them
> private, with accessor functions, the data is not hidden - but the
> implementation is.

I see, I see. All of a sudden, it's like a light bulb turned on in my
head. I have have experience using OOP in PHP, Perl, JavaScript, and
very little in Python and C++, but I am nowhere near an expert,
although I have learned a lot from just trying out code and reading
documentation. There is a lot to OOP I have yet to learn, so I'll try
getting the materials by the experts mentioned. ;)

Just to make sure I interpreted your post correctly:

The benefit of encapsulation is doing things like making certain class
members private, and then utilizing setters/getters so that you can be
much more flexible in changing your class in the future.

Tony Marston

unread,
Dec 4, 2006, 6:05:49 AM12/4/06
to

"Curtis" <dye...@gmail.com> wrote in message
news:1165223018....@79g2000cws.googlegroups.com...

No, encapsulation is not about making everything private, it is about
putting data and the operations which act upon that data into a single
class. The ability to make certain operations or pieces of data private or
protected is OPTIONAL, not MANDATORY.

I am not saying that you MUST NOT make things private/protected, I am simply
arguing against the statement that you MUST use the private/protected
option. The point is that his is entirely OPTIONAL and is a matter of
personal preference.

As for saying that you MUST make all data private and access it through
getters and setters, you obviously haven't read
http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html

Tony Marston

unread,
Dec 4, 2006, 6:08:29 AM12/4/06
to

"Michael Fesser" <net...@gmx.de> wrote in message
news:kio6n2p298torpsfa...@4ax.com...

So what you are saying is that interfaces are only necessary if you want to
make use of certain features. This supports my argument that interfaces are
OPTIONAL if you don't want to use those specialised features.

Tony Marston

unread,
Dec 4, 2006, 6:11:20 AM12/4/06
to

"Michael Fesser" <net...@gmx.de> wrote in message
news:41p6n25hg3kvfq2ag...@4ax.com...

It is a simple argument. In PHP interfaces are optional. I *do not* have to
define an interface before I can access a method in an object. The fact that
interfaces may have their uses in specialised circumstances does not get
away from the fact that under normal use they are optional.

Tony Marston

unread,
Dec 4, 2006, 6:19:36 AM12/4/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:v8adnapGJq--eO_Y...@comcast.com...

> Tony Marston wrote:
>> "Jerry Stuckle" <jstu...@attglobal.net> wrote in message
>> news:4qOdnXbE6PFYDOzY...@comcast.com...
>>
>>>Tony Marston wrote:
>>
>>
>> <snip>
>>
>>>>This is a PHP newsgroup, so I am explaining how interfaces work within
>>>>PHP. It is a simple fact that interfaces ARE NOT NECESSARY in PHP. The
>>>>fact that interfaces are treated differently in other languages is
>>>>totally irrelevant. The fact that YOU think that interfaces in PHP
>>>>should behave exactly the same as in other languages is also irrelevant.
>>>>
>>>
>>>The subject of interfaces came up in the OO context, not a PHP interface.
>>>
>>>However, you're too stupid to understand there's a difference between the
>>>two. So you keep trying to change the subject then justifying your
>>>change - just like any troll.
>>
>>
>> This is a PHP newsgroup. All my arguments concern PHP. I do not care that
>> other languages have different implementations because that is totally
>> irrelevant. The simple fact is that in PHP it is not necessary to use
>> interfaces.
>>
>
> This discussion has to do with interfaces in the OO context. They are not
> the same as PHP interfaces.
>
> But you're too stoopid to understand the difference, so like a troll you
> try to change the subject.
>
> Go away, troll.

I am not changing the subject, you are. This is a PHP newsgroup, and my
argument is simply that interfaces are not necessary in PHP. You cannot
disprove this argument, so you attempt to change it to a different argument.

Tony Marston

unread,
Dec 4, 2006, 6:17:32 AM12/4/06
to
Why is it so difficult for you to accept that YOUR opinion is not the ONLY
opinion that is allowed to exist? Just because you can quote some people who
agree with you does not make you right. I have quoted from other sources who
agree with me, yet you dismiss all these different opinions as being
"irrelevant".

Your use of personal insults also shows what a juvenile mind you have.

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:v8adnatGJq9Jee_Y...@comcast.com...

Tony Marston

unread,
Dec 4, 2006, 6:30:12 AM12/4/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:dfadnZG_0a5vde_Y...@comcast.com...

> Curtis wrote:
>>>That's just your opinion. Where does it say that I *MUST* define and use
>>>an
>>>interface before I can access a class method? Interfaces are optional
>>>(especuially in PHP) so it is not wrong to excercise the option NOT to
>>>use
>>>them. I can define a class method and access that method without using an
>>>interface, and that is what I choose to do.
>>
>>
>> No one is saying that you have to use interfaces. The point is that it
>> is there to help in organizing and creating classes, the same goes for
>> visibility keywords. Just because you don't have to use these, doesn't
>> mean that you should not use them.
>>
>> I can see an advantage in using interfaces and/or visibility keywords
>> in PHP, if one is creating a large library, or to help communications
>> between a team of developers. These features can help track down where
>> a problem is if something isn't working right, or just for clarifying
>> the particular usage for the class or its members.
>>
>> BTW, I do not believe there is any controversy over what encapsulation
>> is; if so, I haven't heard about it.
>>
>
> Hi, Curtis,
>
> Actually, there is. Tony is claiming that variables should not be private
> because they are not part of the implementation.

Wrong again. I did not say that they SHOULD NOT be private, I said that they
DO NOT HAVE TO be private. It is optonal, not mandatory.

> All of the industry-recognized experts, college level OOAD courses, etc.
> disagree with him. So do the people who designed Java.
>
> And even the PHP designers disagree with him - otherwise why would they
> have bothered adding private and protected to variables, for instance?

They added those features so that programmers have the option of using them.
Their usage is OPTIONAL, not MANDATORY.

> Data should be private because it hides how the data is being stored. A
> SQL database is a perfect example. You can't access the data directly,
> but you can do it through SQL. And even if the internal representation of
> the data changes (i.e. switch from MyISAM to InnoDB engines in MySQL, or
> upgrade MySQL), you can still access the data with no changes to the
> program. The data is encapsulated, but it is not hidden (it's all
> available).

Now it is you who is being stupid. The way in whch data is stored in the
database has nothing to do with making object variables public, protected or
private. In a well-written application all database access should be
performed in a separate data access object (DAO), thus making it possible to
switch from one database to another (e.g. fom MySQL to PostgreSQL) without
having any effect on the business object.

My argument is that it is not NECESSARY to make every class variable private
or protected. It is an OPTION, but one which does not provide any
additional functionality or increased performance. All it does is place
restrictions on the programmer.

Jerry Stuckle

unread,
Dec 4, 2006, 8:06:01 AM12/4/06
to
Tony Marston wrote:
> Why is it so difficult for you to accept that YOUR opinion is not the ONLY
> opinion that is allowed to exist? Just because you can quote some people who
> agree with you does not make you right. I have quoted from other sources who
> agree with me, yet you dismiss all these different opinions as being
> "irrelevant".
>
> Your use of personal insults also shows what a juvenile mind you have.
>

Why is it so difficult for you to understand that you, with no real OO
experience, and in direct conflict with industry-recognized experts such
as Booch, Jacobson and Rumbaugh, as well as virtually every college
level course on the country, are full of shit?

Because you're stoopid, that's why.

And the insults are because you are too stoopid to understand anything
else, Tony.

People around here are laughing at you. Your stoopidity is beyond
comprehension by anyone with any intellect.

Jerry Stuckle

unread,
Dec 4, 2006, 8:09:08 AM12/4/06
to

Sorry, Tony. You're even too stoopid to understand the difference
between interfaces in the OO context, which is where this started out,
and the PHP interface keyword.

So you try to change the subject to something else you know absolutely
nothing about, then accuse others of doing the same.

Go back through this thread. Everyone was talking about OO interfaces
before troll Tony Marston stuck his big (and stoopid) mouth in here.

But then you didn't understand the difference the first time; you'll be
too stoopid to understand the difference the second time, also.

People are laughing at you, Tony.

Jerry Stuckle

unread,
Dec 4, 2006, 8:12:37 AM12/4/06
to

You notice how Tony refuses to answer your question? It's because he's
too stoopid to respond intelligently.

Have a good laugh with the rest of us - Tony still thinks he (and a few
other unheard of bloggers) are right, and all of the industry-recognized
experts, college professors, experienced OO designers, etc., are wrong.

I'm wondering - does the term megalomaniac ring a bell? Or do you think
it's just that he's beyond stoopid?

Jerry Stuckle

unread,
Dec 4, 2006, 8:20:11 AM12/4/06
to

Curtis,

Definitely. What you're doing is hiding the implementation of the class
- that is, how the data is stored. The data is still available, via the
accessor functions. But the rest of your program is not dependent on
the internal representation of that data.

Once you've released the class, you can't change or remove anything
that's defined as public (other than to add more to the public
interface). That's because you have no way of knowing who is using it.
You are, however, completely free to change anything declared as
private - because only the class itself can access those items.

The more complex the class, the more important this is. For instance,
there may be a change in the program requirements which necessitates a
change in the data for one reason or another. Or, perhaps there was a
bug in the class itself, and you need to change the data. Or any of a
million different possibilities.

Keeping the data encapsulated ensures any changes to the data only
affect the class itself, and nothing which uses the class.

Jerry Stuckle

unread,
Dec 4, 2006, 8:26:04 AM12/4/06
to

Tony, you continue to make a complete ass of yourself. To back into
your little hole, you stoopid troll.

>
>>All of the industry-recognized experts, college level OOAD courses, etc.
>>disagree with him. So do the people who designed Java.
>>
>>And even the PHP designers disagree with him - otherwise why would they
>>have bothered adding private and protected to variables, for instance?
>
>
> They added those features so that programmers have the option of using them.
> Their usage is OPTIONAL, not MANDATORY.
>

Because you have no idea about what you're talking about. You've been
on one failed OO project - supposedly because those in charge knew less
that you do. You've never taken a class in OO, you've never read any of
the industry-recognized experts on OO (and refuse to do so).

You're just a stoopid troll.

>
>>Data should be private because it hides how the data is being stored. A
>>SQL database is a perfect example. You can't access the data directly,
>>but you can do it through SQL. And even if the internal representation of
>>the data changes (i.e. switch from MyISAM to InnoDB engines in MySQL, or
>>upgrade MySQL), you can still access the data with no changes to the
>>program. The data is encapsulated, but it is not hidden (it's all
>>available).
>
>
> Now it is you who is being stupid. The way in whch data is stored in the
> database has nothing to do with making object variables public, protected or
> private. In a well-written application all database access should be
> performed in a separate data access object (DAO), thus making it possible to
> switch from one database to another (e.g. fom MySQL to PostgreSQL) without
> having any effect on the business object.
>
> My argument is that it is not NECESSARY to make every class variable private
> or protected. It is an OPTION, but one which does not provide any
> additional functionality or increased performance. All it does is place
> restrictions on the programmer.
>

To crawl back into your hole, stoopid troll. You obviously don't
understand encapsulation. And you have no idea what I was talking
about, even though it was in terms simple enough for you to understand.

People continue to laugh at you, Tony. You continue to prove you are
too stoopid to understand your ignorance.

Curtis

unread,
Dec 4, 2006, 8:26:51 AM12/4/06
to
Tony Marston wrote:
> No, encapsulation is not about making everything private, it is about
> putting data and the operations which act upon that data into a single
> class. The ability to make certain operations or pieces of data private or
> protected is OPTIONAL, not MANDATORY.

I never claimed to summarize the entirety of encapsulation as the act
of making EVERYTHING private, I was merely restating in my own words to
try and clarify my understanding.

> I am not saying that you MUST NOT make things private/protected, I am simply
> arguing against the statement that you MUST use the private/protected
> option. The point is that his is entirely OPTIONAL and is a matter of
> personal preference.

You seem to be best friends with the straw man fallacy.

> As for saying that you MUST make all data private and access it through
> getters and setters, you obviously haven't read
> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html

The sources I've gathered, although differ slightly in diction,
generally concur on the meaning of encapsulation. It is true that not
all experts in a field will agree on everything, but the areas in which
there is genuine knowledge are not up for debate or subject to opinion.
You may be confusing semantics for the actual act of implementation, in
this case.

Please don't put words in my mouth. I never said that you MUST do
anything. Honestly, the source you cited is extremely dubious. Nearly
every comment questions Allen Holub's credibility. This is not an
authoritative source, by any means. One commenter even states:

"We have countless of examples of projects / systems that were and are
successful (the Java source code itself being one) using OO concepts
that are contrary to what Holub advocates. In other words, most of us
has been successful doing what he says we shouldn't do and what he
claims won't work well."

It's not my intention to sit here and argue, and I'm sure you have a
retort in waiting, so I'll just go study elsewhere until I have a
decent question that will be of worth to this newsgroup.

Curtis

Michael Fesser

unread,
Dec 4, 2006, 10:06:24 AM12/4/06
to
.oO(Jerry Stuckle)

>You notice how Tony refuses to answer your question?

Yep.

>I'm wondering - does the term megalomaniac ring a bell? Or do you think
> it's just that he's beyond stoopid?

I don't know, but actually I don't really care at all. He has just
proven that any attempt to further discuss these things doesn't make
sense. He is always right, the rest of the world is wrong.

I can live with that and draw my conclusions. ;)

EOT
Micha

Moot

unread,
Dec 4, 2006, 10:18:10 AM12/4/06
to

- Interfaces are optional, you don't need to use them to access class
functions.
- Classes are optional, you don't need to define them to use functions
and have reusable code.
- High level languages are optional, you don't need to use them to
access the computer's registers and memory
- All programming languages are optional, you can just write the
machine code directly

Optional != Useless

The whole point of all of these languages, paradigms, and concepts we
have available to us isn't to force you to use them, it's to make the
trivial details disappear so you can focus at a higher level and more
abstract ideas. If you don't want to use them, that's your choice, but
they wouldn't exist if lots of people didn't find them useful.

And if the point you're trying to argue is merely that interfaces are
optional, then I think that's a very silly argument to make. Yes, PHP
doesn't *force* you to use interfaces. You win that point. Way to go.
Next up: I claim that the sky is sometimes blue. Anyone care to
disagree?

- Moot

Michael Fesser

unread,
Dec 4, 2006, 10:43:24 AM12/4/06
to
.oO(Moot)

> Next up: I claim that the sky is sometimes blue. Anyone care to
>disagree?

The sun is not necessary.
At night it doesn't shine, and during the day it's bright anyway.

SCNR
Micha

Jerry Stuckle

unread,
Dec 4, 2006, 9:18:06 PM12/4/06
to

Yea. But the real problem is - he wouldn't even make a good stand-up
comedian :-)

Tony Marston

unread,
Dec 5, 2006, 5:00:46 AM12/5/06
to

"Moot" <mootmail-g...@yahoo.com> wrote in message
news:1165245490....@j44g2000cwa.googlegroups.com...

Some people may find them useful, whie others have no use for them at all.
It is a matter of choice.

> And if the point you're trying to argue is merely that interfaces are
> optional, then I think that's a very silly argument to make.

It is a perfectly valid argument against the idea that because interfaces
are there you MUST use them.

> Yes, PHP
> doesn't *force* you to use interfaces. You win that point.

Good. That was the only point I was making.

> Way to go.
> Next up: I claim that the sky is sometimes blue.

And your point is?

Tony Marston

unread,
Dec 5, 2006, 5:07:47 AM12/5/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:hu6dnfDLhrWygOnY...@comcast.com...

> Tony Marston wrote:
>> Why is it so difficult for you to accept that YOUR opinion is not the
>> ONLY opinion that is allowed to exist? Just because you can quote some
>> people who agree with you does not make you right. I have quoted from
>> other sources who agree with me, yet you dismiss all these different
>> opinions as being "irrelevant".
>>
>> Your use of personal insults also shows what a juvenile mind you have.
>>
>
> Why is it so difficult for you to understand that you, with no real OO
> experience,

Rubbish. I have been writing OO software that works for 4 years.

> and in direct conflict with industry-recognized experts such as Booch,
> Jacobson and Rumbaugh, as well as virtually every college level course on
> the country, are full of shit?

There is no such thing as one set of experts with whom EVERYBODY agrees.
There are lots of people with lots of conflicting opinions. I happen to
disagee with your opinions, and I have quoted other people who also
disagree.

> Because you're stoopid, that's why.
>
> And the insults are because you are too stoopid to understand anything
> else, Tony.
>
> People around here are laughing at you. Your stoopidity is beyond
> comprehension by anyone with any intellect.

Your juvenile insults show just how small minded you really are.

Tony Marston

unread,
Dec 5, 2006, 5:10:13 AM12/5/06
to
This is a PHP newsgroup, not an OO newsgroup, so the discussion of
interfaces concerns PHP, and in PHP interfaces are optional and unnecessary.

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:hu6dnfPLhrV2gOnY...@comcast.com...

Tony Marston

unread,
Dec 5, 2006, 5:13:12 AM12/5/06
to

"Michael Fesser" <net...@gmx.de> wrote in message
news:4ud8n2dcgrj80p0c9...@4ax.com...

> .oO(Jerry Stuckle)
>
>>You notice how Tony refuses to answer your question?
>
> Yep.
>
>>I'm wondering - does the term megalomaniac ring a bell? Or do you think
>> it's just that he's beyond stoopid?
>
> I don't know, but actually I don't really care at all. He has just
> proven that any attempt to further discuss these things doesn't make
> sense. He is always right, the rest of the world is wrong.

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?

Tony Marston

unread,
Dec 5, 2006, 5:20:50 AM12/5/06
to

"Curtis" <dye...@gmail.com> wrote in message
news:1165238811.5...@16g2000cwy.googlegroups.com...

> Tony Marston wrote:
>> No, encapsulation is not about making everything private, it is about
>> putting data and the operations which act upon that data into a single
>> class. The ability to make certain operations or pieces of data private
>> or
>> protected is OPTIONAL, not MANDATORY.
>
> I never claimed to summarize the entirety of encapsulation as the act
> of making EVERYTHING private, I was merely restating in my own words to
> try and clarify my understanding.
>
>> I am not saying that you MUST NOT make things private/protected, I am
>> simply
>> arguing against the statement that you MUST use the private/protected
>> option. The point is that his is entirely OPTIONAL and is a matter of
>> personal preference.
>
> You seem to be best friends with the straw man fallacy.

So do otherpeople in this newsgroup.

>> As for saying that you MUST make all data private and access it through
>> getters and setters, you obviously haven't read
>> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html
>
> The sources I've gathered, although differ slightly in diction,
> generally concur on the meaning of encapsulation

Not everybody agrees on what encapsulation is. Not everybody agrees on what
OO is. For every opinion there is a different opinion. Some features are
optional, so it is a matter of personal preference whether to use them or
not.

>. It is true that not
> all experts in a field will agree on everything, but the areas in which
> there is genuine knowledge are not up for debate or subject to opinion.

I disagree. Absolutely everything is open to debate and subject to different
opinions.

> You may be confusing semantics for the actual act of implementation, in
> this case.
>
> Please don't put words in my mouth. I never said that you MUST do
> anything. Honestly, the source you cited is extremely dubious. Nearly
> every comment questions Allen Holub's credibility. This is not an
> authoritative source, by any means. One commenter even states:
>
> "We have countless of examples of projects / systems that were and are
> successful (the Java source code itself being one) using OO concepts
> that are contrary to what Holub advocates. In other words, most of us
> has been successful doing what he says we shouldn't do and what he
> claims won't work well."

That just goes to prove that for every opinion there is a different opinion.

Jerry Stuckle

unread,
Dec 5, 2006, 8:18:02 AM12/5/06
to
Tony Marston wrote:
> "Jerry Stuckle" <jstu...@attglobal.net> wrote in message
> news:hu6dnfDLhrWygOnY...@comcast.com...
>
>>Tony Marston wrote:
>>
>>>Why is it so difficult for you to accept that YOUR opinion is not the
>>>ONLY opinion that is allowed to exist? Just because you can quote some
>>>people who agree with you does not make you right. I have quoted from
>>>other sources who agree with me, yet you dismiss all these different
>>>opinions as being "irrelevant".
>>>
>>>Your use of personal insults also shows what a juvenile mind you have.
>>>
>>
>>Why is it so difficult for you to understand that you, with no real OO
>>experience,
>
>
> Rubbish. I have been writing OO software that works for 4 years.
>

No, you haven't, Tony. You've been writing crap for four years and
calling it OO software.

>
>>and in direct conflict with industry-recognized experts such as Booch,
>>Jacobson and Rumbaugh, as well as virtually every college level course on
>>the country, are full of shit?
>
>
> There is no such thing as one set of experts with whom EVERYBODY agrees.
> There are lots of people with lots of conflicting opinions. I happen to
> disagee with your opinions, and I have quoted other people who also
> disagree.
>

Every industry-recognized expert, virtually every college professor and
most experienced designers around the world disagree with you.

But you're too stoopid to see that.

>
>>Because you're stoopid, that's why.
>>
>>And the insults are because you are too stoopid to understand anything
>>else, Tony.
>>
>>People around here are laughing at you. Your stoopidity is beyond
>>comprehension by anyone with any intellect.
>
>
> Your juvenile insults show just how small minded you really are.
>

And you're inability to understand just how stoopid you are and what an
arsehole you're making of yourself in this group shows how closed-minded
you are and has everyone laughing at you.

You're just another stoopid troll with delusions of competency, Tony.

Jerry Stuckle

unread,
Dec 5, 2006, 8:20:00 AM12/5/06
to
Tony Marston wrote:
> This is a PHP newsgroup, not an OO newsgroup, so the discussion of
> interfaces concerns PHP, and in PHP interfaces are optional and unnecessary.
>

Again, you don't understand the original contest - which was interfaces
as defined in OO terms. And since PHP is an OO language, it is
perfectly appropriate in this newsgroup.

But since you don't know shit about it, but are determined to stuff your
comments in here anyway, just like any troll, you try to change the subject.

YOU are the only one who has brought up PHP interfaces, Tony. And no
one else is discussing them.

Jerry Stuckle

unread,
Dec 5, 2006, 8:24:22 AM12/5/06
to

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. They are how you
interact with the object, and
(b) Proper encapsulation means that all variables are defined as
private, because the way the data is stored (variable name, data type,
etc.) is a part of the implementation.

And on this every industry-recognized expert agree. It's even how they
teach it in all of the College courses. But of course, they are all
wrong, and only Troll Tony is right.

Tony Marston

unread,
Dec 6, 2006, 10:28:19 AM12/6/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:heudnY0tgPFj7-jY...@comcast.com...

> Tony Marston wrote:
>> "Michael Fesser" <net...@gmx.de> wrote in message
>> news:4ud8n2dcgrj80p0c9...@4ax.com...
>>
>>>.oO(Jerry Stuckle)
>>>
>>>
>>>>You notice how Tony refuses to answer your question?
>>>
>>>Yep.
>>>
>>>
>>>>I'm wondering - does the term megalomaniac ring a bell? Or do you think
>>>> it's just that he's beyond stoopid?
>>>
>>>I don't know, but actually I don't really care at all. He has just
>>>proven that any attempt to further discuss these things doesn't make
>>>sense. He is always right, the rest of the world is wrong.
>>
>>
>> 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.

> (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.

> because the way the data is stored (variable name, data type, etc.) is a
> part of the implementation.
>
> And on this every industry-recognized expert agree.

Not everybody agrees with your description, industry expert or not. I
certainly don't

> It's even how they teach it in all of the College courses. But of
> course, they are all wrong, and only Troll Tony is right.

I am right in the following:

(a) In PHP interfaces are not necessary.

(b) Encapsulation does not mean that all variables must be declared private
or protected.

--

Jerry Stuckle

unread,
Dec 6, 2006, 11:19:21 AM12/6/06
to

And in OO terms that is the INTERFACE! But you don't know anything
about OO, that's obvious.


>
>> (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.

>
>>because the way the data is stored (variable name, data type, etc.) is a
>>part of the implementation.
>>
>>And on this every industry-recognized expert agree.
>
>
> Not everybody agrees with your description, industry expert or not. I
> certainly don't
>

But you've already shown you don't understand OO, have no idea what good
programming practices are, and are just plain stupid. So that doesn't
surprise me.

And you know what? I really don't give a damn if you agree or not. I
get my answers from industry-recognized experts such as Booch, Iverson
and Rumbaugh, not some wanna-be's blog.

Try reading what the REAL EXPERTS have to say. Then try taking a
college level course on OOAD. They will all say the same thing. YOU'RE
WRONG!

>
>> It's even how they teach it in all of the College courses. But of
>>course, they are all wrong, and only Troll Tony is right.
>
>
> I am right in the following:
>
> (a) In PHP interfaces are not necessary.
> (b) Encapsulation does not mean that all variables must be declared private
> or protected.
>

And your head is still up your ass. Stupid troll.

Moot

unread,
Dec 6, 2006, 12:06:43 PM12/6/06
to
Tony Marston wrote:
> 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.
>

I think what's happening here is the unfortunate result of one word
having two different meanings. In this whole argument back and forth
between you two (Tony and Jerry), you each keep using the opposite
definition. Tony interprets "interface" to be the PHP language
construct, while Jerry uses the term "interface" in its object-oriented
context. Neither are wrong, but to have an intelligent, reasonable,
(and hopefully friendly) debate, one needs to define the terms used
beforehand to clear up any confusion.

- PHP language construct "interface": a construct defined which
declares a set of functions and parameters which must be implemented if
an object claims to use that interface.
- OO concept "interface": an abstract idea that the member functions
which an object exposes to the outside (ie: public, but not private
functions), comprise the interface to that object through which other
objects may interact with it.

The language construct interface is indeed optional and requires
seperate code specifically written for this purpose. The OO concept of
an interface is *implicit to an object* and requires no additional code
to be written. Any public function of an object is automatically a
part of this interface.

For a physical world example, think of your car stereo. Its interface
(in the OO context) consists of buttons, dials, and a screen (the
public functions which you use to interact with it), while the laser
which reads the CD's and it's power adapter are not part of the
interface (they would be private functions which are used only inside
the class). Now say that it has an iPod connector. In order to make
sure that is sends and receives the correct signals to your iPod, it
must implement some kind of standard, defined by Apple in the (language
construct context) iPod Interface.

So you see? You're both right in your own context. Everybody wins.
Cookies and punch are available in the next room for anyone who wants
to put this semantic pissing match to rest.

- Moot

Jerry Stuckle

unread,
Dec 6, 2006, 9:39:33 PM12/6/06
to

Moot,

The problem is the original discussion was about interface in the OO
concept. But Tony knows nothing about OO, other than what he's read in
a few blogs by unknown authors of dubious credibility. So he tries to
take it into something he has never used, but can look up easily - the
PHP interface keyword.

I'm just not letting him change the subject.

It would be refreshing if he knew anything. But he obviously has no
clue what he's talking about - even in the case of a PHP interface.

He's just a troll with delusions of competency.

Tony Marston

unread,
Dec 7, 2006, 6:52:25 AM12/7/06
to

"Jerry Stuckle" <jstu...@attglobal.net> wrote in message
news:uKCdnemKmvXicOvY...@comcast.com...

> Tony Marston wrote:
>> "Jerry Stuckle" <jstu...@attglobal.net> wrote in message
>> news:heudnY0tgPFj7-jY...@comcast.com...
>>
>>>Tony Marston wrote:
>>>
>>>>"Michael Fesser" <net...@gmx.de> wrote in message
>>>>news:4ud8n2dcgrj80p0c9...@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

unread,
Dec 7, 2006, 6:56:21 AM12/7/06
to
There is a big difference between interface as in API (Application
Programming Interface) and interface as an OO construct which contains the
words "interface" and "implements".

In PHP I can access an object's method through its API, and I do not need
that additional declaration that contains the word "interface".

Simple, isn't it?

"Moot" <mootmail-g...@yahoo.com> wrote in message
news:1165424803.2...@73g2000cwn.googlegroups.com...

Jerry Stuckle

unread,
Dec 7, 2006, 7:02:08 AM12/7/06
to

You really don't know anything about OO, do you, Tony. Not even the
most basic terminology.

> 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".
>

Stupid troll doesn't understand basic OO.

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

You really don't know OO terminology, Tony. I suggest you at least read
up on the basics of OO - from a RESPECTED SOURCE, not your favorite blog
entries.

You only continue to make a huge fool of yourself. But you're only a
stupid troll, so that's only to be expected.

>
>>>>(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.
>

You really don't understand even the most basic elements of OO
programming, Tony. You're just a troll.

Read from RESPECTED RESOURCES. Then open your mouth. You're only
making a bigger fool of yourself, and people are laughing at you.

What little credibility you ever had in the newsgroup is virtually all
gone now. You've made too much of an ass of yourself for anyone to take
you seriously.

Jerry Stuckle

unread,
Dec 7, 2006, 7:12:27 AM12/7/06
to
Tony Marston wrote:
> There is a big difference between interface as in API (Application
> Programming Interface) and interface as an OO construct which contains the
> words "interface" and "implements".
>
> In PHP I can access an object's method through its API, and I do not need
> that additional declaration that contains the word "interface".
>
> Simple, isn't it?
>

Yep, you've once again shown you don't understand even the basic
terminology of OO programming, Tony.

Tony the Troll once again makes a complete ass of himself.

Moot

unread,
Dec 7, 2006, 8:28:03 AM12/7/06
to
Jerry Stuckle wrote:
>
> Tony the Troll once again makes a complete ass of himself.


I don't mean to be rude, but you aren't showing yourself in too good of
a light right now, either, by prolonging this argument.

If I didn't believe you way back in the beginning when you said he was
just trolling, I sure do now. But what's the #1 rule for trolls?
Don't feed them.

I'd like to thank the both of you for making my workday a slight bit
more entertaining the past week or so, but I've just about had my fill
of this thread. I suggest that you stop caring about getting the last
word and just let it die. At this point, I think everyone realizes who
knows what he's talking about and who doesn't.

- Moot

0 new messages