From: Duong Quang Ha Date: 2012-05-25T11:31:15+09:00 Subject: Re: Don't override it - Use it --e89a8ff1c3d083350504c0d329e2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, On Fri, May 25, 2012 at 8:10 AM, Doug Jolley wrote: > > And it *is* actually called overriding: > > http://en.wikipedia.org/wiki/Method_overriding > > I read the wikipedia link. As a reader who knows nearly nothing, it > would seem to me that the methodology that I described would not qualify > as "overriding" according to the definition contained in the wikipedia > post because the wikipedia post (like other posts I have read) says that > in order to qualify as "overriding" the method in the child class has to > *replace* the method in the super class. In my example, I don't see the > method in the child class *replacing* the method in the super class > because the method in the child class actually uses the method in the > super class. I don't see how one can say that a method has been > *replaced* if it is being used. None-the-less, if that is the > conventional wisdom, I'm happy to go along with it. I just need to > adjust my understanding of what "overriding" means. > > Thanks again for the input and for helping me understand what > "overriding" means. > > In Ruby, the *overriding* actually is *shadow* the superclass's method (hope that I used right word). You can't direct call the superclass's metho= d but it still around, it don't be removed. When you call super, it'll go up in the class's inheritance tree step-by-step and find method with same name. (sorry for my bad English) Best regards, --=20 Duong Quang Ha (H=C3=A0 Quang D=C6=B0=C6=A1ng in Vietnamese) blog.haqduong.com --e89a8ff1c3d083350504c0d329e2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi,

On Fri, May 25, 2012 at 8:10 AM, Doug= Jolley <lists@ruby-forum.com> wrote:
> And it *is* actually called overriding:
> http://en.wikipedia.org/wiki/Method_overriding

I read the wikipedia link. =C2=A0As a reader who knows nearly nothing= , it
would seem to me that the methodology that I described would not qualify as "overriding" according to the definition contained in the wiki= pedia
post because the wikipedia post (like other posts I have read) says that in order to qualify as "overriding" the method in the child class= has to
*replace* the method in the super class. =C2=A0In my example, I don't s= ee the
method in the child class *replacing* the method in the super class
because the method in the child class actually uses the method in the
super class. =C2=A0I don't see how one can say that a method has been *replaced* if it is being used. =C2=A0None-the-less, if that is the
conventional wisdom, I'm happy to go along with it. I just need to
adjust my understanding of what "overriding" means.

Thanks again for the input and for helping me understand what
"overriding" means.


In R= uby, the *overriding* actually is *shadow* the superclass's method
= (hope that I used right word). You can't direct call the superclass'= ;s method
but it still around, it don't be removed.

When you call super, it'll go up in the class's inheritance=C2=A0t= ree=C2=A0step-by-step
and find method with same name.
<= div>(sorry for my bad English)

Best regards,

--
Duong Quang Ha= (H=C3=A0 Quang D=C6=B0=C6=A1ng in Vietnamese)
blog.haqduong.com

--e89a8ff1c3d083350504c0d329e2--