You are here: Re: Using a Resource as a Class Property « PHP Programming Language « IT news, forums, messages
Re: Using a Resource as a Class Property

Posted by Jerry Stuckle on 07/23/07 18:43

Sanders Kaufman wrote:
> Jerry Stuckle wrote:
>> Sanders Kaufman wrote:
>
>>> Vocabulary question: When I do this, what is the OOP thing that I'm
>>> doing? You said that my use of an object as a property of the parent
>>> class was "aggregation. So - when I use use "extends" to create the
>>> child's reference to the parent - wassat? Marshalling? Inheritance?
>>
>> Inheritance.
>
> And then... overwriting functions would be polymorph?
> And... PHP allows function overwriting?
>
> Zat right?

Yes, and no. PHP doesn't have true polymorphism in the sense of other
OO languages, although what it has is effectively the same.

I say it doesn't have "true polymorphism" because PHP is an untyped
language. Typed languages such as C++ and Java differentiate between the
"apparent" type of the object (the type defined for the variable) and
the "true" type - that being what the object really is.

But since PHP variables are not typed, there is no "apparent" type - the
interpreter always knows the "true type".

So although the implementation is different - the effect is exactly the
same, and you can correctly consider it polymorphism.


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

 

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

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