| FazBrowse Wikipedia Viewer | Main Page | | |
| Viewing: https://en.wikipedia.org/wiki/Component_Object_Model |
| Contents |
|---|
| .NET |
| Security |
| In Internet Explorer |
| Process corruption |
| Binding |
| Type system |
| Coclass |
| Interface |
| COM | |
|---|---|
| Component Object Model | |
| Abbreviation | COM |
| Status | In force |
| First published | 1993;33 years ago (1993) |
| Latest version | Living standard 2021 |
| Organization | Microsoft |
| Series | System Services |
| Base standards | MIDL, UUID |
| Related standards |
|
| Domain | Component Interfacing |
| Website | learn.microsoft.com/en-us/windows/win32/com/the-component-object-model |
Component Object Model (COM) is a binary-interface technology for software components from Microsoft that enables using objects in a language-neutral way between different programming languages, programming contexts, processes and machines.
COM is the basis for other Microsoft domain-specific component technologies including OLE, OLE Automation, ActiveX, COM+, and DCOM as well as implementations such as DirectX, Windows shell, UMDF, Windows Runtime, and Browser Helper Object.
COM enables object use when only the object's interface is known, not its internal implementation. The component implementer defines interfaces that are separate from the implementation.
Support for multiple programming contexts is handled by relying on the object for aspects that would be challenging to implement as a facility. Supporting multiple uses of an object is handled by requiring each object to destroy itself via reference-counting. Access to an object's interfaces (similar to Type conversion) is provided by each object as well.
COM is available only in Microsoft Windows and Apple's Core Foundation 1.3 and later plug-in application programming interface (API). The latter only implements a subset of the whole COM interface.
Over time, COM is being replaced with other technologies such as Microsoft .NET and web services (i.e. via WCF). However, COM objects can be used in a .NET language via COM Interop.
COM is similar to other component technologies such as SOM, CORBA and Enterprise JavaBeans, although each has its strengths and weaknesses.
Unlike C++, COM provides a stable application binary interface (ABI) that is unaffected by compiler differences. This makes using COM advantageous for object-oriented C++ libraries that are to be used by clients compiled via different compilers.
– installing an MTS component would modify the Windows Registry to call the MTS software, and not the component directly.Windows 2000 included Component Services control panel updates for configuring COM+ components.
An advantage of COM+ was that it could be run in "component farms". Instances of a component, if coded properly, could be pooled and reused by new calls to its initializing routine without unloading it from memory. Components could also be distributed (called from another machine). COM+ and Microsoft Visual Studio provided tools to make it easy to generate client-side proxies, so although DCOM was used to make the remote call, it was easy to do for developers. COM+ also introduced a subscriber/publisher event mechanism called COM+ Events, and provided a new way of leveraging MSMQ (a technology that provides inter-application asynchronous messaging) with components called Queued Components. COM+ events extend the COM+ programming model to support late-bound (see Late binding) events or method calls between the publisher or subscriber and the event system.
Many uses of Nano-COM define two functions to address callee-allocated memory buffers as results:
Nano-COM is currently in use as the base ABI technology for DirectX/Direct3D/DirectML.
Since an ActiveX control (any COM component) runs as native code, with no sandboxing protection, there are few restrictions on what it can do. Using ActiveX components, as Internet Explorer supported, in a web page lead to problems with malware infections. Microsoft recognized the problem as far back as 1996 when Charles Fitzgerald said, "We never made the claim up front that ActiveX is intrinsically secure". Later versions of Internet Explorer prompt the user before installing an ActiveX control, allowing them to block installation.
As a level of protection, an ActiveX control is signed with a digital signature to guarantee authenticity.
It is also possible to disable ActiveX controls altogether, or to allow only a selected few.
The transparent support for out-of-process COM servers promotes software safety in terms of process isolation. This can be useful for decoupling subsystems of large application into separate processes. Process isolation limits state corruption in one process from negatively affecting the integrity of the other processes, since they only communicate through strictly defined interfaces. Thus, only the affected subsystem needs to be restarted in order to regain valid state. This is not the case for subsystems within the same process, where a rogue pointer in one subsystem can randomly corrupt other subsystems.
COM is supported via bindings in several languages, such as C, C++, Visual Basic, Delphi, Python and several of the Windows scripting contexts. Component access is via interface methods. This allows for direct calling in-process and via the COM/DCOM sub-system access between processes and computers.
A coclass, a COM class, implements one or more interfaces. It is identified by a class ID, called CLSID which is GUID, and by a human-readable programmatic identifier, called ProgID. A coclass is created via one of these identifiers.
Each COM interface extends the IUnknown interface, which exposes methods for reference counting and for accessing the other interfaces of the object ISomeInterface.
CoCreateInstance function that takes the CLSID and IID.| View original on Wikipedia | Back | FazBrowse Home |