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

  1. Path: sparky!uunet!pipex!bnr.co.uk!uknet!gdt!aber!fronta.aber.ac.uk!pcg
  2. From: pcg@aber.ac.uk (Piercarlo Grandi)
  3. Newsgroups: comp.object
  4. Subject: Re: Need basic OO information
  5. Message-ID: <PCG.93Jan2214017@decb.aber.ac.uk>
  6. Date: 2 Jan 93 21:40:17 GMT
  7. References: <1992Dec11.125457.36573@uservx.plk.af.mil> <1992Dec29.161034.13738@sierra.com>
  8. Sender: news@aber.ac.uk (USENET news service)
  9. Reply-To: pcg@aber.ac.uk (Piercarlo Grandi)
  10. Organization: Prifysgol Cymru, Aberystwyth
  11. Lines: 116
  12. In-Reply-To: dgeary@sierra.com's message of 29 Dec 92 16: 10:34 GMT
  13. Nntp-Posting-Host: decb.aber.ac.uk
  14.  
  15. On 29 Dec 92 16:10:34 GMT, dgeary@sierra.com (David Geary) said:
  16. Nntp-Posting-Host: grumpy
  17.  
  18. dgeary> tollefson@uservx.plk.af.mil writes:
  19.  
  20. tollefson> I'm looking for a good book (or E-mail replies) which can
  21. tollefson> help me to understand some basics:
  22.  
  23. tollefson> 1) What are the basic benefits?  (why use it over
  24. tollefson> traditional)
  25.  
  26. dgeary> When done correctly, OO makes the following *much* easier:
  27.  
  28. dgeary> 1.  Maintenance.  2.  Extensibility.  3.  Ability to change.
  29.  
  30. tollefson>      2) How does it work, very generally.
  31.  
  32. dgeary> *Very* generally, classes of objects which exhibit similar
  33. dgeary> behavior are developed in a hierarchy of classes.  Using
  34. dgeary> inheritance, specialized classes are derived from existing, more
  35. dgeary> generalized, classes.
  36.  
  37. This is not *very* general; it is actually very specific to a fairly
  38. common but by no means unique OO approaach.
  39.  
  40. Generally speaking, OO is about carving up large programming tasks in
  41. optimally defined modules, where "optimally" means "most reusable", and
  42. where one has a fairly effective principle on how to achieve this, which
  43. is to put in the same module everything that knows the details of the
  44. rpresentation of a class of values.
  45.  
  46. One way to express this in a language is to define as "class" the
  47. description of one such module that defines the representation of a
  48. class of like data, and to allow the programmer to mix and match classes
  49. to derive the descriptions of new representations.
  50.  
  51. dgeary> This is a very natural paradigm for us humans; grouping similar
  52. dgeary> classes of objects in hierarchies is something we do constantly
  53. dgeary> in everyday life.
  54.  
  55. Mistakenly IMNHO -- hierarchical taxonomies are never quite apropriate;
  56. they seem to apply most the time, but usually they can only be twisted
  57. with effort to work in the very common case where many-to-many
  58. relationships (between representations, as well as between values) need
  59. to be described.
  60.  
  61. tollefson> (the only examples I've seen have been complex theoretical
  62. tollefson> nightmares or simple contrived situations easily handled by
  63. tollefson> conventional code.)
  64.  
  65. Frankly, complex nightmare sar enot theoretical at all; most
  66. applications are unspeakably complex, if executed well. If not executed
  67. well, the user will constantly bump against the "simplifications". OO
  68. however helps anyhow; if you follow the OO principle on how to organize
  69. a program, it is relatively easier to add or remove or modify the modules.
  70.  
  71. tolleefson> 3) How do you tell when to use it and when to avoid it for
  72. tolleefson> specific programs?
  73.  
  74. Just about the only cases where the OO philosophy breaks down is when one
  75. needs to define operations that are intimately involved with the details
  76. of more than one representation, or, even worse, when representation
  77. details are not what binds together a module most tightly.
  78.  
  79. Both cases are very hard to handle anyhow, and I am not aware of any
  80. systematic way to attack them. In other words OO carries you as far as
  81. you can go. Where its principle fails, there is not much of a clue
  82. anyhow (well, I have a clue as to that, of course, even if very rough).
  83.  
  84. dgeary> OO is applicable across many different types of applications.
  85. dgeary> There is some performance penalty for using OO in some
  86. dgeary> situations; for speed critical apps this may be a problem.
  87.  
  88. Not really -- for example the speed penalty, if any, is usually about
  89. dynamic procedure calls, which are a nifty idea independently of OO.
  90. Most OO language implementations allow you to optimize it away though,
  91. in most of the case where it can be done.
  92.  
  93. tollefson> 4) Can old dogs learn new tricks?  (how hard is it for a
  94. tollefson> programmer to convert his thinking)
  95.  
  96. dgeary> I think it's a pretty natural thing to pick up.  Unfortunately,
  97. dgeary> a developer who is mired down in a procedural paradigm may have
  98. dgeary> a harder time making the switch to OO than someone who has never
  99. dgeary> written a line of code in their life.
  100.  
  101. Well, if s/he has been writing modules and has realized that the most
  102. maintainable way is to put in a module all the procedures that deal with
  103. the same sort of data representation, as is often the case, he has
  104. already got it. If not, getting into this new philosophy will be uplifting.
  105.  
  106. dgeary> I would recommend getting Smalltalk.  Smalltalk is a pure OO
  107. dgeary> language where one can really see the benefits of having an
  108. dgeary> existing hierarchy of very useful classes for building complex
  109. dgeary> applications in a short period of time.
  110.  
  111. I would have Objective C as another recommendetation for C-ish
  112. programmers.
  113.  
  114. tollefson> A description of a case where the programming became much
  115. tollefson> easier or the end product became much better would be very
  116. tollefson> helpful.  I'm not looking for source code, but some textual
  117. tollefson> information on how the new scheme helped.
  118.  
  119. Use a NeXT workstation anytime, and try to customize it; compare with
  120. the ease of customizing any other platform. Same goes for Smalltalk, and
  121. so on.
  122.  
  123. dgeary> There are quite a few good books that cover simplistic case
  124. dgeary> studies.  See the reading list that follows:
  125.  
  126. Not a bad list.
  127. --
  128. Piercarlo Grandi, Dept of CS, PC/UW@Aberystwyth <pcg@aber.ac.uk>
  129.   E l'italiano cantava, cantava. E le sue disperate invocazioni giunsero
  130.   alle orecchie del suo divino protettore, il dio della barzelletta
  131.