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/24/07 10:45

Sanders Kaufman wrote:
> Jerry Stuckle wrote:
>> Sanders Kaufman wrote:
>
>>> So when I override a function, it actually calls the baseclass
>>> function AND THEN the derived function? Did I understand that right?
>>
>> No, it doesn't. It only calls the derived class function. But the
>> derived class function should call the base class function.
>
> Oh, OK. I misunderstood "should".
> You're saying that if I override a function, I should be calling the
> overridden function from within the override at some point.
> This is an OOP design principle, but not necessarily enforced in the
> compiler/IDE thingies.
> It's that way because, there's not much point in writing a function that
> just gets voided in the actual implementation and because it allows you
> to put some shared or common functionality deeper down (higher up?) into
> the foundation of the architecture.
>
> Zat right?

That is true. The problem is - if you don't call the base class
function, work the base class needs to do for other things may not be
performed. For instance, a variable in the base class may not be set,
and that variable may be used in a subsequent call to a base class function.

No, compilers don't enforce it. But it's a good idea.

--
==================
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

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