home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / opendc12.zip / SG244883.ZIP / 2_9.2 < prev    next >
Text File  |  2001-01-27  |  9KB  |  180 lines

  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
  2. <HTML>
  3. <HEAD>
  4. <base href="http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/BOOKS/EZ30OZ00/2.9.2">
  5. <title>
  6. 2.9.2 "OS/2 WARP and OpenDoc" 
  7.   via IBM BookManager BookServer
  8. </title>
  9. </head>
  10. <body background="/bookmgr/backdrop.gif">
  11. <banner><br>
  12. <a href="../../library"><img src="/bookmgr/libicon2.gif" border=0 alt="[Library]"></a>
  13. <a  href="CONTENTS#2.9.2"><img src="/bookmgr/contents.gif" border=0 alt="[Contents]"></a>
  14. <img src="/bookmgr/drevs.gif" border=0 alt="[Revisions]">
  15. <a href="2.9.1"><img src="/bookmgr/prev.gif" border=0 alt="[Prev Topic]"></a>
  16. <a href="3.0"><img src="/bookmgr/next.gif" border=0 alt="[Next Topic]"></a>
  17. <a href="../../search?book=EZ30OZ00"><img src="/bookmgr/search.gif" border=0 alt="[Search]" ></a>
  18. <img src="/bookmgr/dslist.gif" border=0 alt="[Search Results]">
  19. <img src="/bookmgr/dsprev.gif" border=0 alt="[Prev Topic Match]">
  20. <img src="/bookmgr/dsnext.gif" border=0 alt="[Next Topic Match]">
  21. <img src="/bookmgr/dnotes.gif" border=0 alt="[Notes]">
  22. <img src="/bookmgr/dlnotes.gif" border=0 alt="[List Notes]">
  23. <a  href="../../print?book=EZ30OZ00"><img src="/bookmgr/print.gif" border=0 alt="[Print]"></a>
  24. <a href="../../download/EZ30OZ00.boo"><img src="/bookmgr/download.gif" border=0 alt="[Download]" ></a>
  25. <a  href="../../help/book"><img src="/bookmgr/help.gif" border=0 alt="[Help]"></a>
  26. <hr>
  27. <a name="HDR4610DCD"><H4> 2.9.2   Compound Document Framework</H4></a>
  28. </banner>
  29. <pre width="80">
  30.    In the next release of IBM Open Class library there is to be a high-level 
  31.    framework delivered using the programming model developed by Taligent.  A 
  32.    framework is much more than a class library.  While a class library is a 
  33.    collection of related classes, a framework is a class library that also 
  34.    embraces design knowledge and provides a running subsystem for a special 
  35.    problem domain.  This problem domain may be business related as in 
  36.    accounting, or may be an infrastructure domain, as in compound documents 
  37.    or communication. 
  38. <p>
  39.    The programming paradigm is changing with this new technology as shown in 
  40.    <a href="#FIG4610D17">Figure 55</a>.  The evolution started with the introduction of graphical user 
  41.    interfaces in the 80s.  Before the graphical user interfaces, applications 
  42.    were totally in control of the application flow.  Reusable code was put in 
  43.    procedural libraries and called by the application. 
  44. <p>
  45.    With the introduction of graphical user interfaces like Mac, OS/2 PM or 
  46.    Windows, the user started to have the control over the program flow by 
  47.    having multiple ways to interact with the applications. The programs 
  48.    consist of an event loop waiting for user interactions. 
  49. <p>
  50. <a name="FIG4610D17"><hr>
  51.  </a>
  52. <p>
  53. <p>
  54.                                    <a href="picture-53?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P53.GIF" alt="PICTURE 53"></a>           
  55. <p>
  56. <p>
  57. <hr>
  58.  
  59.    Figure 55. Evolution Towards Frameworks 
  60. <p>
  61.    <cite>An</cite> <cite>abstract</cite> <cite>class</cite> <cite>is</cite> <cite>a</cite> <cite>design</cite> <cite>for</cite> <cite>a</cite> <cite>single</cite> <cite>object.</cite> <cite>A</cite> <cite>framework</cite> <cite>is</cite> <cite>the</cite> 
  62.    <cite>design</cite> <cite>of</cite> <cite>a</cite> <cite>set</cite> <cite>of</cite> <cite>objects</cite> <cite>that</cite> <cite>collaborate</cite> <cite>to</cite> <cite>carry</cite> <cite>out</cite> <cite>a</cite> <cite>set</cite> <cite>of</cite> 
  63.    <cite>responsibilities.</cite> <cite>Thus</cite> <cite>frameworks</cite> <cite>are</cite> <cite>larger</cite> <cite>scale</cite> <cite>designs</cite> <cite>than</cite> <cite>abstract</cite> 
  64.    <cite>classes.</cite> <cite>Frameworks</cite> <cite>are</cite> <cite>a</cite> <cite>way</cite> <cite>to</cite> <cite>reuse</cite> <cite>high-level</cite> <cite>design.</cite> Ralph Johnson, 
  65.    Vincent Russo 
  66. <p>
  67.    With a framework, a developer is no longer writing a program that is in 
  68.    control of the application.  The framework is the application, which is 
  69.    customized by the developer writing small puzzle pieces of code where he 
  70.    wants to modify the default behavior of the system.  It is sometimes 
  71.    called the Hollywood Principle: <I>Don't</I> <I>call</I> <I>us,</I> <I>we</I> <I>will</I> <I>call</I> <I>you.</I> 
  72.    Frameworks can be specialized and modified by subclassing.  A framework 
  73.    has the following two interfaces as shown in<a href="#FIG4610D18"> Figure 56</a>: 
  74. <p>
  75.    ░   A using interface, which is small and simple to use 
  76. <p>
  77.    ░   A subclassing interface used to customize the behavior of the 
  78.        framework 
  79. <p>
  80. <p>
  81. <a name="FIG4610D18"><hr>
  82.  </a>
  83. <p>
  84. <p>
  85.                                    <a href="picture-54?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P54.GIF" alt="PICTURE 54"></a>           
  86. <p>
  87. <p>
  88. <hr>
  89.  
  90.    Figure 56. Frameworks 
  91. <p>
  92.    The Workplace Shell is an example of an implemented framework.  The 
  93.    Workplace Shell controls and owns the process.  Other Workplace 
  94.    Shell-based classes written by third parties using WPS objects and classes 
  95.    can be registered and plugged in during run time, inheriting all the 
  96.    functions provided by this framework. 
  97. <p>
  98.    The Compound Document Framework is based on four base classes, a model 
  99.    class, a view class, selection class  and a command class as shown in 
  100.    <a href="#FIG4610D19">Figure 57</a>.  These four classes have to be modified to create a component 
  101.    either for OLE or OpenDoc with this framework.  All the other functions 
  102.    such as embedding, linking, drag and drop, undo, scriptability, and 
  103.    interoperability are provided by the framework.  The model class is used 
  104.    to define the content of a component the data part. View classes are used 
  105.    to define the user interface.  The views are separated from the model very 
  106.    strictly.  There may be several views used in parallel by different 
  107.    applications as shown in <a href="#FIG4610D38">Figure 58</a>.  The Invoice, Accounts receivable and 
  108.    Rolodex application are using different views on the same model Account 
  109.    Info.  Account Info has the following three attributes in this example: 
  110. <p>
  111.    ░   Name/Address 
  112. <p>
  113.    ░   Phone No. 
  114. <p>
  115.    ░   Credit Info 
  116. <p>
  117. <p>
  118.    If the model, for example the address, changes, all views on this model 
  119.    are notified by the framework, so they can update themselves.  The 
  120.    presenter class handles all user interactions. 
  121. <p>
  122. <a name="FIG4610D19"><hr>
  123.  </a>
  124. <p>
  125. <p>
  126.                                    <a href="picture-55?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P55.GIF" alt="PICTURE 55"></a>           
  127. <p>
  128. <p>
  129. <hr>
  130.  
  131.    Figure 57. Compound Document Framework 
  132. <p>
  133.    With a view, the user can also make a selection, which specifies a certain 
  134.    range of the model data, for example the address.  A selection is very 
  135.    independent from the way it is created. It may be defined by a mouse, 
  136.    keyboard actions, a menu item or a script.  These selections can be used 
  137.    to manipulate the model data.  A selection is associated with a set of 
  138.    commands specified for this selection to manipulate the specified data. 
  139.    Commands can also be launched in very different ways.  It may be done by a 
  140.    menu action, a command line, a mouse event or a script. 
  141. <p>
  142. <a name="FIG4610D38"><hr>
  143.  </a>
  144. <p>
  145. <p>
  146.                                    <a href="picture-56?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P56.GIF" alt="PICTURE 56"></a>           
  147. <p>
  148. <p>
  149. <hr>
  150.  
  151.    Figure 58. Compound Document Framework 
  152. <p>
  153.    But commands are always acting on selections and never directly on the 
  154.    model data.  The actions performed as command - selection pairs are stored 
  155.    in a history log, thus providing a multi-level undo, implemented by the 
  156.    framework. Because these command - selection classes are independent from 
  157.    the way they were created,  the parts get scriptability for free, as shown 
  158.    in <a href="#FIG4610D37">Figure 59</a>.  The Compound Document Framework, first delivered with 
  159.    Visual Age C++ for Windows  and later with the next release for OS/2, can 
  160.    generate OpenDoc components as well as OLE components. 
  161. <p>
  162. <a name="FIG4610D37"><hr>
  163.  </a>
  164. <p>
  165. <p>
  166.                                    <a href="picture-57?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P57.GIF" alt="PICTURE 57"></a>           
  167. <p>
  168. <p>
  169. <hr>
  170.  
  171.    Figure 59. Compound Document Framework 
  172. </pre>
  173. </pre>
  174. <hr>
  175. <br><a href="2.9.1"><img src="/bookmgr/prev.gif" border=0 alt="[Prev Topic]"></a>
  176. <a href="3.0"><img src="/bookmgr/next.gif" border=0 alt="[Next Topic]"></a>
  177. <cite>  ⌐ Copyright IBM Corp. 1996</cite>
  178. <HR><p><h6><a href="/cgi-bin/bookmgr/library">IBM BookManager« BookServer</a> Copyright 1989, 1999<a href="http://www.ibm.com/"> IBM</a> Corporation.  All rights reserved.</h6><p>
  179. </BODY></HTML>
  180.