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: Will Leshner <leshner at ljug dot com>
Date: Thu, 22 Aug 2002 08:50:50 -0700
Yes. That is even better. I actually thought of that later but I was on my way to work :)

What would be really really cool was if RB had abstract virtual functions. Then the compiler would tell you that the method hadn't been overridden.

On Thursday, August 22, 2002, at 07:38 AM, Joseph J. Strout wrote:

Requiring an override of NewObject is very elegant and is exactly the way you should do things. Especially it is very inelegant to have a super class know about its subclasses. Otherwise you'd have to change your super class every time you or somebody else creates a new subclass. 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.

Good idea -- even better would be for the superclass to post a message box that says "Hey, somebody forgot to override NewObject!"



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