Component technology followed two trends:

  • The evolution of tier architecture in computer systems in the last dozen years of the 20th century: from 1-tier implementation towards n-tier implementations. Processing work and logical services were decentralized and distributed across computer systems and networks. (See also my section on Tier Architecture.)
  • The shift in programming languages from POP (Process Oriented Programming) toward OOP (Object Oriented Programming). See also my section on Objects.

Microsoft's first offering in component technology was OLE (Object Linking and Embedding).

In brief, OLE was strictly for creating compound documents, i.e. a document created by a OLE compliant program which can contain documents created by other OLE compliant programs. The compound document was called an OLE Container because it contained OLE Objects (i.e. the external documents). The inserted objects were either:

  • Linked. The inserted object/document exists outside of the container document. Changes in the original external document are automatically seen in the container document.
  • Embedded. The inserted object/document exists only in the container document but can still be edited by the originating program.

COM (Component Object Model) was introduced in 1993 as OLE2. COM was considerably more sweeping in concept than OLE. COM is a more general mechanism that allowed one piece of software to provide services to another. Microsoft decided that "OLE" would cease to be an acronym and instead become their way of branding and marketing their compound technologies.

COM has expanded in scope and usage while maintaining its core specs. COM technologies are basically conventions and supporting libraries that allow interaction between different pieces of software in a consistent and object-oriented fashion.

  • COM objects are implemented in process as DLLs or in separate processes as executables.
  • COM objects can be written in any language, including C++, Visual Basic, and Java.
  • COM objects support the persistence of data.
    • The most common method is with file-based persistence, i.e. where the object merely loads persistent data from standard files.
    • Another method utilizes structured storage, ie where the object access a type of file system. Its directories are called storages and its files are called streams. This enables multiple objects to share a single file.
    • Other methods of persistence.
  • COM objects support the concept of monikers. Monikers are COM objects who specifically create and initialize other objects.
  • COM objects support automation, ie the exposure of its methods for clients to call. The term "automation" was used because the clients were frequently calling methods repetitively.
    • vtable interfaces are good for clients written in C++
    • dispatch interfaces (aka dispinterfaces) are good for clients written in languages like Visual Basic.
  • All Microsoft COM components implement the creation and destruction of objects with the IUnknown interface. The IUnknown interface includes three functions:
    • QueryInterface. Asks the component if it supports a particular interface. EG: In VB this function is accessed by binding an object variable to a particular class:
      Dim objInstance as clsMine
    • AddRef. Adds another reference to the tally, kept by the component, of how many clients are accessing it. EG: In VB this function is accessed by setting an object variable as an instance of a class:
      Set objInstance = New clsMine
    • Release. Releases a reference to itself by clients. EG: In VB this function is accessed by setting an object variable back to Nothing:
      Set objInstance = Nothing

For a few years this worked fine but by early 1996 the marketing wizards at Microsoft decided that a new and improved brand name was needed. ActiveX was the new name for COM components that were not OLE documents. The phrase OLE was reverted back to referring just to compound document implementations.

An ActiveX Component is any program that is a COM component (ie supports the IUnkown interface) and is self-registering (ie registers with regsvr32.exe or with a setup program.). Different types of ActiveX Components include the following:

  • ActiveX Controls (previously known as OLE Controls or OCX controls). The are COM objects that can be inserted into apps or web apps. ActiveX controls can be called from DLLs and other controls.
  • ActiveX Documents
  • ActiveX EXEs
  • ActiveX DLLs

In late 1996 Windows NT 4.0 introduced DCOM (Distributed COM). DCOM is COM over a network. A DCOM component specializes in location transparency. DCOM components talk over HTTP (and other network protocols), utilizes security (with authentication, encryption, etc.) and MTS (Microsoft Transaction Server).

In 1997, Microsoft COM+, which is essentially a language neutral version of COM.

Much of the ugly details of creating COM components has been abstracted and hidden. In Visual Basic, a COM component can be made simply by creating an ActiveX Control project. In Visual C++, a COM component can be made by utilizing the ATL (Active Template Library).

GeorgeHernandez.comSome rights reserved