Professional Documents
Culture Documents
What is DCOM?
DCOM is just COM with a longer wire DCOM extends COM to support communication among objects on different computers
COM is a platform-independent, distributed, object-oriented system for creating binary software components that can interact. COM objects can be created with a variety of programming languages. Objectoriented languages, such as C++, provide programming mechanisms that simplify the implementation of COM objects.
Understanding COM
not an object-oriented language but a binary standard COM specifies an object model and programming requirements that enable COM objects (also called COM components) to interact with other objects
Binary components
Encapsulation
Black box - no leakage of implementation details All object manipulation through strict interfaces
IUnknown
Polymorphism
COM Object
Interfaces
IUnknown
IDispatch
Custom Interfaces
COM Architecture
DCOM Architecture
COM Client
Proxy
Component
HTTP
Other Component
DCOM Security
Secure - Security is designed and built in. Not an option. DCOM uses the extensible security framework provided by Windows NT. Security configurable
DCOM stores Access Control Lists for components ACLs can be configured using the DCOM configuration tool (DCOMCNFG) or programmatically using the Windows NT registry and Win32 security functions.
COM Client
Proxy
Component
DCE
Other Component
Use existing tools and components Reduce development time and cost COM components easily configured as DCOM components COM can use many other components COM components are usable by many technologies
Location Transparency
COM Object locations are stored in registry Applications make calls using the globally unique CLSID. Path to COM server, or remote computer to run DCOM server is not needed by the application.
Language Neutrality
VB, Delphi for rapid development VC++, Java for advanced development Micro Focus COBOL
Connection Management
Low Bandwidth
Header is 28 bytes over DCE-RPC Keep-Alive Messages bundled for all connections between Machines
COM employs an efficient pinging protocol to detect if clients are active COM uses reference counting mechanism to do garbage collection
Multiplexing - Single Port per-protocol, per server process, regardless of # of objects Scalable - Connection-Less Protocols like UDP Preferred Established Connection-Oriented (TCP) Sessions Reused by same client
Client
Server
Client
Load Balancing
DCOM does not transparently provide load balancing Makes it easy to implement load balancing
Static load balancing Dynamic load balancing by means of a dedicated referral component
Platform Neutrality
Win32 platforms, Solaris, DEC UNIX, HPUX, Linux, MVS, VMS, Mac Cross-Platform Interoperability Standard Unlike java, DCOM can utilize powerful platformspecific services and optimizations Less abstraction layers prevents additional overheads
Header:
... public: STDMETHOD(StringLen)(/*[in]*/ BSTR str, /*[out,retval]*/ long* length); ...
Exception Handling
try { len = pSimple->StringLen("sample"); } catch (_com_error &e) { printf(%s\n, e.Description()); }
COM dll
To register: regsvr32 mycom.dll To un-register: regsvr32 u mycom.dll To register: mycom.exe /regserver To un-register: mycom.exe /unregserver
COM exe
Configure as DCOM
Referances
MSDN Library Online Professional ATL COM programming , Richard Grimes, Wrox Publishing