Presentation is loading. Please wait.

Presentation is loading. Please wait.

COM, DCOM Heterogeneous DCOM and Microsoft DNA Richard J. Bonneau, Ph. D. Systems Application Integration Engineering (SAIE) Industry Solutions Division.

Similar presentations

Presentation on theme: "COM, DCOM Heterogeneous DCOM and Microsoft DNA Richard J. Bonneau, Ph. D. Systems Application Integration Engineering (SAIE) Industry Solutions Division."— Presentation transcript:

1 COM, DCOM Heterogeneous DCOM and Microsoft DNA Richard J. Bonneau, Ph. D. Systems Application Integration Engineering (SAIE) Industry Solutions Division (ISD) Compaq Computer Corp.

2 With Acknowledgements to: Developing With COM On UNIX And OpenVMS Mohan Rao Cavale Frank Hayes Gaitan D’Antoni Development Lead Engineering Manager Project Leader COM/UNIX COM For Digital UNIX COM For OpenVMS Microsoft Corporation Compaq Compaq

3 Goals of talk n High level and code-level view of the COM/DCOM concepts n See a COM/DCOM demo live n Extensions of DCOM to Heterogeneous platforms n DNA as industry-level solutions integration framework –Infrastructure Components –Industry Integration Efforts

4 Presentation Caveats n “Techy talk” - not marketing hype n Not comprehensive - nor in-depth n A broad brush of many concepts n Hands-on - tools (VC++, VB, registry,...), code segments in VB/VC, examples (VB and VC) … n Not an expert - just a knowledgeable user who likes to lecture !!!

5 Outline n COM - the basics n A COM demo or two... n Distributing COM n Heterogeneous COM - OVMS and Tru64 UNIX n Future of COM: DNA components and DNA for different industries n Summary

6 An Important Equation! For all intents and purposes: OLE = COM = DCOM = ActiveX = COM+ !!! Simplifies the TLA world considerably!!

7 An Important InEquation! n COM Objects = C++ Objects n Although they can be implemented using C++ objects or Java objects or even VB objects /

8 COM - the basics n C omponent O bject M odel n - critical to development of distributed 3-tier enterprise applications n Components - critical to development of distributed 3-tier enterprise applications –provide services to requestors (clients) –small units of software for dev and maint –easily deployed and accessible n ‘Everything’ in MS Windows 9x/NT is a component!!

9 COM - the evolution n Ultimate goal - software reusability!! n “In the beginning” - Single program source file n Procedures/functions and #include n Compile functions into a library and link into final image n Have compiled routines in a separate sharable library or dynamic link library

10 COM - the evolution - part II n On source level - Objects as organizing principle - Within a given program or through include files n Object libraries- reduce compilation overhead n What’s important? - the method calls n Interface as –collection of methods –a connection point between client and object server n Collect interfaces into separate containers - called COMPONENTS!

11 The basics - continued n Interface: A rigorously defined binary structure allowing independent development of clients and servers n MS designed to be language, platform, hardware neutral!! n Defines the programming contract between client and server

12 The interface - continued n Derived from some known issues in doing multi-platform C++ development - see Don Box book (Essential COM) n Simple concept with sweeping implications when used universally - sound like Microsoft?? n A component is then a software vehicle for providing access to one or more interfaces

13 Universal Interface definitions - IDL interface IWarehouse : IDispatch { HRESULT OrderFulfill( [in] long lPartNumber, [in] long lNumItems, [out] unsigned char * ucpResult); HRESULT Reset ([in] long ReStockValue); } ;

14 The COM picture n A Component ‘exposes’ one or more Interfaces n Clients ‘acquire’ a pointer to one or more interfaces n Client uses them to call the methods Component Interfaces Client

15 The Interface - more details Pointer to method 1 Pointer to method 2 Pointer to method 3 Pointer to method 4 Pointer to method 5 Pointer Client Interface Pointer Object Method 1(…) Method 2(…) Method 3(…) Method 4(…) Method 5(…) “Vtable”

16 So how DOES COM work? n A client needs to get a hold of an interface on a component - key task! n Once that is done, it just calls the methods associated with the interface through the interface pointer! n How easy to do that? n Sample code in VB - next slide

17 Code Visual Basic client Dim ICObj As Object ….. Private Sub Command1_Click() Set ICObj = CreateObject("DCOMDEMO.InventoryControllerServer")... End Sub …. Call ICObj. ProcessOrder (lPartNumber, lNumItems, lNumOrders, ucpResult, lpNumOrdersFilled)

18 So how is this not just RPC? n Some rules about being “COM” n Must implement the IUnknown Interface with three methods –QueryInterface –AddRef –Release n Rules around maintaining counts of COM instances… vestigial and cumbersome

19 How to get that interface pointer?? n The Registry! n All servers/components/interfaces register themselves - using globally unique identifiers (GUIDs and CLSIDs) n Clients (through COM library calls) access the registry (by this unique identifier) to –find out where the server is –get an interface pointer –then just do a “function call” through the ptr!

20 A quick peek at registry... n HKEY_CLASSES_ROOT n CLSID key - organized by GUIDs - ugh! n APPID key - organized by names … n TypeLib key - GUID’s again! n Messy - slow - CRITICAL! n Other tools = e.g. OleView - more user friendly!

21 What really happens? Client COM library Service Control Manager (SCM) Registry Based on GUID, SCM looks up the server, if necessary loads/starts it and obtains a pointer to the requested interface, returns it to the client. Server COM library

22 A very COM simple demo - VB! n MS has made VB the environment of choice to quickly build COM applications n Let’s make both a server/component and a client n And get them to talk to each other … n It’s “too easy”, especially in relation to VC++!

23 What a COM client needs to do... n Call CoInit - to init the COM environment n Call CoCreateInstance - to request access to an interface on a server/component n Use the returned interface pointer to call component’s interface methods n Look at some sample C++ code?? –Warehouseclient.cxx

24 What a COM component or server needs to do... n Implement the methods of the interface(s) it supports, including the inherited IUnknown methods –May use C++ objects & methods for COM interface methods n Register with the registry as a component (self-registry recommended) n Look at some sample C++ code?? –Warehouse.cxx

25 A more complex demo n Developed by Digital/Compaq for MS PDC last October n To demonstrate heterogeneous DCOM on all Compaq’s platforms (plus one) n Simple 3-tier factory inventory model n Uses COM/DCOM throughout on all the platforms n Actually same code base used for all the servers (not the GUI client!)

26 COM COM COM COM Warehouse Inventorycontroller Warehouse Warehouse Demo Architecture Client Inventorycontroller

27 The methods = the interfaces Inventory Controller (IInventoryController) Methods Process Order - try to fill an order from one or more warehouses Get Statistics - tell how well you have been able to service orders Reset Statistics - clean stats out for another recording period Warehouse Methods (IWarehouse) OrderFulFill - can you fill a specific order for a part and quantity? Reset - magically restock the factory

28 Code Interface definitions // Interface IInventoryController [ object, object, uuid(6fc9d540-4c46-11d2-9147-004005193783), uuid(6fc9d540-4c46-11d2-9147-004005193783), helpstring("IInventoryController Interface"), helpstring("IInventoryController Interface"), pointer_default(unique), pointer_default(unique),dual,oleautomation]...

29 Code Interface definitions interface IInventoryController : IDispatch { import "oaidl.idl" ; HRESULT ProcessOrder ( [in] long lPartNumber, [in] long lNumItems, [in] long lNumOrders, [out] unsigned char * ucpResult, [out] long * lpNumOrdersFilled); HRESULT ResetStatistics (); HRESULT GetStatistics ([out] long * lpTotalOrders, [out] long * lpTotalOrdersFilled, [out] long * lpTotalBackorders); } ;

30 Code Interface definitions // Component and type library descriptions [uuid(70fe8120-4c46-11d2-9147-004005193783),version(1.0), helpstring("Compaq DCOM Demo - Inventory Controller Server 1.0 Type Library") ] library InvctrLib {importlib("stdole2.tlb") ; // InventoryController server/class [ uuid(717738f0-4c46-11d2-9147-004005193783), helpstring("Inventory Controller Class") ] coclass InventoryController {[default] interface IInventoryController ;} ; } ;

31 Code Interface definitions interface IWarehouse : IDispatch { HRESULT OrderFulfill( [in] long lPartNumber, [in] long lNumItems, [out] unsigned char * ucpResult); HRESULT Reset ([in] long ReStockValue); } ;

32 Let’s run it now... n All processes running on single system n Bring up VC++-based GUI Front End n Creates executing component servers at both back end tiers n Initializes all product stock to 1000 n Awaits client commands to –Select nodes to participate –Request orders –Check/reset statistics

33 A Visual Basic GUI Client n Using Rapid Development Tools n Accesses same (interface) functionality as VC++ Client n Puts results onto an excel spreadsheet using a macro - displays a bar chart for results - again using COM calls to Excel as a COM object n Has an automatic order feature...

34 COM COM COM COM Warehouse Inventorycontroller Warehouse Excel(stats.xls) Demo Architecture - Part II ClientVC++ ClientVB

35 DCOM - a slight enhancement n Now in the real world, we want to be able to get services from servers - wherever they may be! n So let’s extend COM to be able to call interfaces on components located ON OTHER SYSTEMS! n In windows world, distribute DLLs easily n A natural application/extension of the RPC model between network nodes

36 What really happens now? Client COM library Service Control Manager (SCM) Registry Server COM library Service Control Manager (SCM) Registry Node A Node B

37 DCOM -how does it work? n Cooperation at the OS level between platforms n Requires platform OS implementations of –COM RunTime services –Registry –SCM (Service Control Manager), etc. n Several different models for distribution

38 Two Approaches to Distributing Components n Non-intrusive Distribution –uses existing components and clients n Explicit Distribution –requires client side changes

39 Non-intrusive Distribution n use clients and components as they exist n clients locate component servers through registry settings n registry can be set to point to remote servers n DCOMCNFG utility manages components - let’s see!

40 Non-intrusive Distribution Client Com Library SCM - Service Control Manager registry Server SCM - Service Control Manager registry Remote Server Information Node A Node B

41 Explicit Distribution n clients use COM library calls to create/locate server on specific remote node - I.e. CoCreateInstanceEx n COM bypasses local registry and communicates directly to SCM on remote node n Note: remote node server registry entry may itself point to another remote node!

42 Explicit Distribution Client Com Library SCM - Service Control Manager registry Server SCM - Service Control Manager registry Remote Server X Node A Node B

43 Explicit DCOM Code Visual Basic client Dim ICObj As Object ….. Private Sub Command1_Click() Set ICObj = CreateObject("DCOMDEMO.InventoryControllerServer", node1 ) …. Call ICObj.ProcessOrder(lPartNumber, lNumItems, lNumOrders, ucpResult, lpNumOrdersFilled)

44 DCOM DCOM DCOM DCOM Windows NT Server OpenVMS Warehouse Inventorycontroller Warehouse Warehouse Digital UNIX Solaris Demo built from released COM SDKs on platforms above Heterogeneous DCOM Demo Architecture Windows Client

45 Heterogeneous DCOM n Cross platform COM –Demo using shipping COM SDKs on: n Digital UNIX, OpenVMS, Solaris –UNIX platform support from Microsoft n Ship schedules n COM on Digital UNIX and OpenVMS –Developing COM enabled middleware n Architecture, core features, tools –Deploying COM enabled middleware n Support, schedules, resources

46 COM Platform Support n COM/UNIX and COM/OpenVMS 1.x –Solaris 2.5 - Microsoft (Shipping today) –Digital UNIX 4.0D - Compaq (In beta) –OpenVMS 7.2 - Compaq (In beta) –IRIX 6.5 - SGI n COM/UNIX and COM/OpenVMS future –Binary compat with COM 1.0 –Improvements based on customer feedback on COM 1.0 –Additional platform support

47 COM Platform Support n Microsoft COM for UNIX 2.0 (future) –Solaris 2.5 and up –HP-UX 11.0 –AIX 4.3 n Will be available from Microsoft n Technical support from Microsoft

48 COM Interoperability n Partnerships with Leading ORB vendors for CORBA interop –Iona and Visual Edge –Source code license agreements –Enable well tested interop products n Native OLEDB provider support –Intersolv

49 Windows NT NT Server identity Enterprise cluster Server Security NTLM security Events COM SSPI Domain RPC COM SSPI Interface RPC Windows NT identity COM APIs Registry Registry Software Architecture

50 COM Tools n Digital UNIX –Existing tools for code creation –Enterprise Toolkit available now –ATL in COM V1.x –Component Monitor Q1 1999 n OpenVMS –Existing tools for code creation –ATL in COM V1.x –Debugging/ performance tool from AverStar Spring 1999 –Enterprise Toolkit Spring 1999

51 Benefits of Heterogeneous DCOM n Preservation of platform-dependent legacy applications –through use of wrappers around apps n Cooperation between NT-based environments for operator interaction and mature backend systems n Careful design of new apps permit portability across platforms

52 COM/DCOM Resources n Books –Inside COM - Rogeson - MS Press - excellent –Essential COM - Box - language focussed –WROX series on COM n Microsoft COM – n Microsoft COM on UNIX –Program Manager: n Public COM on UNIX mailing list –Information at: dcomunix.html

53 Use of COM/DCOM: DNA n COM is just one piece of the DNA Architecture (Distributed interNetworking Applications) n Also - MTS, MSMQ, COM+, three tier design methodology with business objects on middle tier, etc. n Goal: Convergence and simplification of technologies over time n Then DNA for Manufacturing, Health,...

54 Acronyms and Misc. n DCOM = COM = OLE = ActiveX n ActiveX –Originally focused solely on developing internet control components –components - act as servers to clients –controls - used to build visual COM components –document - able to be placed on Web pages n Web Technologies also highly integrated –Active Server Pages (ASP) –Dynamic HTML (DHTML)


56 DNA Model

57 Two Dimensions of DNA n Cross Industry Support –Infrastructure Tools and Components n Industry Specific Integration –DNA for xxx

58 Primary DNA Tools and Components n COM - Component Object Model n DCOM - Distributed COM n MTS - Microsoft Transaction Server n MSMQ - Microsoft Message Queue System n COM+ - Next generation of DNA support n IIS - Internet Environment

59 A Microsoft COM Timeline o OLE - Object Linking and Embedding - of MS application objects within MS applications o COM - Component Object Model - Generalized infrastructure to improve communications between application components o DCOM - Distributed COM - between components on different systems and Operating Systems o ATL - Active Template Library - Tool that simplifies the creation of DCOM components improves calls to/from other DCOM objects o MTS - Microsoft Transaction Server o MSMQ - Microsoft Message Queue Management o COM+ - Buries DCOM/COM, MTS, and MSMQ structures and methods within Windows NT environment OLE COM DCOM COM+ ATL MTS MSMQ

60 OLE n Object Linking and Embedding n MS 1st attempt at using application components within other applications - especially in support of document integration n Biggest drawback initially –Different object models for each MS application (Word vs Excel) n OLE 2 - no longer Object … - just “OLE”

61 COM n Component Object Model = MS Application bus n Grand Unifying technology on Microsoft Platforms for application component communications n Big incremental improvement over OLE n Programming infrastructure for components to talk with each other n Provides for Interface interactions between components –over IDL (Interface Definition Language) calls, –using GUID (Globally Unique Identifiers) to identify components, and –uses LRPC to communicate between components n Synchronous by design*

62 COM = Interfaces n Collections of Method Definitions to access services from COM servers n Servers may implement one or more Interfaces - and may be DLLs or EXEs n All COM Servers MUST implement the IUnknown Interface - –which allows you to discover/access all the other interfaces on the same server (QueryInterface method)

63 Types of Interfaces n Custom Interfaces –Application responsible for defining unique callable methods –Clients must know method signatures –Unique call paths between client and server n “Automation” or IDispatch Interfaces –Universal single interface to get at all server services/methods –Single client-side contact - sorta! –Limitation on types of arguments, though

64 Using COM n Collection of Support Routines (Coxxxxx) –Initialize/shut down the local COM environment –Obtain Access to a COM server’s interfaces n Basic COM Model –Simpler on Client Side –Complicated for Creation/Mgmt of Objects on Server Side n Class Factories - additional objects needed n Implementing IUnknown Methods (object and class factory objects!) n Issues around shared server objects, multi- threaded, etc.

65 DCOM n Distributed COM or COM across a wire n Participating Components may now reside on different systems and use RPC for calls n Support provided for DCOM between non-heterogeneous platforms –Windows NT –OVMS –Digital UNIX –Sun Solaris

66 DCOM (cont.) n Clients can operate in ‘location- independent’ manner with servers n Registry can hold locations of servers and other COM stuff! n Newer Model supports Client accessing server on a specific node n DCOMCNFG and other utilities to help locate and manage the network of COM servers, objects, interfaces, type libraries, etc.

67 DCOM Demo n SAIE Developed the DCOM Demo of heterogenous interoperability for UNIX and VMS groups n Involved up to 9 systems on 3 different platforms executing almost identical server code n VC++ and VB front ends as clients n Real learning experience - but it worked!

68 COM/DCOM (Cont.) n Primary Drawback with COM/DCOM The current Visual C/C++ environment requires lots of cut-and-paste of objects and methods to define the infrastructure needed to support each application component The current Visual C/C++ environment requires lots of cut-and-paste of objects and methods to define the infrastructure needed to support each application component NOTE: VB and VJ++ bury most of the support infrastructure and are much more simplified environments in dealing with COM

69 ATL n Active Template Library n Tool simplifies the creation of COM/DCOM components in VC++ n Uses Application Wizards to simplify the creation process –Choose interface model –Choose Locking, Marshalling,... –ATL creates bulk of COM support n COM map and object map macros n Unfortunately not supported on other platforms yet

70 MTS n Microsoft Transaction Server –Runtime environment/infrastructure for application assembly and execution –Simplified application model - single user n Delivers needed server services –Distribution - through packages –Easy drag and drop assembly of packages and monitoring of execution –Transactionalization of components –Load balancing, thread pooling, database connection pooling, etc.

71 Inside MTS n All Current MTS Object/Servers must be DLLS n MTX server is the universal proxy for all MTS components on a given node n Intercepts calls for interface methods and can apply server services and transactional techniques before/after calling component methods

72 MTX and MTS Components MTS interceptor Your MTS component MyComp MTX - MTS controller MyComp client calls here IMyXface

73 MSMQ n Microsoft Message Queue System n Provides asynchronous between COM/DCOM Components n Typical API for en-queuing and de- queuing messages n Reliability guaranteed - but still a very new product and needs maturation

74 COM+ n Next generation(s) of building distributed applications using COM components n Support from within Windows 2000 (uncertain about other platforms) n Makes building COM-compliant components much easier n Submerges MTS, MSMQ, and COM services deep within the OS

75 DNA Development Tools n DevStudio Tools apply across the board –VC++ –VB6 –VJ++ –VisualInterDev –Frontpage n Can produce clients, servers, middle tiers, in mixed language systems

76 More Info? n n n n MSDN n MS Technical Journal n Dr. Dobbs & C/C++ Journal and VB mags too

77 MS/Industry Initiatives based on DNA n VCI/CIP - Value Chain Initiative n DNA for MFG/Automotive n OLE for Process Control (OPC) n DNA for Front Office (Trilogy) n DNA for Retail - E-office? n Rumors of –DNA for Pharmaceutical –DNA for Medical –DNA for Financial –...

78 VCI/CIP n Value Chain Initiative - consortium of companies agreeing to use DNA for managing business operations n CIP (Commerce Interchange Protocol) - a DNA-based message composition and delivery/receipt system - no workflow tool - yet! n Ongoing negotiations between Compaq and MS re VCI/Business Bus ‘integration’

79 DNA for MFG/Automotive n First instantiation of DNA for Mfg n Detroit-based Initiative (surprise!) n Recent MS Event n Attempting to define groupings of interfaces to represent information and control data flow within automotive industry n Embraces OPC as core ‘information model’

80 OPC n OLE for Process Control –set of standard OLE/COM interface protocols –based on MS COM technology –foster interoperability in the process control industry between n automation/control applications n field systems/devices n business/office applications

81 Applications working with OPC Servers/Components Application XApplication Y OPC Interface OPC Server A OPC Server B OPC Server C

82 The DNA Manufacturing Architecture ERP / MRP MES DCSBatch device CE device Smart device OAG BB CIP COM DCOM OPC / OLE DB HMI/SCADA PC Control OPCOPC OPCOPC CIPCIP process DB COM UI

83 OPC Opportunity n Field management - advent of “smart” field devices –provides wealth of field device data device health, config params, materials of construction,... n Process management –Distributed Control Systems (DCS) and SCADA monitors and controls the manufacturing process –makes process data available electronically n Business management - integrating process data and financial information related to process

84 Summary n DNA - a rich collection of (interchangeable) tools, technologies and methodologies for building three- tiered, distributed applications n Underlying COM models supports universal access to servers/services n Multi-platform support an issue n Some industry initiatives favoring DNA- based solutions

85 Questions?

86 MSMQ BusinessBus wrapper ERP wrapper MES Basestar wrapper Site Server CIP Site Server wrapper Document Management Shop Floor MES DNA - based components BaseStar(?)

87 BusinessBus Technology Layering BusinessBus API MSMQ transportBmQ, MQSeries transports NTUNIX, VMS, etc. API Layer Transport Layer Platforms Integration Manager Application Layer CIP Wrappers Applications

Download ppt "COM, DCOM Heterogeneous DCOM and Microsoft DNA Richard J. Bonneau, Ph. D. Systems Application Integration Engineering (SAIE) Industry Solutions Division."

Similar presentations

Ads by Google