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 >
Wrap
Text File
|
2001-01-27
|
9KB
|
180 lines
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<base href="http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/BOOKS/EZ30OZ00/2.9.2">
<title>
2.9.2 "OS/2 WARP and OpenDoc"
via IBM BookManager BookServer
</title>
</head>
<body background="/bookmgr/backdrop.gif">
<banner><br>
<a href="../../library"><img src="/bookmgr/libicon2.gif" border=0 alt="[Library]"></a>
<a href="CONTENTS#2.9.2"><img src="/bookmgr/contents.gif" border=0 alt="[Contents]"></a>
<img src="/bookmgr/drevs.gif" border=0 alt="[Revisions]">
<a href="2.9.1"><img src="/bookmgr/prev.gif" border=0 alt="[Prev Topic]"></a>
<a href="3.0"><img src="/bookmgr/next.gif" border=0 alt="[Next Topic]"></a>
<a href="../../search?book=EZ30OZ00"><img src="/bookmgr/search.gif" border=0 alt="[Search]" ></a>
<img src="/bookmgr/dslist.gif" border=0 alt="[Search Results]">
<img src="/bookmgr/dsprev.gif" border=0 alt="[Prev Topic Match]">
<img src="/bookmgr/dsnext.gif" border=0 alt="[Next Topic Match]">
<img src="/bookmgr/dnotes.gif" border=0 alt="[Notes]">
<img src="/bookmgr/dlnotes.gif" border=0 alt="[List Notes]">
<a href="../../print?book=EZ30OZ00"><img src="/bookmgr/print.gif" border=0 alt="[Print]"></a>
<a href="../../download/EZ30OZ00.boo"><img src="/bookmgr/download.gif" border=0 alt="[Download]" ></a>
<a href="../../help/book"><img src="/bookmgr/help.gif" border=0 alt="[Help]"></a>
<hr>
<a name="HDR4610DCD"><H4> 2.9.2 Compound Document Framework</H4></a>
</banner>
<pre width="80">
In the next release of IBM Open Class library there is to be a high-level
framework delivered using the programming model developed by Taligent. A
framework is much more than a class library. While a class library is a
collection of related classes, a framework is a class library that also
embraces design knowledge and provides a running subsystem for a special
problem domain. This problem domain may be business related as in
accounting, or may be an infrastructure domain, as in compound documents
or communication.
<p>
The programming paradigm is changing with this new technology as shown in
<a href="#FIG4610D17">Figure 55</a>. The evolution started with the introduction of graphical user
interfaces in the 80s. Before the graphical user interfaces, applications
were totally in control of the application flow. Reusable code was put in
procedural libraries and called by the application.
<p>
With the introduction of graphical user interfaces like Mac, OS/2 PM or
Windows, the user started to have the control over the program flow by
having multiple ways to interact with the applications. The programs
consist of an event loop waiting for user interactions.
<p>
<a name="FIG4610D17"><hr>
</a>
<p>
<p>
<a href="picture-53?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P53.GIF" alt="PICTURE 53"></a>
<p>
<p>
<hr>
Figure 55. Evolution Towards Frameworks
<p>
<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>
<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>
<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>
<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,
Vincent Russo
<p>
With a framework, a developer is no longer writing a program that is in
control of the application. The framework is the application, which is
customized by the developer writing small puzzle pieces of code where he
wants to modify the default behavior of the system. It is sometimes
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>
Frameworks can be specialized and modified by subclassing. A framework
has the following two interfaces as shown in<a href="#FIG4610D18"> Figure 56</a>:
<p>
░ A using interface, which is small and simple to use
<p>
░ A subclassing interface used to customize the behavior of the
framework
<p>
<p>
<a name="FIG4610D18"><hr>
</a>
<p>
<p>
<a href="picture-54?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P54.GIF" alt="PICTURE 54"></a>
<p>
<p>
<hr>
Figure 56. Frameworks
<p>
The Workplace Shell is an example of an implemented framework. The
Workplace Shell controls and owns the process. Other Workplace
Shell-based classes written by third parties using WPS objects and classes
can be registered and plugged in during run time, inheriting all the
functions provided by this framework.
<p>
The Compound Document Framework is based on four base classes, a model
class, a view class, selection class and a command class as shown in
<a href="#FIG4610D19">Figure 57</a>. These four classes have to be modified to create a component
either for OLE or OpenDoc with this framework. All the other functions
such as embedding, linking, drag and drop, undo, scriptability, and
interoperability are provided by the framework. The model class is used
to define the content of a component the data part. View classes are used
to define the user interface. The views are separated from the model very
strictly. There may be several views used in parallel by different
applications as shown in <a href="#FIG4610D38">Figure 58</a>. The Invoice, Accounts receivable and
Rolodex application are using different views on the same model Account
Info. Account Info has the following three attributes in this example:
<p>
░ Name/Address
<p>
░ Phone No.
<p>
░ Credit Info
<p>
<p>
If the model, for example the address, changes, all views on this model
are notified by the framework, so they can update themselves. The
presenter class handles all user interactions.
<p>
<a name="FIG4610D19"><hr>
</a>
<p>
<p>
<a href="picture-55?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P55.GIF" alt="PICTURE 55"></a>
<p>
<p>
<hr>
Figure 57. Compound Document Framework
<p>
With a view, the user can also make a selection, which specifies a certain
range of the model data, for example the address. A selection is very
independent from the way it is created. It may be defined by a mouse,
keyboard actions, a menu item or a script. These selections can be used
to manipulate the model data. A selection is associated with a set of
commands specified for this selection to manipulate the specified data.
Commands can also be launched in very different ways. It may be done by a
menu action, a command line, a mouse event or a script.
<p>
<a name="FIG4610D38"><hr>
</a>
<p>
<p>
<a href="picture-56?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P56.GIF" alt="PICTURE 56"></a>
<p>
<p>
<hr>
Figure 58. Compound Document Framework
<p>
But commands are always acting on selections and never directly on the
model data. The actions performed as command - selection pairs are stored
in a history log, thus providing a multi-level undo, implemented by the
framework. Because these command - selection classes are independent from
the way they were created, the parts get scriptability for free, as shown
in <a href="#FIG4610D37">Figure 59</a>. The Compound Document Framework, first delivered with
Visual Age C++ for Windows and later with the next release for OS/2, can
generate OpenDoc components as well as OLE components.
<p>
<a name="FIG4610D37"><hr>
</a>
<p>
<p>
<a href="picture-57?mode=zoom"><img src="/bookmgr/pictures/EZ30OZ00.P57.GIF" alt="PICTURE 57"></a>
<p>
<p>
<hr>
Figure 59. Compound Document Framework
</pre>
</pre>
<hr>
<br><a href="2.9.1"><img src="/bookmgr/prev.gif" border=0 alt="[Prev Topic]"></a>
<a href="3.0"><img src="/bookmgr/next.gif" border=0 alt="[Next Topic]"></a>
<cite> ⌐ Copyright IBM Corp. 1996</cite>
<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>
</BODY></HTML>