About COM and OLE diagrams

Click to show or hide information. Show me an example

The COM and OLE template includes shapes for all the icons and symbols you can use to create COM and OLE diagrams. It also includes a variety of connector shapes you can use to connect COM objects, object models, and other shapes.

Click to show or hide information. COM

COM (Component Object Model) is a binary standard you can use to construct software applications from components written in different languages.

COM specifications regulate how the components are structured and how they operate with other components. The specifications govern:

  • The structure of component interfaces.
  • How components communicate, including across process and network boundaries.
  • Shared memory management.
  • The dynamic loading of components.
  • Error and state reporting.
  • How components and interfaces are uniquely identified.

OLE (Object Linking and Embedding) is a subset of COM functionality.

Click to show or hide information. COM interfaces

An interface is a collection of functions that component objects make available to client components or applications. The interface defines the component object's expected behavior and responsibilities. Client applications interact with component objects only through an interface—never directly.

Each interface is assigned a unique GUID (globally unique identifier).

Click to show or hide information. Vtables (virtual function tables)

Vtables enable component objects to be written in any language (such as C, C++, or Microsoft Visual Basic) that uses pointers to call functions.

COM specifications define:

  • How to lay out vtables in computer memory.
  • A standard method of calling functions through vtables.

Click to show or hide information. IUnknown interface

COM defines one interface, IUnknown, that all component objects must implement. Iunknown:

  • Provides reference counting when a component interface is required or released, which determines the component lifetime.
  • Enables a client to dynamically determine whether the object supports a required interface.
  • Enables a client to secure a pointer to an object interface.

Click to show or hide information. GUIDs (globally unique identifiers)

GUIDs are 128-bit integers that are unique across space and time. Each component object and interface is assigned a GUID. The identifier prevents a component object from connecting to an incorrect component or interface.

The GUID integer is based on:

  • Which computer is used to create the component or interface.
  • When the component or interface is created.

Create a COM diagram


Create a COM diagram (COM and OLE diagrams)

Click to show or hide information. Show me an example

  1. On the File menu, point to New, point to Software, and then click Com and OLE.
  2. Drag a COM object shape onto the drawing page from the COM and OLE stencil.

To change the style of the COM object shape, right-click the shape and choose COM Style.

  3. Name the COM object by selecting it, and then typing.
  4. Add interfaces to the COM object by dragging the control handle [image] in the center of the shape.
  5. Name the interface by subselecting it and and then typing.

Note All COM objects are created with one interface, IUnknown, by default.

  6. Add vtables to your diagram.

Click to show or hide information. How?

  1. Drag the Vtable shape from the COM and OLE stencil onto the drawing page.
  2. Choose the number of cells you want, and then click OK.

Note You can specify the number of cells at any time, by right-clicking the table, and then clicking Set Number of Cells.

  3. Add text to the table cells by subselecting the cell, and then typing.
  4. Drag the Vtable shape into the COM Object shape.

  7. Establish relationships between COM objects, vtables, and interfaces.

Click to show or hide information. How?

  1. Drag the Reference and Weak reference connectors from the COM and OLE stencil onto the drawing page.
  2. Connect the connectors to other shapes.
  3. To change the angle of the bend in a reference connector, drag the control handle [image].


Add vtables (COM and OLE diagrams)

  1. Drag the Vtable shape from the COM and OLE stencil onto the drawing page.
  2. Choose the number of cells you want, and then click OK.

Note You can specify the number of cells at any time, by right-clicking the table, and then clicking Set Number of Cells.

  3. Add text to the table cells by subselecting the cell, and then typing.
  4. Drag the Vtable shape into the COM Object shape.


Establish relationships (COM and OLE diagrams)

  1. Drag the Reference and Weak reference connectors from the COM and OLE stencil onto the drawing page.
  2. Connect the connectors to other shapes.
  3. To change the angle of the bend in a reference connector, drag the control handle [image].