Yukihiro Matsumoto
1/25/2007 6:17:00 PM
Hi,
In message "Re: Class & modifiers modifiers"
on Fri, 26 Jan 2007 01:13:25 +0900, Miquel <ktalanet@yahoo.es> writes:
|> public. I don't recommend to override protected method though.
|
|Why not?
Because protected methods are called only from subclass of defining
class. That means overriding changes the restriction scope of the
method.
|You might have a protected method in a module which has no code or
|only an exception (something like an abstract method in Java/C#) and has
|a different behaviour in the different classes which include it. In this
|case it must have been overriden.
|
|What do you think about this?
As far as current protected behavior remains, I'd recommend to prepare
separate method to override in the subclass.
matz.