OLE is based on an object oriented model, so several definitions have to be covered first. There are many different definitions for object, for example "An encapsulation of data and services that manipulate that data"[IEEE610], and Grady Booch's "something you can do things to"[BOOCH94]. Methods are the services that manipulate the data or provide access to the object's data. The signature of a method is the data type of the method's return value and its parameters.
OLE is built on the Component Object Model (COM), which provides the basic infrastructure for OLE. There are two basic constructs in COM, COM Objects and interfaces. An COM Object is an object that can only be accessed through its interfaces. An interface is a set of methods which are used to access an object. An interface is usually implemented as a pointer to an array of function pointers. Interfaces can inherit the method signatures, but not the implementation of the methods. Each COM Object must support the IUnknown interface or an interface inherited from IUnknown.
The IUnknown interface provides three methods: QueryInterface, AddRef and Release. Objects use another object's QueryInterface method to inquire if the object supports a particular interface. If the interface is supported, QueryInterface returns a pointer to the supported interface, otherwise it returns a NULL pointer. AddRef and Release modify the objects reference count. Objects use the reference count to keep track of how many external objects are using them. AddRef increments the count, while Release decrements the count. When the reference count goes to 0, the object destroys itself. Interfaces are distinguished from each other by a unique GUID (Globally Unique IDentifier). This number is a 128 bit integer which can be assigned in blocks to vendors.
There are three basic services supplied by COM: persistent storage, intelligent names and Uniform Data Transfer. Persistent Storage is the ability to store the state data of COM Objects so that they can be deleted and later restored. Intelligent names not only name a COM Object, but also contain information on how to reference the contents of the object. Uniform data transfer allows two applications to exchange data without the applications understanding the internals of each other.
The services provided by COM are used as building blocks for OLE proper. The structures in OLE are more complex and at a higher level. One key concept is the idea of compound documents. For example, a word processing document can contain a spreadsheet created from a different application. A compound document is a document made up of other documents. An application which can store other documents inside of its data files is called a container. The application which creates the objects that are inside containers are known as servers. An object can be both a container and a server at the same time. The contained document can be either stored as a part of the top level document, in which case it is an embedded object, or the document can be stored externally and only a link stored in the enclosing document, in which case it is a linked object. When a contained object is activated for editing, the menus and toolbars of the application which created the contained object will merge with the controls of the container object. This is called menu merging. For example, assume that a spreadsheet is embedded inside a word processing document. The user can select the spreadsheet to be edited which will invoke the spreadsheet program. The menus and toolbars of the spreadsheet program will merge with the controls of the word processing program. Once the spreadsheet object is deselected, the original controls of the word processor will be restored.
Automation allows a program to control and send instructions to another program. The program that is being controlled is called an automation server. The program doing the controlling is the automation controller. A common automation server is a database program. A controller can invoke the server to supply data and to update the database.
OLE can not yet be used to build distributed applications. Many of the mechanisms are in place but not yet completed. The inter-machine communication will be Microsoft RPC which is based on DCE RPC. If the communicating processes are located on the same machine, then a special lightweight Remote Procedure Call protocol will be used. This protocol will bypass the overhead of converting formats for network transmission. Network OLE is intended to be part of Microsoft Windows NT 4.0 which is currently targeted for 1997 or 1998.
OLE can be used at many different levels. There is a C language API defined. This level is very powerful but complicated to use. There are C++ frameworks that encapsulate the C functions that greatly simplify programming. There is also an IDL supplied similar to that of CORBA. The IDL has not yet attracted much use so far. A third method to program OLE is through Microsoft Visual Basic or with one of the programming languages associated with various Microsoft products, such as Microsoft Access. These are not as flexible as working with a C or C++ API, but they are much simpler.
No security is built directly into OLE. Since OLE is document
based, file level security will serve to protect objects that
are either embedded or linked into other objects.