home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / oop / misc / 84 < prev    next >
Encoding:
Text File  |  1992-12-14  |  2.6 KB  |  65 lines

  1. Path: 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
  2. From: sold@kit.uni-kl.de (Christoph Sold)
  3. Newsgroups: comp.sys.mac.oop.misc
  4. Subject: Re: The Member Function: Spawn Of Satan?
  5. Message-ID: <sold.118.724363763@kit.uni-kl.de>
  6. Date: 14 Dec 92 20:09:23 GMT
  7. References: <1992Dec13.144549.24447@reed.edu>
  8. Sender: news@rhrk.uni-kl.de
  9. Organization: Universitaet Kaiserslautern
  10. Lines: 53
  11.  
  12. In article <1992Dec13.144549.24447@reed.edu> orpheus@reed.edu (P. Hawthorne) writes:
  13. >From: orpheus@reed.edu (P. Hawthorne)
  14. >Subject: The Member Function: Spawn Of Satan?
  15. >Date: 13 Dec 92 14:45:49 GMT
  16. >In Object C and Pascal, the member function reveals whether a given object
  17. >is descended from a given class. I wonder if it is good or bad to use it.
  18. >It seems un-structured. What would Djikstra say?
  19. >
  20. >When I use it, I invariably feel guilty. I worry that perhaps a seriously
  21. >abstract class variable could formalize whatever notions are at work. Or I
  22. >think that it is a kludge so that I can put off a total overhaul until I
  23. >figure out how to work in the exceptional classes. That sort of thing.
  24. >
  25. >So then, am I just an OO-prude?
  26. >
  27. >Dumbfounded,
  28. >Theus (orpheus@reed.edu)
  29.  
  30.  
  31. As of today, I#ve found a very nice way to use the member() function. Say, 
  32. we want something to do at the idle time -- update a clock on-screen, do 
  33. some measuring from an external DVM, something the like. It turns out the 
  34. clock never needs to be configured, while the external device needs this 
  35. option (since there is more than one kind of external device You can connect 
  36. to). Of course, the solution is a class
  37.  
  38. class TIdlingObject{}
  39.  
  40. which does all the idling behavior, such as scheduling idlers, executing 
  41. them, and the like.
  42.  
  43. derived from this one are various subclasses -- say, TEditableIdlingObject 
  44. and TFacelessIdlingObject.
  45.  
  46. The tricky part comes when You want the user to access instances of idling 
  47. objects. You can easily build a list of TIdlingObjects, but the only way to 
  48. exclude the TFacelessIdlingObjects from the list will be to call the member 
  49. function -- which tells You if the object You look at is an 
  50. TEditableIdlingObject.
  51.  
  52. So, leave the theroy aside and use it -- it's really useful.
  53.  
  54. -Christoph
  55.  
  56. P.S: Sorry about all that MacAppish names, but I'm used to...
  57.  
  58. ---------------------------------------------------------------------------
  59. Christoph P. Sold                   CATS Software GmbH
  60.                                     Mussbacher Landstr.2
  61. sold@kit.uni-kl.de                  W-6730 Neustadt (Weinstrasse)
  62. ger.xse0035@applelink.apple.com     Germany
  63.  
  64. "If an apple is fun, what the heck is an appletree?"
  65.