POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 10:21:47 EDT (-0400)
  Re: Object Oriented POV code  
From: Warp
Date: 22 Feb 2004 19:40:01
Message: <40394be1@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> >   Interfaces are obsolete of you can make abstract classes.

> Technically, they're obsolete if you have decent multiple inheritance. 
> The benefit of a Java interface is that you can be a Stream *and* a 
> Thread *and* an Iterator.

  Supposing you are happy with the fact that you must implement every
single method of Stream, Thread and Iterator in every single inherited
class... You can't group common functionality in the interfaces.

  This is one thing which I have never understood (and probably never
will) about interfaces: They *force* you to perform one of the basic
sins in programming: Code repetition.
  I thought Java was designed to force the programmer to make good
code, not bad code. *sigh*

  Besides, multiple inheritance was not included in Java because you
can use it "in the wrong way" (same song as with every non-included
feature in Java).
  How can you use multiple-inheritance in the wrong way? Well, one
classical example is that you have a Boat class and a Plane class
and you multiple-inherit a Hydroplane class from them. This is
bad OO design (mainly because a Hydroplane is not a boat).
  Well, make a Boat interface and a Plane interface and make
a Hydroplane class which implements them. What's the difference?

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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