home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / object / 4696 < prev    next >
Encoding:
Internet Message Format  |  1993-01-02  |  6.3 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: <11537@uqcspe.cs.uq.oz.au>
  6. Date: 3 Jan 93 01:36: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>     <11534@uqcspe.cs.uq.oz.au> <PCG.93Jan2211415@decb.aber.ac.uk>
  8. Sender: news@cs.uq.oz.au
  9. Reply-To: king@cs.uq.oz.au
  10. Lines: 120
  11.  
  12. [I won't speculate further on Booch's intentions for not elaborating
  13. on the distinction between classes and types.  I don't think ridicule
  14. or support for his actions based on speculation really gets us anywhere.
  15. The important thing is to clarify our thoughts.]
  16.  
  17. In <PCG.93Jan2211415@decb.aber.ac.uk> pcg@aber.ac.uk (Piercarlo Grandi) writes:
  18.  
  19. pcg>On 1 Jan 93 21:56:57 GMT, king@cs.uq.oz.au (Paul King) said:
  20.  
  21. king> I do not believe there is a lot to be gained by placing too much
  22. king> emphasis on the difference between type and class (and I have read
  23. king> numerous articles on this topic - all of which still leave me
  24. king> unconvinced).
  25.  
  26. pcg> Well, I can try again; distinguishing between a denotation and its
  27. pcg> representation in a computer is vital in two respects ...
  28.  
  29. I agree with most of the arguments you give for distinguishing
  30. between class and type, but the same arguments support not emphasising
  31. the difference and instead using (and identifying) different levels of
  32. abstraction.  Also, we seem to have a slightly different vocabularies
  33. due to our no-doubt different backgrounds.
  34.  
  35. I will try to present your views in my vocab to make sure I really
  36. understand them (correct me if I am wrong) and then discuss how my views
  37. differ from yours.  Neither is fundamentally wrong.
  38.  
  39. You advocate that when analysing classes (or programs) I should keep
  40. in mind two different domains.  One is at the level of representation;
  41. the other is at some higher abstract level.  In effect I must second
  42. guess what the programmer really had in mind when s/he designed the
  43. class.  I should call my guess its type to distinguish it from its class
  44. (representation).  I also need to keep in mind the consequences of
  45. mapping from the abstract to the representation domains.
  46.  
  47. I advocate that when analysing classes you should be told up front
  48. what level to think at and be given the appropriate level(s).  If you are
  49. given just the implementation language version, you should think only
  50. at that level (you might have a reasonable idea of what the high level
  51. idea originally was, but you should not rely on any assumptions - our
  52. misunderstandings are no doubt in part because we have both *assumed*
  53. that we have exactly the same vocab).  The type of an object then
  54. is the behaviour of (representation) values it can take on.  The class
  55. is one way of defining these values.  Ideally, I would also be given
  56. the high level specification (which would allow me to consider
  57. alternative implementations) and the mapping between the two levels
  58. (preferably also in a formal notation).  [I agree with you that this
  59. is a long way from where the market is today]
  60.  
  61. pcg> For example it is vital to know that in C the 'mode' unsigned does not
  62. pcg> correspond to the 'type' Naturals, and not even to the subset of
  63. pcg> Naturals up to 2^N-1, but to the type 'Naturals mod 2^N'.
  64.  
  65. Using my proposed ideal methodology, I would need to look at the
  66. operations available at both levels before I could determine whether
  67. modulo effects needed to be taken in to account.  If there was no operation
  68. which would dec/increment with wrap-around, then a mapping would not
  69. necessarily have to deal with modulo effects.
  70.  
  71. king> I do however think it is useful to distinguish the
  72. king> level of abstraction one is working at when you use the terms.
  73.  
  74. pcg>Nitpicking: It is not really the level of abstraction, it is the
  75. pcg>*domain*; in each domain (denotations, representations) one can have
  76. pcg>several levels of abstraction, which need not even be linked one-to-one.
  77.  
  78. I don't think you are nitpicking, just pointing out our slightly
  79. different vocabs.
  80.  
  81. king> I prefer to use simple definitions (and qualify when necessary): a
  82. king> type is a set of values
  83.  
  84. pcg> Ahi, ahi, here you lose the 64k prize! A type is *not* a set of values,
  85. pcg> despite what poorly edited articles like Cardelli&Wegner's report. The
  86. pcg> operations one can do on a type are not limited to set operations. Also,
  87. pcg> two very different types can be about same set of values (e.g. subset of
  88. pcg> naturals from 0 to 2^N-1 and naturals modulo 2^n).
  89.  
  90. Ok, I wasn't being as clear as I could.  A type is a set of
  91. behaviour values.  I agree that state values are insufficient.
  92.  
  93. king> a class is one language construct that can be used to define a
  94. king> type (and in some languages the only construct)
  95.  
  96. pcg> Ahi, ahi, I am in nitpicking mode here! A class defines the
  97. pcg> *representation* of a type, not the type; types are usually defined in
  98. pcg> appropriate notations. See, it's easy to slip even for you, and even if
  99. pcg> you obviously know this well:
  100.  
  101. You are not nitpicking.  You are just pointing out that we have different
  102. definitions of class.  You say a class defines the representation of
  103. a type.  I say it defines the type (at the current domain of thinking).
  104.  
  105. pcg>It gets all too easy to mix things in a confusing way; even a lot of the
  106. pcg>published literature is confused in exactly that way. I'd rather be
  107. pcg>extra fussy than extra sloppy:
  108.  
  109. I agree.  I am all for formalism.  Natural language is vital but
  110. can lead to confusion.  I was confused with your definitions and
  111. you with mine.
  112.  
  113. king> For objects, it doesn't usually matter whether you refer to their
  114. king> type or their class.  And if the class mechanism is the only way
  115. king> to define types, I would go so far as to say that the words type
  116. king> and class are interchangeable.
  117.  
  118. pcg> This is an extremely dangerous attitude; for example it makes a lot less
  119. pcg> obvious that a type/algebraic structure can be represented by many
  120. pcg> different but in that sense equivalent classes.
  121.  
  122. Yes, if I am not given the high level representation, I am missing
  123. vital information which is one of the problems with many approaches.
  124. My guessing the type/algebraic structure is just as dangerous, however.
  125.  
  126. Paul.
  127. --
  128. Paul King                                   _-_|\
  129. Dept. of Computer Science, Univ. of Queensland                  /     X
  130. Queensland, Australia, 4072                          \.--._/
  131. king@cs.uq.oz.au (ACSNET)                               v
  132.