************************************* * * * DB/C Newsletter * * April 1995 * * * ************************************* Editor's Notes The topic for this month's newsletter is OLE and OpenDoc. There are many misconceptions about what OLE and OpenDoc are useful for. In my opinion, OLE and OpenDoc are not particularly useful in creating the types of applications that are typically created with DB/C. (There is a good probability that I am wrong about this - if you can find a use, let me know.) More interesting to me are the underlying software layers called COM and SOM. I am not an expert on any of these emerging technologies, but hopefully this article will provide you with some insight into what these creatures are about. don.wills@swc.com OLE, OpenDoc, COM and SOM Here is a quick summary of the acronyms in the title: OLE stands for Object Linking and Embedding. OLE is Microsoft software that is available only on the various Windows operating systems. OLE is available for Windows 3.1 and Windows NT 3.5. OpenDoc is an Apple/IBM software standard. Apple has shipped a beta test version of OpenDoc for Mac OS 7.5. IBM has announced plans to release OpenDoc for OS/2 and AIX. COM stands for Component Object Model. COM is a Microsoft software layer that defines a programming language independent interface for object-oriented programs. It is the layer that underlies OLE. SOM stands for System Object Model. SOM is an IBM-defined, non-proprietary programming language interface that is similar to COM. It is the layer that underlies OpenDoc. SOM and DSOM (Distributed System Object Model) are available for AIX and OS/2. SOM is also available with the beta test version of OpenDoc for Mac OS 7.5. The basic concept behind both OLE and OpenDoc is the document. OLE and OpenDoc are described as document-centric, not application-centric. Both are meant to allow component software to fit together in a coherent fashion such that an end user can operate on a single document using different applications (component software) on different parts of the document. A typical example is a newsletter that contains text and graphics. Instead of purchasing a single application that does both text and graphics, one can purchase a text component and a drawing component separately, but have them work on the same document in the same window, sharing menus and functions (like Open, Save As, etc.). This allows the end user much more flexibility in choosing the software that is most appropriate for his needs. Programming for such an environment is quite complicated. The number of interactions between components is quite large. What if vendor A wants to write their component in C++ and vendor B wants to write their component in Smalltalk? The need for a language independent API is apparent. But does the the API have to be object-oriented? Why can't it be just like other APIs for operating systems? The answer is that object-oriented programming makes complicated programming interfaces easier to use. The extensibility of an API in an object-oriented environment is far superior to a traditional API. The complexity of OLE and OpenDoc are what caused the need for COM and SOM. Let's look at some of the specific concepts of OLE and OpenDoc. OLE and OpenDoc Software comes in two forms: 'container' software and 'part' software. In the newsletter example, word processing software is the 'container' software and the drawing program is the 'part' software. If a spreadsheet was also embedded in the newsletter, spreadsheet software would also be 'part' software. It is possible for application software to be the 'container' software for one document and 'part' software for another document. The 'container' software is the controlling software. It is the software that controls the menu and dispatches messages to the 'part' software. Many user actions cause messages to be dispatched to one or all parts. For example, when the user selects the File Save menu option, a message is sent to all of the 'part' components in the document so that each can do the save operation. When the user clicks on an area of the document controlled by a 'part', then the menu is changed to reflect the valid menu options available for the respective part. For example, when a graphic area is selected, such draw menu entries as Color and Line Width are installed in the menu. All possible interactions between 'containers' and 'parts' are defined by OLE and OpenDoc. Both Microsoft and Apple/IBM have tried show that their respective technology is superior. In reality there are more similarities than there are differences. One notable difference is the fact that a 'part' area of an OLE document must be rectangular, whereas in OpenDoc it can be any irregular shape (think about flowing text around a round picture). Microsoft, Apple and IBM have all made large commitments to their respective technologies. It is unclear whether one technology will prevail over the other, or whether both will succeed. It is even possible that both will be somewhat unsuccessful - because not all problems fit into the document model. Remember the old saying - if all you've got is a hammer, everything starts to look like a nail. Not everything is a document. Time will tell. DB/C Class Schedule The next DB/C class is scheduled for April 10-13, 1995. The class is held in the Oak Brook, Illinois office of Subject, Wills and Company. For more information, contact Judi Tamkevic via email at dbc@swc.com or via telephone at (708) 572-0240.