Presentation is loading. Please wait.

Presentation is loading. Please wait.

DCOM Technology. What is DCOM? DCOM is just COM with a longer wire DCOM is just COM with a longer wire DCOM extends COM to support communication among.

Similar presentations


Presentation on theme: "DCOM Technology. What is DCOM? DCOM is just COM with a longer wire DCOM is just COM with a longer wire DCOM extends COM to support communication among."— Presentation transcript:

1 DCOM Technology

2 What is DCOM? DCOM is just COM with a longer wire DCOM is just COM with a longer wire DCOM extends COM to support communication among objects on different computers DCOM extends COM to support communication among objects on different computers

3 Component Object Model COM is a platform-independent, distributed, object-oriented system for creating binary software components that can interact. 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. Object- oriented languages, such as C++, provide programming mechanisms that simplify the implementation of COM objects. COM objects can be created with a variety of programming languages. Object- oriented languages, such as C++, provide programming mechanisms that simplify the implementation of COM objects.

4 Understanding COM not an object-oriented language but a binary standard 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 COM specifies an object model and programming requirements that enable COM objects (also called COM components) to interact with other objects

5 COM Design Principles Binary components Binary components Any programming language Any programming language Any location(in-process, cross-process, cross- machine) Any location(in-process, cross-process, cross- machine) Zero sacrifice in-proc performance Zero sacrifice in-proc performance Simplest model possible Simplest model possible Enable extensibility and adaptability Enable extensibility and adaptability

6 Encapsulation Encapsulation Black box - no leakage of implementation details Black box - no leakage of implementation details All object manipulation through strict interfaces All object manipulation through strict interfaces Polymorphism Polymorphism via multiple interfaces per class via multiple interfaces per class “Discoverable”: QueryInterface “Discoverable”: QueryInterface COM Design Principles.. COM Object IUnknown IRobot IDispatch

7 Interfaces IUnknown IUnknown AddRef AddRef Release Release QueryInterface QueryInterface IDispatch IDispatch GetIDsOfNames GetIDsOfNames GetTypeInfo GetTypeInfo GetTypeInfoCount GetTypeInfoCount Invoke Invoke Custom Interfaces Custom Interfaces

8 COM Architecture Communication details handled by the COM run-time

9 DCOM Architecture

10 Proxy & Stub

11 DCOM Wire Protocol COM Client Component COM Runtime Server MachineClient Machine TCP, UDP SPX,IPX Net BUI HTTP COM Runtime Proxy Other Component

12 DCOM Security Secure - Security is designed and built in. Not an option. Secure - Security is designed and built in. Not an option. DCOM uses the extensible security framework provided by Windows NT. DCOM uses the extensible security framework provided by Windows NT. Security configurable Security configurable DCOM stores Access Control Lists for components 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. ACLs can be configured using the DCOM configuration tool (DCOMCNFG) or programmatically using the Windows NT registry and Win32 security functions.

13 COM Security Architecture COM Client Component COM Runtime Server MachineClient Machine DCE NT Kerberos SSL, Certs. NTLM COM Runtime Proxy Other Component

14 Components & Reuse Use existing tools and components Use existing tools and components Reduce development time and cost Reduce development time and cost COM components easily configured as DCOM components COM components easily configured as DCOM components COM can use many other components COM can use many other components COM components are usable by many technologies COM components are usable by many technologies

15 Location Transparency COM Object locations are stored in registry COM Object locations are stored in registry Applications make calls using the globally unique CLSID. 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. Path to COM server, or remote computer to run DCOM server is not needed by the application.

16 Language Neutrality Various languages can be used to create components. Various languages can be used to create components. VB, Delphi for rapid development VB, Delphi for rapid development VC++, Java for advanced development VC++, Java for advanced development Micro Focus COBOL Micro Focus COBOL Even more languages can be used to use COM components Even more languages can be used to use COM components Additionally scripting languages like VB Script, JScript Additionally scripting languages like VB Script, JScript

17 Connection Management Low Bandwidth Low Bandwidth Header is 28 bytes over DCE-RPC Header is 28 bytes over DCE-RPC Keep-Alive Messages bundled for all connections between Machines Keep-Alive Messages bundled for all connections between Machines COM employs an efficient pinging protocol to detect if clients are active COM employs an efficient pinging protocol to detect if clients are active COM uses reference counting mechanism to do garbage collection COM uses reference counting mechanism to do garbage collection

18 Efficient and Scalable Multiplexing - Single Port per-protocol, per server process, regardless of # of objects Multiplexing - Single Port per-protocol, per server process, regardless of # of objects Scalable - Connection-Less Protocols like UDP Preferred Scalable - Connection-Less Protocols like UDP Preferred Established Connection-Oriented (TCP) Sessions Reused by same client Established Connection-Oriented (TCP) Sessions Reused by same client Server Client Client

19 Load Balancing DCOM does not transparently provide load balancing DCOM does not transparently provide load balancing Makes it easy to implement load balancing Makes it easy to implement load balancing Static load balancing Static load balancing Dynamic load balancing by means of a dedicated referral component Dynamic load balancing by means of a dedicated referral component

20 Platform Neutrality DCOM run-time is available for various platforms DCOM run-time is available for various platforms Win32 platforms, Solaris, DEC UNIX, HPUX, Linux, MVS, VMS, Mac Win32 platforms, Solaris, DEC UNIX, HPUX, Linux, MVS, VMS, Mac Cross-Platform Interoperability Standard Cross-Platform Interoperability Standard Per-Platform binary standard Per-Platform binary standard Unlike java, DCOM can utilize powerful platform- specific services and optimizations Unlike java, DCOM can utilize powerful platform- specific services and optimizations Less abstraction layers prevents additional overheads Less abstraction layers prevents additional overheads

21 Creating a simple COM server

22 ATL COM AppWizard

23 New ATL Object

24 ATL Object Attributes

25 Add New Method

26 Interface Definition Language...[object,uuid(79522A15-BA3D-46A5-92D6-DA4BE60646F4),dual, helpstring("ISimple Interface"), pointer_default(unique)] interface ISimple : IDispatch { [id(1), helpstring("method StringLen")] HRESULT StringLen([in] BSTR str, [out,retval] long* length); };...

27 Source & Header File Source: STDMETHODIMP CSimple::StringLen(BSTR str, long* length) { *length = SysStringLen(str); return S_OK; }Header:...public: STDMETHOD(StringLen)(/*[in]*/ BSTR str, /*[out,retval]*/ long* length);...

28 Creating a Simple COM Client #include #include #import "SimpleCom.exe" int main(int argc, char* argv[]) { SIMPLECOMLib::ISimplePtr pSimple; long len; CoInitialize(NULL);pSimple.CreateInstance(__uuidof(SIMPLECOMLib::Simple)); len = pSimple->StringLen("sample"); printf("Length = %d\n", len); CoUninitialize(); return 0; }

29 Exception Handling try{ len = pSimple->StringLen("sample"); } catch (_com_error &e) { printf(“%s\n”, e.Description()); }

30 Registering COM Objects COM dll COM dll To register: regsvr32 mycom.dll To register: regsvr32 mycom.dll To un-register: regsvr32 –u mycom.dll To un-register: regsvr32 –u mycom.dll COM exe COM exe To register: mycom.exe /regserver To register: mycom.exe /regserver To un-register: mycom.exe /unregserver To un-register: mycom.exe /unregserver

31 Configure as DCOM

32 Protocols for DCOM

33 Referances MSDN Library Online MSDN Library Online Professional ATL COM programming, Richard Grimes, Wrox Publishing Professional ATL COM programming, Richard Grimes, Wrox Publishing


Download ppt "DCOM Technology. What is DCOM? DCOM is just COM with a longer wire DCOM is just COM with a longer wire DCOM extends COM to support communication among."

Similar presentations


Ads by Google