home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11477 < prev    next >
Encoding:
Internet Message Format  |  1992-07-24  |  1.9 KB

  1. Xref: sparky comp.lang.c++:11477 comp.std.c++:940
  2. Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!cherokee!io!glw
  3. From: glw@io.uswest.com (Glenn Williams)
  4. Newsgroups: comp.lang.c++,comp.std.c++
  5. Subject: Re: run-time type checking (was: Re: Covariant Types in Derived Classes)
  6. Message-ID: <1992Jul24.143359.3602@advtech.uswest.com>
  7. Date: 24 Jul 92 14:33:59 GMT
  8. References: <1992Jul21.162659.25474@ucc.su.OZ.AU> <1992Jul22.022218.1115@cadsun.corp.mot.com> <1992Jul23.154254.5306@ucc.su.OZ.AU>
  9. Sender: glw@io (Glenn Williams)
  10. Organization: US WEST Communications
  11. Lines: 49
  12. Nntp-Posting-Host: io.it.uswc.uswest.com
  13.  
  14. >(John MAX Skaller) writes:
  15. >
  16. >    Given the need to do downcasting, to do it safely run-time
  17. >type information is required. But I am arguing it is not necessary
  18. >to downcast. So the question of needing run-time type info to
  19. >do it doesn't arise.
  20. >
  21. >We design our systems properly in the first place, and then the need
  22. >to downcast never arises, when our thoughts wander in that 
  23. >direction one can be sure we are not thinking virtuously,
  24. >and perhaps the design itself is flawed.
  25. >
  26.  
  27. Ok, let's have an example of a properly designed system. 
  28.  
  29. >    Inother words, in a *domestic* system, any apparent 
  30. >need for downcasting should be used as an indicator of flawed design.
  31. >
  32.  
  33. What is the basis for your conclusions?
  34.  
  35. >class Animal {
  36. >    int mate(Animal&);
  37. >};
  38. >class Dog : Animal {
  39. >    int mate (Animal&);
  40. >};
  41.  
  42. >We REALLY want Dog::mate(Dog&), but we can't have it.
  43.  
  44. >This is a flaw in Object Oriented Programming IMHO.
  45. >The solution requires multimethods which are inherently
  46. >functional.
  47.  
  48. What?
  49.  
  50. You have stated all this before, and every time you do, you fail to provide
  51. any examples of how you would design without downcasting. 
  52.  
  53. So, as I asked for earlier, let's have an example of a properly
  54. designed system.
  55.  
  56.  
  57.  
  58. Glenn Williams
  59. US WEST
  60.  
  61.  
  62. "Y'er spookin' the cattle." - Curly
  63.