Basics of Web Programming · Web Technology

Distributed Object Models — DCOM

1. What is DCOM?

DCOM (Distributed Component Object Model) is Microsoft's protocol that extends COM (Component Object Model — in-process DLL / out-of-process EXE components on one machine) so that components can communicate across machines on a network ("COM with a longer wire").

2. Architecture

  CLIENT PROCESS                                SERVER PROCESS
 +--------------------+     RPC (ORPC)     +---------------------------+
 | client code        | ------------------>|  DCOM server object       |
 |   |                |  <-- LRPC/DCOM     |  (COM class implementing  |
 |   v                |      over TCP/IP   |   IUnknown + interfaces)  |
 | proxy (marshaler)  | <------------------|  stub (unmarshaler)       |
 +--------------------+                    +---------------------------+
        SCM (Service Control Manager) on both ends handles activation
  • Interfaces are the contract — every object implements IUnknown (QueryInterface, AddRef, Release); e.g. IDispatch for scripting/automation.
  • Proxy/stub pairs marshal parameters (NDR format) across the wire using ORPC (Object RPC), built on DCE RPC.
  • SCM / Registry (CLSID) locate and activate the component; class factories create instances.

3. Key Features

Feature Mechanism
Location transparency same call code whether the object is in-process, local or remote
Versioning interfaces are immutable — new interfaces added, old ones kept
Security authentication (NTLM/Kerberos), impersonation, launch/access permissions via the registry
Connection management reference counting + pinging of remote references
Language neutrality C++, VB, Delphi, scripts (via IDispatch)
Re-use containment/aggregation instead of implementation inheritance

4. How a Remote Call Happens

  1. Client calls CoCreateInstance(CLSID, CLSCTX_REMOTE_SERVER, MachineName) — or a moniker binds to a running object.
  2. Local SCM contacts the remote SCM, which launches/locates the object and returns an OBJREF (object reference with interface pointers and binding info).
  3. Client receives a proxy; calls are marshalled through the channel to the server stub → real object → result marshalled back.

5. DCOM vs CORBA vs RMI (comparison)

Aspect DCOM CORBA Java RMI
Origin Microsoft OMG (open standard) Java (Sun)
Language support many, best with MS tools many (via IDL mappings) Java only
Wire protocol ORPC/DCE RPC (NDR) GIOP/IIOP (CDR) JRMP (Java)
Interface definition MIDL (IDL) / typelib IDL Java interfaces
Threading model apartment (STA/MTA) ORB-managed container/Thread
Security NTLM/Kerberos, ACLs CORBA Security service JVM sandbox, JAAS
Best environment Windows enterprises heterogeneous multi-vendor pure Java systems

6. Advantages and Limitations

Advantages

  • Mature, efficient binary protocol; deep Windows integration; large developer base and tooling (Visual Studio, ATL).
  • Location transparency, robust versioning, per-interface security controls; reusable binary components (Office, IE, SQL Server automation).

Limitations

  • Tightly coupled to Windows/Microsoft platform — poor cross-platform support (COM on Unix is limited).
  • Complex configuration (registry, permissions, DCOMCNFG); "DLL hell" with versions; debugging marshalling errors is painful.
  • Firewall-unfriendly RPC; superseded by .NET Remoting → WCF → REST/gRPC.

7. Exam Points

  • Explain the DCOM architecture with a diagram (proxy/stub, ORPC, SCM) — 10 marks.
  • Explain IUnknown and interface-based design — 5 marks.
  • Compare DCOM with CORBA and RMI — 5-7 marks.
  • State advantages and limitations of DCOM — 5 marks.
Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.

← All Web Technology modules