Article View: comp.sys.mac.oop.misc
Article #54Re: The Member Function: Spawn Of Satan?
From: Christoph Sold
Date: Mon, 14 Dec 1992 20:09
Date: Mon, 14 Dec 1992 20:09
53 lines
2740 bytes
2740 bytes
In article <1992Dec13.144549.24447@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
>From: orpheus@reed.edu (P. Hawthorne)
>Subject: The Member Function: Spawn Of Satan?
>Date: 13 Dec 92 14:45:49 GMT
>In Object C and Pascal, the member function reveals whether a given object
>is descended from a given class. I wonder if it is good or bad to use it.
>It seems un-structured. What would Djikstra say?
>
>When I use it, I invariably feel guilty. I worry that perhaps a seriously
>abstract class variable could formalize whatever notions are at work. Or I
>think that it is a kludge so that I can put off a total overhaul until I
>figure out how to work in the exceptional classes. That sort of thing.
>
>So then, am I just an OO-prude?
>
>Dumbfounded,
>Theus (orpheus@reed.edu)
As of today, I#ve found a very nice way to use the member() function. Say,
we want something to do at the idle time -- update a clock on-screen, do
some measuring from an external DVM, something the like. It turns out the
clock never needs to be configured, while the external device needs this
option (since there is more than one kind of external device You can connect
to). Of course, the solution is a class
class TIdlingObject{}
which does all the idling behavior, such as scheduling idlers, executing
them, and the like.
derived from this one are various subclasses -- say, TEditableIdlingObject
and TFacelessIdlingObject.
The tricky part comes when You want the user to access instances of idling
objects. You can easily build a list of TIdlingObjects, but the only way to
exclude the TFacelessIdlingObjects from the list will be to call the member
function -- which tells You if the object You look at is an
TEditableIdlingObject.
So, leave the theroy aside and use it -- it's really useful.
-Christoph
P.S: Sorry about all that MacAppish names, but I'm used to...
---------------------------------------------------------------------------
Christoph P. Sold CATS Software GmbH
Mussbacher Landstr.2
sold@kit.uni-kl.de W-6730 Neustadt (Weinstrasse)
ger.xse0035@applelink.apple.com Germany
"If an apple is fun, what the heck is an appletree?"
Technical Details
Message-ID:
<sold.118.724363763@kit.uni-kl.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!yale.edu!ira.uka.de!rz.uni-karlsruhe.de!stepsun.uni-kl.de!oinone.kit.uni-kl.de!soldReferences:
<1992Dec13.144549.24447@reed.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!yale.edu!ira.uka.de!rz.uni-karlsruhe.de!stepsun.uni-kl.de!oinone.kit.uni-kl.de!sold From: sold@kit.uni-kl.de (Christoph Sold) Newsgroups: comp.sys.mac.oop.misc Subject: Re: The Member Function: Spawn Of Satan? Message-ID: <sold.118.724363763@kit.uni-kl.de> Date: 14 Dec 92 20:09:23 GMT References: <1992Dec13.144549.24447@reed.edu> Sender: news@rhrk.uni-kl.de Organization: Universitaet Kaiserslautern Lines: 53