POV-Ray : Newsgroups : povray.off-topic : Messages vs Methods : Re: Messages vs Methods Server Time
6 Sep 2024 03:14:54 EDT (-0400)
  Re: Messages vs Methods  
From: clipka
Date: 28 Feb 2009 14:25:00
Message: <web.49a98e7236df71f3e41007250@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   Maybe not completely related, but I find it curious how some
> object-oriented concepts talk about inheritance about one class/object
> extending another, while others talk about specializing, although they
> are technically speaking usually the same thing.

As these terms are commonly used, yes. It can be defined more strictly though,
to show the differences:

"Extending" can be defined as *adding* to an interface, where "specializing" can
be defined as *modifying* the implementation of an interface.

Both are an example of polymorphism; however, only the former requires runtime
type checking, while only the latter requires runtime method lookup.

So they are in fact orthogonal, and any sane OO language supports both -
although they often use either of the two terms in the broader synonymous
sense.


I like C# in this respect, as it requires you to be clear about which methods
you add (= extending) and which you override (= specializing). If that doesn't
match up with the base class, C# will force you to stop and rethink about it.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.