home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / oop / misc / 144 < prev    next >
Encoding:
Text File  |  1992-12-29  |  8.0 KB  |  142 lines

  1. Newsgroups: comp.sys.mac.oop.misc
  2. Path: sparky!uunet!news.mentorg.com!scherzo!bcohen
  3. From: bcohen@scherzo.NoSubdomain.NoDomain (Bruce Cohen)
  4. Subject: Re: Learning App Frameworks (was Re: THINK Class Library learning..)
  5. Sender: news@news.mentorg.com (News User)
  6. Message-ID: <1992Dec29.213057.14290@news.mentorg.com>
  7. Date: Tue, 29 Dec 1992 21:30:57 GMT
  8. References: <1992Dec1.220344.234@physc1.byu.edu> <1992Dec3.064131.23364@reed.edu> <Dec.3.13.57.31.1992.18090@gandalf.rutgers.edu> <1992Dec4.081456.13906@reed.edu>
  9. Nntp-Posting-Host: scherzo.mentorg.com
  10. Organization: Mentor Graphics Corporation
  11. Keywords: 
  12. Followup-To: 
  13. Lines: 127
  14.  
  15. Damn! He hit one of my hot buttons!
  16. In article <1992Dec4.081456.13906@reed.edu>, orpheus@reed.edu (P. Hawthorne) writes:
  17. |> ...
  18. |> I feel that the programming language alone cannot make a framework
  19. |> understandable any more than you can pick your friends out of a
  20. |> metropolitan phone book. It can help make the code clear, but the framework
  21. |> is not the code that it is composed of. The framework is also knowing the
  22. |> mechanisms used and how to insert code into the works to get the job done
  23. |> in less time with less effort.
  24.  
  25. In fact, you can (or at least should be able to) understand a framework
  26. without knowing the details of the implementation, or even the syntax of
  27. the implementing language.  A framework is an organization of parts and
  28. a description of how they work together; in other words, it's a design
  29. entity, not an implementation entity.  Note that I can read a Structured
  30. Design description of a system without even knowing what language is
  31. used to code it; understanding a framework should be the same.
  32.  
  33. |> The language can obviously be used to reveal points of interest to the
  34. |> programmer. Mechanisms such as scheduling, event passing, dialog handling,
  35. |> and this sort of thing should include plenty of calls to methods that the
  36. |> programmer can simply override in the subclasses. Like, when the focus of a
  37. |> dialog switches from one doohickey to another, there should be calls
  38. |> before, between and after the focus is changed. In this way, the service
  39. |> panels can be clearly marked, so to speak.
  40.  
  41. Here I think you're mostly talking about interface rather than
  42. implementation; knowing what function is called to produce some effect
  43. is not the same as knowing how it does the job.  In many situations all
  44. you really *need* (as opoposed to what you might want to have) to write
  45. an overriding method in a subclass is the signature of the method and
  46. a set of assertions which describe the pre- and post-conditions for the
  47. method.  Sure it's easier if you have some code to look at and maybe
  48. reuse, but you could do without that.
  49.  
  50. |> Still, you should be able to look at the framework from much higher up than
  51. |> the class and the method. In the framework I am working on, a programmer
  52. |> can tell the framework that when class A asks for an instance of class B,
  53. |> that it should instead return an instance of class C. The intent of this
  54. |> was to make it so that the programmer could replace, say, the document
  55. |> class without even knowing that class A even exists.
  56.  
  57. Yes, this is the buddha-nature of frameworks :-).
  58.  
  59. |> 
  60. |> Measures like that, though, would in vain if the documentation didn't
  61. |> describe the highest order mechanisms of the framework. One of many
  62. |> examples is that there should be ample discussion of how a window, the
  63. |> document and the contents of the document can share in the interaction with
  64. |> the user. It is at this level of abstraction that the elegance of a
  65. |> framework can be honestly appreciated. Somehow the developers manage to
  66. |> keep from bragging about it!
  67.  
  68. Unfortunately, sometimes they don't have a lot to brag about :-(.  I do
  69. wish that documentation wasn't a swear word to so many software people.
  70. There are some examples of doing it right: the overview documentation
  71. for InterViews for instance.  That's worth reading even if you don't
  72. want to work with user interface software and don't write C++ code
  73. because it shows the benefits of describing how the system fits
  74. together.
  75.  
  76. I think the practice of not documenting framworks properly comes from a
  77. general lack of understanding of what a framework is, even among people
  78. who implement them.  In the last decade or so, software designers have
  79. gotten used to building large subsystems with narrow interfaces, most of
  80. whose details are (rightfully) hidden from the user, and so are not
  81. documented.  A framework is a new sort of animal, a design and a
  82. skeleton implementation of that design which is *intended* to be reused
  83. by others who were not privy to the original implementation.  This
  84. requires that the user be at least as knowledgable about the internals
  85. of design, if not the implementation, as a maintainer would be.  And
  86. we're typically not very good about giving maintainers adequate
  87. documentation.
  88.  
  89. |> ...
  90. |> I love the browser concept. It's a shame that, at least in my development
  91. |> environment, I cannot browse through anything but the class hierarchy.
  92. |> Wouldn't it be nice to be able to browse through the things I have been
  93. |> calling mechanisms? Imagine browsing through a little graphical
  94. |> representation of how objects send messages to their instance variable
  95. |> acquaintances as they go through the paces of scrolling or something like
  96. |> that. You wouldn't need to see distracting details, only those variables
  97. |> containing the objects and the methods that are invoked. I wouldn't even
  98. |> mind defining these browser packets within the code. The clarity of vision
  99. |> and freedom from distraction would be worth plenty of keyboarding.
  100. |> 
  101. |> I can always tell that I'm bashing my head against a wall whenever I begin
  102. |> to think of ways to better my development environment, however. Anything
  103. |> that would require changes to the language just isn't going to happen.
  104. |> Symantec is priming Bedrock to be the end all, be all of application
  105. |> frameworks. Why should they be concerned with these secondary issues when
  106. |> they've got their next masterpiece to fret over? Ultimately, I've just
  107. |> returned to the recurring theme that we are bombarded with specifics
  108. |> because our interfaces don't know jack about our goals in general.
  109.  
  110. Actually, I think that the new generation of integrated development
  111. environments based on databases (HP Softbench, CenterLine ObjectCenter,
  112. ParcPlace ObjectWorks, etc., etc.) has the power to provide what you
  113. want; though you might have to write your own user interface, at least
  114. you won't have to rewrite the compiler or the database manager.  The
  115. trick is add some additional information (perhaps using a front-end
  116. preprocessor to the compiler or whatever the language uses) which
  117. describes the relationships you are interested in (the "isA" and "contains"
  118. relationships are already handled by most languages).  For instance, if
  119. I have a framework for graphic layout, I might want to annotate objects
  120. which are in the "constrains translation" relation to other objects.
  121.  
  122. My own frustration comes from not having tools which help me design the
  123. frameworks in the first place.  Obviously (to me, anyway), Structured
  124. Design and it's sisters and cousins and aunts just don't help with
  125. this sort of problem, and CRC, while useful and fun, doesn't scale the
  126. way I would like it to, nor does it deal well with the idea of a
  127. framework as a template for a design rather than a complete design in
  128. itself, something I think is needed for high reuse frameworks.
  129.  
  130. |> ....
  131. |> I've been told that Ralph Johnson expounded on the subject in the OOPSLA
  132. |> '92 proceedings. I'll have to check that out. Thanks for the pointer, Dan.
  133.  
  134. Definitely, read Ralph's paper.  He talks about documenting frameworks
  135. by describing patterns formed by the relationships and interworking of
  136. parts of the framework.  I'm hoping that extensions of this idea can
  137. result in pattern languages for both initial design and documentation.
  138. ------------------------------------------------------------------------
  139. Bruce Cohen, Mentor Graphics Corpooration | email: Bruce_Cohen@mentorg.com
  140. 8005 SW Boeckman Road                     | phone: (503)685-1808
  141. Wilsonville, OR 97070-7777                |
  142.