You are here: Re: Object Oriented PHP « PHP Programming Language « IT news, forums, messages
Re: Object Oriented PHP

Posted by Tony Marston on 10/02/23 11:51

"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:7sudnawIL7dKkjzZnZ2dnUVZ_v-dnZ2d@comcast.com...
> Tony Marston wrote:
>> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>> news:Teadndafls4zHz3ZnZ2dnUVZ_v-dnZ2d@comcast.com...
>>
>>>Tony Marston wrote:
>>>
>>>>"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>>>news:7fCdnbmMO7sjJQLZnZ2dnUVZ_tidnZ2d@comcast.com...
>>>>
>>>>
>>>>>Tony Marston wrote:
>>>>>
>>>>>
>>>>>>"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>>>>>news:tMydnfBVrd_suQLZnZ2dnUVZ_o6dnZ2d@comcast.com...
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Tony Marston wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>>>>>>>news:ceOdneMn6a1vTwPZnZ2dnUVZ_oWdnZ2d@comcast.com...
>>>>>>>>
>>>>>>
>>>>>><snip>
>>>>>>
>>>>>>>>OO is about encapsulation, polymorphism and inheritance. Message
>>>>>>>>passing is incidental.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>And YOU are the one "bastardizing" OO. Your sloppy approach to
>>>>>>>>>programming is just what *real* OO is designed to eliminate. And
>>>>>>>>>it makes the coding much more maintainable, expandable and
>>>>>>>>>modifiable.
>>>>>>>>
>>>>>>>>
>>>>>>>>Not the way some people use OO. They deliberately make it more
>>>>>>>>complicated than it need be, while I keep it as simple as possible.
>>>>>>>>
>>>>>>>
>>>>>>>And that is where you are 100% wrong. Message passing is an integral
>>>>>>>part of both object-based and object-oriented languages.
>>>>>>>
>>>>>>>One bit of wisdom, Tony. Tis better to remain silent and have
>>>>>>>everyone thing you might be a fool than to open your mouth and remove
>>>>>>>all doubt.
>>>>>>>
>>>>>>>In the OO world you have removed all doubt.
>>>>>>
>>>>>>
>>>>>>The three principles of OO are encapsulation, polymorphism and
>>>>>>inheritance. Message passing does not appear in that list, so it is a
>>>>>>minor detail.
>>>>>>
>>>>>
>>>>>And that's where you are totally wrong.
>>>>
>>>>
>>>>Excuse me? After performing a google search on OOP all I see quoted time
>>>>after time are the three basic principles - encapsulation, inheritance
>>>>and polymorphism - so how could I possibly be wrong?
>>>>
>>>
>>>Maybe if you check some sites which know what they're talking about -
>>>instead of your own. Try some like:
>>>
>>>http://www.fincher.org/tips/General/SoftwareEngineering/ObjectOrientedDesign.shtml
>>>http://en.wikipedia.org/wiki/Object-oriented_programming
>>>http://www.awprofessional.com/bookstore/product.asp?isbn=0201824191&redir=1
>>>http://www.objectfaq.com/oofaq2/body/basics.htm
>>>
>>>Just for starters.
>>
>>
>> I got my information from these sites:
>>
>> http://c2.com/cgi/wiki?ObjectOriented
>> http://c2.com/cgi/wiki?PolymorphismEncapsulationInheritance
>> http://en.wikipedia.org/wiki/Object-oriented_programming
>> http://www.phpbuilder.com/columns/luis20000420.php3
>>
>> All I see about message passing is that it is how one object communicates
>> with another. This is a trivial detail compared with encapsulation,
>> inheritance and polymorphism. Even non-OO languages can pass messages, so
>> what's so important about it?
>>
>
> Gee, and wiki's are the Last Word? ROFLMAO! Try some real experts - like
> Booch, Iverson and Rumbaugh, for instance. These guys have been
> recognized as experts throughout the world for upwards of 20 years -
> instead of some guy who posted in a wiki.

There is nothing special with messaging. It's a piece of code calling a
function, which has existed in many non-OO languages for decades. There is
no difference between calling a function and calling a method (function)
within an object.

OOP is about encapsulation, inheritance and polymorhism, and the ability to
create objects from classes. It is taken for granted that there is a method
of communicating with each of the objets ou create. There is nothing special
about "messaging" at all.

> However, wikipedia (which I also mentioned because it might meet your
> level of intelligence), says under "Fundamental Concepts":
>
> "Method (also known as message) — how code can use an object of some
> class. A method is a form of subroutine operating on a single object

Other languages have had the ability to create subroutines, and to be able
to call those subrutines, for ages. There is nothing special about that
which only eists in OOP.

>. Methods may be divided into queries returning the current state and
>commands changing it:

Other langages have had the ability for a module to have several entry
points, and for each entry point to do something different, for decades.
There is nothing special about his technique which is unique to OOP,
therefore saying that it is a fundamental priciple of OOP is entirely
misleading. AFAIAC it is a fundamental requirement of EVERY language, OO and
non-OO, to be able to call one module from another. This is a standard
requirement, there is nothing special aout it at all.

> a Dog could have a query Age to say how old it is, and command chase
> (Rabbit target) to start it chasing a rabbit. A method may also do both,
> but some authorities (e.g. Bertrand Meyer) recommend they be kept
> separate. Sometimes access to the data of an object is restricted to the
> methods of its class."
>
> It is important because that's how you communicate with objects. It's the
> interface, which is public, instead of the implementation, which is
> private.

Calling a function and passing parameters to it, and getting parameters
back, is not something which is unique to OO. It is a standard feature of
EVERY language, therefore to say that it is a fundamental principle of OOP
carries no more weight than saying the ability to declare variables is a
fundamental principle of OOP. It is oneof those obvious things which should
not have to be stated.

> But if you understood OO as well as you claim you would understand that.

The difference between an OO and a non-OO language is that one has
encapsulation, inheritance and polymorphism while the other does not. Both
have messaging (the ability to call functions) so that is a complete red
herring.

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

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация