realbasic-nug
[Top] [All Lists]

Re: Subclassing Question

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Subclassing Question
From: Charles Yeomans <yeomans at desuetude dot com>
Date: Thu, 22 Aug 2002 11:43:15 -0400

On Thursday, August 22, 2002, at 10:32  AM, Randall Meadows wrote:

On 8/22/02 at 7:16 AM -0700, Will Leshner wrote:

You probably should make a super class that returns NIL for NewObject. That way if somebody forgets to override they will find out pretty quickly.

<RB-newbie/OO-novice>
Would it not be better form to throw and exception in this case, instead of returning nil? In my mind, there is a subtly different, but important, distinction between the two.
</>

Or, perhaps better yet, is there an RB equivalent of "pure virtual"?


You can fake it by defining the "virtual" method in the abstract class to raise an exception.


Charles Yeomans




<Prev in Thread] Current Thread [Next in Thread>