Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft’s Distributed Component Object Model (DCOM) Jim Ries Updated 10/5/1999 A semi-technical overview.

Similar presentations


Presentation on theme: "Microsoft’s Distributed Component Object Model (DCOM) Jim Ries Updated 10/5/1999 A semi-technical overview."— Presentation transcript:

1 Microsoft’s Distributed Component Object Model (DCOM) Jim Ries JimR@acm.org Updated 10/5/1999 A semi-technical overview

2 Genealogy n DCOM comes from COM and OSF (now Open Group) DCEOpen GroupDCE u DCE F Remote Procedure Calls (RPC) F Interface Definition Language (IDL) u Component Object Model (COM) u ORPC n OMG CORBA - a parallel standard OMG CORBA u Different RPC u Different IDL u COM proxy == CORBA stub u COM stub == CORBA skeleton

3 Microsoft proprietary, but... n Open Group’s COMSource: http://www.opengroup.org/comsource/ http://www.opengroup.org/comsource/ n Software AG’s EntireX: http://www.softwareag.com/entirex/default.htm http://www.softwareag.com/entirex/default.htm n The Active Group: http://www.activex.org/ http://www.activex.org/

4 COM Goals n Encapsulation (separate implementation from interface) n Versioning n Execution context independence n Language independence n Object Creation / Lifetime Control n Standard error code (HRESULT) n Solve object discovery problem n Scripting n The Holy Grail of Reuse

5 Alphabet soup: COM/OLE/ActiveX n COM is a binary standard and a style for creating objects. n OLE is (was) a set of COM interfaces for embedding documents (originally “Object Linking and Embedding”). n ActiveX is a marketing buzz-word meaning COM and/or OLE, but usually applied to Internet-oriented components.

6 Later and later binding n “Editor inheritance” binds at compile time. n Link libraries (.LIB) bind to “components” at link time. n Dynamic link libraries (.DLL) bind at run time, but need a header at compile time, and path at runtime. n COM components bind at runtime and may need neither a header, nor a path! (though typelib contains header-like “meta-data”)

7 Interfaces n COM enforces the concept of interfaces being separate from implementation. n Interface == Abstract Base Class n Objects support multiple interfaces through multiple inheritance. n Interfaces NEVER change! n A “control” is just a COM component with the right interfaces.

8 GUID’s (or UUID’s) n Globally Unique Identifiers (Universally Unique Identifiers) n Needed to avoid name collisions n A class is associated with a GUID (CLSID). n An interface is associated with a GUID (IID). n The Windows Registry: a hierarchical database.

9 Execution Context n In proc - DLL’s (no marshalling) n Out of proc - EXE’s (LRPC) n Remote - EXE’s using DCOM u RPC u DCE “compatible” (see “Interconnecting Personal Computers with the Distributed Computing Environment” by Jim Ries, UMC Thesis, 1998.)

10 Coding Tools n C - Raw n C++ - Raw n C++ - ATL n C++ - MFC n Visual Basic n J++ (pseudo Java) n Binary standard ==> any language COULD produce COM components.

11 Platforms n Win32 u Windows 95 (DCOM as separate download; included in OSR2) u Windows NT 4.0 u Windows 98 u Windows 2000 n Unix platforms (with some help)

12 Nuts and Bolts n CoInitialize() n CoCreateInstance() n IUnknown u QueryInterface() u AddRef() u Release() n CoUninitialize()

13 Demonstration - IDL [ object, uuid(75D873CD-7B63-11D3-9D43-00C0F031CDDE), helpstring("IServer Interface"), pointer_default(unique) ] interface IServer : IUnknown { HRESULT Hello([in, string] char * pszMessage); };

14 Demonstration - Server Code // Prototype class CServer : public IServer, public CComObjectRoot,public CComCoClass { //... Some code omitted for brevity // IServer public: HRESULT STDMETHODCALLTYPE Hello(unsigned char * pszMessage); }; // Code HRESULT STDMETHODCALLTYPE CServer::Hello(unsigned char * pszMessage) { char szBuf[256]; wsprintf(szBuf,"%s",pszMessage); ::MessageBox(0,szBuf,"Server",MB_OK); return(S_OK); }

15 Demonstration - Client Code if (SUCCEEDED( hr=CoCreateInstance(CLSID_Server,NULL, CLSCTX_LOCAL_SERVER, IID_IServer,(void **)&pServer))) { if (SUCCEEDED(hr=pServer->Hello((unsigned char *)"Hello from the client"))) MessageBox("Client: Server printed the message"); else { wsprintf(szBuffer,"Hello() method failed: 0x%lX.\n",hr); MessageBox(szBuffer); } pServer->Release(); } else { wsprintf(szBuffer,"Unable to create a server: 0x%lX.\n",hr); MessageBox(szBuffer); }

16 Distributed Scenario n From “DCOM Architecture” a Microsoft white paper. From “DCOM Architecture” a Microsoft white paper.

17 Demonstration n Run DCOM “Hello world” demo here.

18 Additional Technologies n COM+ u MTS - Microsoft Transaction Server u MSMQ - Microsoft Message Queue u Compiler supported IUnknown, etc. n ADS - Active Directory Service u As “distributed registry” u As namespace abstraction n All Microsoft products are COM based: u IIS - Internet Information Server u Exchange u Internet Explorer u Word, Excel, etc.

19 References n Microsoft DCOM page Microsoft DCOM page n IETF DCOM Standard Proposal IETF DCOM Standard Proposal n Inside OLE by Kraig Brockschmidt, Microsoft Press, 1995. n Essential COM by Don Box, Addison Wesley, 1998. n Inside COM by Dale Rogerson, Microsoft Press, 1997. n Don Box homepage Don Box homepage n ActiveX COM Control Programming by Sing Li and Panos Economopoulos, Wrox Press, 1997. n COM-CORBA Interoperability by Geraghty, et. al., Prentice Hall, 1999. n Microsoft Developer Network Microsoft Developer Network


Download ppt "Microsoft’s Distributed Component Object Model (DCOM) Jim Ries Updated 10/5/1999 A semi-technical overview."

Similar presentations


Ads by Google