POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 08:24:53 EDT (-0400)
  Re: Object Oriented POV code  
From: Tek
Date: 19 Feb 2004 23:28:28
Message: <40358cec$1@news.povray.org>
>   Then they are not object-oriented languages. Some kind of inheritance is
> a basic feature of object-oriented languages.

I'm not entirely sure that's true. The concept of an object does not implicitly
require inheritance, since the principles of modularity with private states etc
can still apply, and as such a language can be oriented about objects without
needing inheritance. Though all the OO languages I know of do have inheritance.

I'm trying to thing back to the OO analysis and design course I did on my
degree, but I can't honestly remember whether it considered inheritance to be
fundamental to OO...

> > Inheritance is something different, designed to
> > allow you to share code between different parts of your program, to ease
> > maintenance.
>
>   Nope, that's a way too narrow way of defining inheritance.
>
>   It's true that inheritance can (and should) be used to group common
> code into a single module. However, that's not the only (and depending
> on who you ask not even the most important) reason for inheritance.

I agree. For example, the only reason I'm planning to implement inheritance is
so that I can have an interface class with virtual functions. No shared code
whatsoever.

-- 
Tek
www.evilsuperbrain.com


Post a reply to this message

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