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 02:15

Sanders Kaufman wrote:
> Jerry Stuckle wrote:
>
>> You can't change the base class method - by definition, it's part of
>> the interface. But the variable is part of the implementation. In a
>> proper design you can change the variable (and, of course, the BODY of
>> functions which reference it) without changing the interface - and the
>> child classes.
>
>
> Speaking of named methods and overrides...
> I just now realized that I had a TableName property in both my baseclass
> and my extended class... accidentally overriding, right?
>
> But... can I still have it in both places, calling the baseclass
> property with one of those :: operators?
>
> Or does the overriding kill that altogether?

No, overriding doesn't kill this. However, generally you would want to
call the derived class's function, and that one would call the base
class's function.

If the functions have the same name, the child class's function should
be an extension of the base class's function. If the child class
function is not, it should have a different name.

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

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