home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / object / 3186 < prev    next >
Encoding:
Text File  |  1992-08-12  |  9.8 KB  |  209 lines

  1. Newsgroups: comp.object
  2. Path: sparky!uunet!projtech!steve
  3. From: steve@projtech.com (Steve Mellor)
  4. Subject: Re: Class methods (was: Re: How to design a data structure library)
  5. Message-ID: <1992Aug12.213214.21417@projtech.com>
  6. Organization: Project Technology, Inc., Berkeley, CA
  7. References: <GEOFF.92Jul27100601@wodehouse.flash.bellcore.com> <1992Aug10.232507.13304@projtech.com> <1992Aug11.180111.4658@mole-end.matawan.nj.us>
  8. Date: Wed, 12 Aug 1992 21:32:14 GMT
  9. Lines: 198
  10.  
  11. > > ...
  12. > > At design time, we should address *only* these issues by building a
  13. > > transformation engine for an arbitrary analysis with the same performance
  14. > > characteristics as the problem we are trying to solve (Man, Woman, etc)
  15. >
  16. > This is a dangerous statement.  It's true (for example) that circuit
  17. > analysis and design techniques can be turned into `turn the crank'
  18. > sequences of steps on the DC and AC circuit models.  Doing so throws
  19. > away insight on the behavior of the circuit in the real world--because
  20. > it throws away the knowledge of the real world!
  21.  
  22. Damn right it's a dangerous statement!  It's dangerous because it
  23. messes  with  your mind by overturning **all** of the assumptions
  24. of Rumbaugh/Booch/Coad regarding the meaning of design.  And,  in
  25. fact,  asserts  a  completely  different  view  of  design  --  a
  26. transformational view.
  27.  
  28. So what *do* we (S/M) do, if we don't do what they do?
  29.  
  30. 1.  Partition the problem into domains
  31. 2.  Analyze the application ... in gory detail
  32. 3.  Extract requirements (new idea -- see below)
  33. 4.  Analyze other domains  (obvious)
  34. 5.  Architectural domain (see below)
  35. 6.  Build mechanisms and templates (see below)
  36. 7.  Populate templates  (see below)
  37.  
  38. Let's take an example.  Consider a Customer object and an Account
  39. object.  In the Account object, there is a reference to the iden-
  40. tifier of the Customer (in S/M OOA, a referential attribute).  It
  41. must be placed in the Account object because of the rules we use.
  42. (Let's not digress).  The objects are related so that a  Customer
  43. *must*  have  at least one account in order to be a Customer. The
  44. problem requires that a single statement (for  all  accounts)  be
  45. produced for each customer.
  46.  
  47. Now, Step 3 (Extract requirements) says, by  examination  of  the
  48. analysis models, "I see a 'pattern' whereby I  keep searching the
  49. accounts to find all the accounts  that  a  customer  owns."  The
  50. result  of this is a clear idea that we want to group all the ac-
  51. counts with a given customer.  (Note that an analysis model  that
  52. had  a 'pattern' that frequently interrogated the Account to find
  53. the Customer that owned it would lead to a different conclusion.)
  54. I  will  also note 'patterns' that come from OOA, such as sending
  55. an event.  The 'send an event' pattern will appear in  every  ob-
  56. ject  that has a state model, whereas the 'I search all the <x>'s
  57. to find the ones related to the <y>' will appear less frequently.
  58.  
  59. Step 5 says to understand the architecture.  Here, we  decide  --
  60. to  meet the requirements from step 3 -- that an o-o architecture
  61. using classes is a good idea, that we  need  a  Collection  class
  62. (for  all the accounts of a customer), that we shall use a single
  63. task, that events will  be  transmitted  using  a  function  call
  64. called  Take  Event  <ev#> that will be supplied for every class.
  65. OR, we could choose an architecture using,  say,  an  associative
  66. memory  for the accounts/customers, or using n tasks, or not even
  67. using o-o at all!
  68.  
  69. **The architecture is specified completely independently  of  the
  70. application** even though the choice of architecture is dependent
  71. on the performance characteristics of your application.
  72.  
  73. Step 6 says to build mechanisms and templates.   A  mechanism  is
  74. some  *application-independent*  component  required as a part of
  75. the engine for the OOA.  A Collection class, used to  maintain  a
  76. set  of  accounts,  and  a  Take  Event  function, all qualify as
  77. mechanisms.  A template (not the C++ kind) is a shell that  shows
  78. how  to  use  the mechanisms.  We would build a template for each
  79. OOA concept that has a analogue in the OOA engine.  For  example,
  80. a  class  that corresponds to an OOA object with a state machine,
  81. or a class that corresponds to an OOA object that we want to  im-
  82. plement  using a Collection.  A template will contain replacement
  83. signifiers, such as <ev #>, for example.  The <>'s  will  be  re-
  84. placed from the application analysis.
  85.  
  86. An example architecture, with a template, is shown in  Chapter  9
  87. of Object Lifecycles.
  88.  
  89. In step 7, we populate the templates by filling out the  <>  with
  90. the  stuff  from  the application.  So we'll replace each <ev #>,
  91. for example, with an event taken from the  analysis.   And  we'll
  92. use  the  'search  all  <x>'s'  template for all the objects that
  93. qualify.
  94.  
  95. ----------------
  96.  
  97. Stepping back for a minute, what we did was to figure out how  to
  98. elaborate  each  of  the objects in the analysis in order to make
  99. the system work.  But instead of adding this  to  *each*  of  the
  100. analysis  objects,  we wrote down the architecture independently,
  101. then we transformed the application into the design.  The concept
  102. is  similar to (a) We wrote a program in a language, (b) we wrote
  103. the compiler for the language (c) we applied the compiler to  the
  104. program.   The  language,  of course, is OOA.  (S/M OOA, that is.
  105. The others are not well enough defined to be able to  do  this!).
  106. Step  (a) corresponds to the application analysis. (b) to the ar-
  107. chitecture and the templates, and  (c)  to  populating  the  tem-
  108. plates.
  109.  
  110. The obvious and beautiful economy is that once you have the  com-
  111. piler  (architecture  and  templates), it is a low cost matter to
  112. recompile other programs, or to change the existing program  (the
  113. analysis).
  114.  
  115. The architecture I described will lead to a fairly  direct  tran-
  116. formation  of  the  application.  However, the architecture could
  117. lead to a *very* indirect transformation -- say, a  periodic  ar-
  118. chitecture for an embedded system.
  119.  
  120. Let's take another look at your comment...
  121.  
  122. > analysis and design techniques can be turned into `turn the crank'
  123. > sequences of steps on the DC and AC circuit models.  Doing so throws
  124. > away insight on the behavior of the circuit in the real world--because
  125. > it throws away the knowledge of the real world!
  126. >
  127. Yes, we did turn the crank.  But we did not throw away the infor-
  128. mation about the real world.  We kept it -- pure and unsullied --
  129. in our analysis models.
  130.  
  131. > If the `transformation techniques' apply only to the *artifacts* of the
  132. > analysis, and ignore the context of the system/problem analyzed, they
  133. > make it hard to follow the final causes in the design (they make it
  134. > hard to trace from a given piece of code back to the requirement or
  135. > world-feature it represents).  (This, by the way, is one of the dangers
  136. > I see in the large-scale `domain model' in the Schlaer-Mellor method.)
  137.  
  138. The 'final causes in the design' are documented in the  architec-
  139. ture  --  again  pure and unsullied.  Note that architectures are
  140. generally highly reusable.
  141.  
  142. Why, in heaven's name, would you want 'to trace a given piece  of
  143. code back to the requirement or world-feature it represents'? ;-)
  144. This would be like trying to trace  an  assembly  code  statement
  145. back  to  the  C++  whence  it  came (a useful activity only when
  146. you're checking the architecture -- whoops! I mean the compiler.)
  147.  
  148. Sorry, I got carried away...  Of course, what you're really  try-
  149. ing  to  do  is  to  change a *requirement*.  So let's do that by
  150. changing the analysis models, and then reapplying  the  architec-
  151. ture to the application analysis to build a new system.
  152.  
  153. (No, this is not fantasy, we have many systems that are partially
  154. or fully automated from the analysis models.)
  155.  
  156. Yes, tracing of the requirements is a danger in OOA/RD  *if*  you
  157. think  about the process in a non-transformational way.  That is,
  158. you say "Let me add in all this architectural stuff to  each  ob-
  159. ject  in the analysis, so that when I look at the code I can find
  160. the application requirement."  A  reasonable  thing  to  do,  but
  161. messy.   Note that this is precisely what Rumbaugh/Booch/Coad do,
  162. except that thay don't have a way to do it in a  uniform  manner.
  163. In  other  words, the *worst* case in OOA/RD is the *recommended*
  164. case for Rumbaugh, Booch, Coad et al, for they elaborate each ob-
  165. ject  in  the  analysis  to  produce  the  design.  In OOA/RD, we
  166. separate the architecture explicitly, and so can find a  require-
  167. ment in the analysis models.
  168.  
  169. ----------------
  170.  
  171. Implications
  172.  
  173. The implications of OOA/RD are quite exciting.
  174.  
  175. 1.  S/M OOA/RD reduces and controls iteration by confining it  to
  176. a  single domain at a time.  Modifications to the design are made
  177. entirely in the architectural domain and propagated to the entire
  178. system through templates.
  179.  
  180. 2.   S/M  OOA/RD  systematizes  and  supports  reuse  of  *entire
  181. domains* because the domains are kept separate until the very end
  182. of system construction. This is especially true for the architec-
  183. ture,  which  can  be reused for any system with the same perfor-
  184. mance and loading charcteristics.
  185.  
  186. 3.  The approach reduces maintenance costs.  Much maintenance in-
  187. volves  some modification of the analysis, (a problem of size m),
  188. and some modification of the architecture (of  size  n).   Today,
  189. this  is an m*n size problem, because the application is embedded
  190. in the architecture.  Using OOA/RD, it becomes a m+n  size  prob-
  191. lem, because the application and the architecture are separated.
  192.  
  193. 4.  The size of the design work  is  *not*  proportional  to  the
  194. analysis.
  195.  
  196. ------------
  197.  
  198. I have a paper available describing these seven  steps.   If  you
  199. want a copy, please mail me  (steve@projtech.com) with your name,
  200. postal address(not e-mail) and phone number.
  201.  
  202. Steve
  203.  
  204. -------------------------------------
  205. Steve Mellor            steve@projtech.com
  206. Project Technology      Training and Consulting using Shlaer-Mellor OOA/RD
  207. Berkeley, CA            Tel: (510) 845 1484
  208. --------------------------------------
  209.