POV-Ray : Newsgroups : povray.advanced-users : Object Oriented POV code : Re: Object Oriented POV code Server Time
29 Jul 2024 14:18:59 EDT (-0400)
  Re: Object Oriented POV code  
From: Christopher James Huff
Date: 22 Feb 2004 17:22:44
Message: <cjameshuff-5DD27F.17232622022004@news.povray.org>
In article <4038f64d$1@news.povray.org>, Darren New <dne### [at] sanrrcom> 
wrote:

> > wouldn't you (unless you want to make the language so that it does
> > not support virtual functions, which would limit its OO capabilities
> > by a whole lot).
> 
> Well, then it wouldn't be OO at all, as you wouldn't have any dynamic 
> dispatch.

Oh? Objective C doesn't have anything called virtual functions. It has 
methods and messages instead. And they're not the same thing...the 
messaging model is a bit more flexible than the member function call 
model.


> > Someone will inevitably use it in the wrong way and his code can then
> > break with an updated version of the library.
> 
> Interestingly enough, C# actually addresses this problem. Nice language, 
> that.

Could you clarify this?
C# does sound like a good language from what I've heard, too bad it's 
MS-only.
(Don't say Mono...it's incomplete, and will always be so...its existance 
only gives people something to point at when claiming C# isn't MS-only.)


> That's actually what Eiffel does. You might want to look into it. It 
> even goes a step farther, in that it allows you to restrict (for 
> example) what values a child object is allowed to return from a member 
> function it overrides.

So the superclass can define that a method returns a real value between 
0 and 1, and subclass overrides must remain in that range? This is one 
of Eiffel's design-by-contract features, right?

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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