COM is Microsoft's component software architecture
developed primarily for Windows. It is the foundation upon which OLE and
ActiveX are based, and provides a means to re-use code without requiring
re-compilation.
In COM, a component is a platform-specific binary file that compliant
applications and other components can utilize. Programs incorporating a
component's services never have access to its internal data structure, but
instead include pointers to its standardized interface. Thus, it is
possible for components to interact with each other regardless of how they
work or what language they are written in.
Technical details-
COM programmers build their software using COM-aware components. Different
component types are identified by class IDs (CLSIDs), which are Globally
Unique Identifiers, or GUIDs. Each COM component exposes its functionality
through one or more interfaces. The different interfaces supported by a
component are distinguished from each other using interface IDs (IIDs),
which are also GUIDs.
COM interfaces have bindings in several languages, such as C, C++, Visual
Basic, and several of the scripting languages implemented on the Windows
platform. All access to components is done through the methods of the
interfaces. This allows techniques such as inter-process, or even
inter-computer programming (the latter using the support of DCOM).
COM as an object framework-
The fundamental principles of COM have their roots in Object-Oriented
philosophies. It is a platform for the realization of Object-Oriented
Development and Deployment.
Because COM is a runtime framework, types have to be individually
identifiable and specifiable at runtime. To achieve this, globally unique
identifiers (GUIDs) are used. Each COM type is designated its own GUID for
identification at runtime (vis compile time).
In order that information on COM types be accessible at both compile time
and runtime, COM presents the type library. It is through the effective
use of type libraries that COM achieves its capabilities as a dynamic
framework for the interaction of objects.
Registry-
In Windows, COM classes, interfaces and type libraries are listed by GUIDs
in the registry, under HKEY_CLASSES_ROOT\CLSID for classes and
HKEY_CLASSES_ROOT\interface for interfaces. The COM libraries use the
registry to locate either the correct local libraries for each COM object
or the network location for a remote service.
COM+ is an enhanced version of COM that provides better
security and improved performance.
In order to provide developers with support for distributed transactions,
resource pooling, disconnected applications, event publication and
subscription, better memory and processor (threads) management, as well as
to position Windows as an alternative to other enterprise-level operating
systems, Microsoft introduced a technology called Microsoft Transaction
Server (MTS) on Windows NT Service Pack 4.
With Windows 2000, that significant extension to COM was incorporated into
the operating system (as opposed to the series of external tools provided
by MTS) and renamed COM+.
DCOM is an extension of COM that allows applications and components to communicate with each other over a network.
More recent similar technology from Mocrosoft are .NET
and support for Web Services through the Windows Communication Foundation
(WCF). WCF encourags XML-based SOAP messaging.
To some extent, COM is now deprecated in favor of .NET. Since .NET
provides rapid development tools similar to Visual Basic for both Windows
Forms and Web Forms with just-in-time compilation, back-end code can be
implemented in any .NET Language including C#, Visual Basic and C++.
Other similar component software interface standards like COM are CORBA and Java Beans. DCOM was introduced as an answer to CORBA.
OLE is Microsoft's component document technology. With
OLE, it is possible to dynamically link files and applications together.
An object is a combination of data and the application needed to modify
that data. Objects can be embedded in or linked to documents created with
a different application. Embedded objects retain their original format
and links to the application that created them.
For instance, an Excel spreadsheet can be embedded within a Microsoft Word
document or PowerPoint presentation using OLE. Double-clicking the
embedded spreadsheet will launch Excel and allow the user to modify the
sheet. When the spreadsheet is changed, they appear automatically inside
the PowerPoint presentation or Word document .
Some applications include small applets that are used to create objects.
For instance, Microsoft Word includes a drawing tool (MS Draw) and a tool
for manipulating characters as art (Text Art) which can be launched only
via OLE.
Originally introduced with Windows 3.0 specifically for compound
documents, it was based on the Dynamic Data Exchange (DDE), one of the
first IPC methods in Windows.
In Windows 3.1 in 1993 COM was created and OLE changed to OLE2 based on
COM. COM and OLE2 were designed to address software components in general.
OLE2 came to be known as OLE, a name for all of Microsoft's component
technologies.
The Component Object Model now takes in OLE as part of a larger concept.
Both OLE and COM were designed for software interoperability, the former
focusing on communicating and the latter focusing on implementation.
Since 1996, Microsoft gradually renamed all OLE technologies to ActiveX,
except the compound document technology that was used in Microsoft Office.
Support for OLE is built into the Windows and Macintosh operating systems. A competing compound document standard developed jointly by IBM, Apple Computer, and other computer firms is called OpenDoc.
ActiveX is a term Microsoft uses to describe a number of its COM technologies developed for Windows platforms. However, when most people say "ActiveX", they are really referring to ActiveX controls, Microsoft's answer to Java applets. The two technologies are similar in that they are designed to be downloaded and executed by web browsers. The difference is that while ActiveX controls can interface with Microsoft Windows more effectively than Java, they offer very little cross-platform support.
ActiveX applications are used mainly with Microsoft's Internet Explorer web browser. Software based on ActiveX technology is prevalent in the form of Internet Explorer plugins and, more commonly, in ActiveX controls, ActiveX based applications launched from web pages.
In order to be an ActiveX component, an object must implement the IDispatch interface. This allows any object to be queried for a list of pointers to other interfaces the object may support. The developer can iterate through this list and make references to the interfaces, essentially gaining control of entire software packages (if they are designed to allow it).
The Microsoft Office suite is an example of ActiveX-compliant software. Using certain programming languages, a developer can manipulate documents and spreadsheets from code as if they were using the applications directly.
ActiveX is not a programming language, but rather a set of rules for how applications should share information.
The main thing that you create when writing a program to run in the ActiveX environment is a component, a self-sufficient program that can be run anywhere in your ActiveX network (currently a network consisting of Windows and Macintosh systems). This component is known as an ActiveX control.
If you have a Windows operating system on your personal computer, you may notice a number of Windows files with the "OCX" file name suffix. OCX stands for "Object Linking and Embedding control". Microsoft now uses the term "ActiveX control" instead of "OCX" for the component object.
A control using ActiveX technologies.
A Microsoft ActiveX control is essentially a simple OLE object that
supports the IUnknown interface.
An ActiveX control can be automatically downloaded and executed by a Web
browser.
ActiveX controls represent a specific way of implementing ActiveX
technologies.
An ActiveX control is a reusable component which implements the IDispatch
interface. Such components do not amount to an entire application, rather
they provide a small building-block that can be shared by different
software. They can be used to create distributed applications that work
over the Internet through web browsers. Examples include customized
applications for gathering data, viewing certain kinds of files, and
displaying animation.
ActiveX controls can be compared in some sense to a Java applet, since both technologies strive to act as an abstraction layer between the developer and the operating system. Both run on the client computer, not the server. ActiveX controls are granted a much higher level of control over Windows than Java applets, making them both more powerful and dangerous. Malware, such as computer viruses and spyware, is often distributed as ActiveX applets in webpages.
ActiveX controls can be written in MFC, ATL, C, C++, Borland Delphi, Visual Basic and Java. Common examples of ActiveX controls are the command button, list box, dialog boxes, and even the Internet Explorer browser. The fact that command buttons look the same in almost any program on a platform is an example of component reusability that is not just limited to ActiveX controls.