home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / object / 4688 < prev    next >
Encoding:
Internet Message Format  |  1993-01-01  |  3.6 KB

  1. Path: sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!uqcspe!cs.uq.oz.au!king
  2. From: king@cs.uq.oz.au (Paul King)
  3. Newsgroups: comp.object
  4. Subject: Re: A Pre-Release FAQ
  5. Message-ID: <11534@uqcspe.cs.uq.oz.au>
  6. Date: 1 Jan 93 21:56:57 GMT
  7. References: <1992Dec29.042355.10967@netcom.com> <PCG.92Dec29203617@decb.aber.ac.uk>     <37B01UW@minnie.zdv.uni-mainz.de> <PCG.93Jan1185311@decb.aber.ac.uk>
  8. Sender: news@cs.uq.oz.au
  9. Reply-To: king@cs.uq.oz.au
  10. Lines: 68
  11.  
  12. In <PCG.93Jan1185311@decb.aber.ac.uk> pcg@aber.ac.uk (Piercarlo Grandi) writes:
  13.  
  14. [Booch quote about difference between class and type ...]
  15.  
  16. >Here I disagree vehemently with Booch. The result of his attitude ("I
  17. >know that the difference is important, but you cannot grasp it") is that
  18. >people like Hathaway get utterly confused terminology ...
  19. > ... Indeed such terms are so overloaded with different meanings and
  20. >therefore so ambiguous that they should always be qualified; ideally
  21. >there should be different word.
  22.  
  23. I did not find Booch's treatment of this subject that bad.
  24. I do not believe there is a lot to be gained by placing too much
  25. emphasis on the difference between type and class (and I have read
  26. numerous articles on this topic - all of which still leave me
  27. unconvinced).  I do however think it is useful to distinguish the
  28. level of abstraction one is working at when you use the terms.
  29. I prefer to use simple definitions (and qualify when necessary):
  30.     a type is a set of values
  31.     a class is one language construct that can be used to define
  32.         a type (and in some languages the only construct)
  33.  
  34. If you need to make the distinction between an implementation type
  35. and an abstract type, then qualify as in this sentence.
  36. You can use classes from the implementation language to define
  37. the implementation type, and use classes from your favourite OO
  38. specification to define the abstract type.  I prefer to qualify in this
  39. way rather than invent new words as it allows me to use many levels
  40. of abstraction, rather than just implementation and specification
  41. (referred to as the abstract level above).  So, I might have
  42. types at the informal user-requirements level, the high-level
  43. design level, the low-level design level and the implementation level.
  44. I may use classes to define these types at the last three of these
  45. and possibly the first if I have some informal requirements notation.
  46.  
  47. If the level of abstraction is clear from the context then you
  48. can just refer to types and classes without qualification.
  49. (I believe this is Booch's point - most often the level of abstraction
  50. is clear from the context - though he didn't elaborate specifically).
  51. For objects, it doesn't usually matter whether you refer to their type
  52. or their class.  And if the class mechanism is the only way to define
  53. types, I would go so far as to say that the words type and class
  54. are interchangeable.
  55.  
  56. >So for example
  57. >
  58. >    struct complex { float re,im; complex(...) .... ; };
  59. >    complex i(0,1);
  60. >
  61. >would declare a mode complex and 'i' would be a variable initially
  62. >denoting a value that represents the imaginary unity of the Complex type.
  63.  
  64. I would use type or class to refer to `complex' whichever seemed
  65. appropriate.  If you really need to distinguish between the complex
  66. type that is representable using two non-infinite floats
  67. and the mathematical counterpart using infinite reals then refer
  68. to the latter as an abstract type (or preferably specify what you
  69. mean in a specification language and then refer to its
  70. specification or high-level design type).
  71.  
  72. Just my opinions,
  73.  
  74. Paul.
  75. --
  76. Paul King                                   _-_|\
  77. Dept. of Computer Science, Univ. of Queensland                  /     X
  78. Queensland, Australia, 4072                          \.--._/
  79. king@cs.uq.oz.au (ACSNET)                               v
  80.