1 COM/DCOM n Part of Project Presentation (Concept Outline)

28
1 COM /DCOM Part of Project Presentat ion (Concept Outline)
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    224
  • download

    3

Transcript of 1 COM/DCOM n Part of Project Presentation (Concept Outline)

Page 1: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

1

COM/DCOM

Part of Project Presentation (Concept Outline)

Page 2: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

2

Component Object Model (COM) and DCOM

Page 3: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

3

Overview

History of COM Introduction to the COM Specification DCOM Technical Overview Load balancing Microsoft Transaction Server Monikers DCOM vs CORBA Problems and the future of COM

Page 4: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

4

The Evolution of COM

Object Linking and Embedding (OLE1)Object Model (OLE2) (COM standard)ActiveX (Internet applications)Distributed interNet Applications (COM+)

Page 5: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

5

Page 6: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

6

COM Specification Foundations

Reusable component objects Binary standard for

interoperability “True” system object model Provides distributed

capabilities

Page 7: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

7

Object Interoperability

Stable versioning Rapid object interaction Location transparency Language independence

Page 8: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

8

“True” System Object Model

Globally unique identifiers (GUID)

Reusability and inheritance Single programming model Life-cycle encapsulation Object-level security

Page 9: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

9

Reusability Mechanisms

Containment/Delegation Aggregation

Page 10: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

10

Page 11: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

11

Page 12: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

12

Objects and Interfaces

Page 13: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

13

Page 14: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

14

Interfaces

An interface is a named table of function pointers (methods)

An interface is not a class An interface is not a COM

component COM clients only interact with

pointers to interfaces COM components can

implement multiple interfaces Interfaces are strongly typed Interfaces are immutable

Page 15: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

15

Object Creation and Access

IUnknown and QueryInterface

Page 16: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

16

Object Creation API

CoCreateInstanceEx : creates a single uninitialized object associated with the given CLSID on a specified remote machine.

CoCreateInstanceEx makes it possible to specify an array of structures, each pointing to an interface identifier (IID) on input, and, on return, containing (if available) a pointer to the requested interface and the return value of the QueryInterface call for that interface. This permits fewer round trips between machines.

The CoCreateInstanceEx helper function encapsulates three calls: first, to CoGetClassObjectCoGetClassObject to connect to the class object associated with the specified CLSID, specifying the machine location of the class; second, to IClassFactory::CreateInstance to create an uninitialized instance, and finally, to IClassFactory::Release, to release the class object.

Page 17: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

17

Connectable Objects and

Multicasting Connection point implementation using

Advise()

HRESULT Advise(

IUnknown *pUnk , //Pointer to the client’s advise sink

DWORD *pdwCookie //Pointer to the connection point identifier used by Unadvise );

Page 18: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

18

Page 19: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

19

DCOM Architecture

Client ComponentCOM

run-time

DCE RPC

LPC

COMrun-time

SecurityProvider

DCE RPC

LPC

SecurityProvider

Client ComponentCOM

run-time

DCE RPC

Protocol Stack

COMrun-time

DCOM network-protocol

SecurityProvider

DCE RPC

Protocol Stack

SecurityProvider

Page 20: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

20

Marshalling

Static balancing using a referral component Dynamic load balancing Marshalling (remoting): standard and

custom

Use custom marshalling when:

- a remote object itself is a proxy to some

other object

- the object’s state is in shared memory

(e.g. structured storage)

- an object’s state is immutable

(e.g. Monikers)

- batching remote calls into one

to optimize performance

Page 21: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

21

Component

Component

Component

Component

Component

Component

Component

ReferralComponent

Client

1. Requests connection 2. Creates connection to "best"component

3. Return connection to client

Referral

Comp DatabaseComponent

DCOMClient

Custom Proxy

Database

Snapshot/ Cache

Batching

Page 22: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

22

Custom Marshalling

Page 23: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

23

Scalability and Performance

Client

Client

Client

Client

Client

Client

Client

Client

Client

Business RuleComponent

Business RuleComponent

Business RuleComponent

"Bottleneck"Component

DatabaseComponent

Duplicated Servers Dedicated Server

Dedicated Server

Parameter Size 4 bytes 50 bytes

calls / sec ms / call calls / sec ms / call

"Pentium®,,” in-process 3,224,816 0.00031 3,277,973 0.00031

"Alpha™," in-process 2,801,630 0.00036 2,834,269 0.00035

"Pentium," cross-process 2,377 0.42 2,023 0.49

"Alpha," cross-process 1,925 0.52 1634 0.61

"Alpha," to Pentium remote 376 2.7 306 3.27

Page 24: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

24

Microsoft Transaction Server

MTS shelters developers from complex server issues such as concurrency, resource pooling, security, and context management

MTS provides run-time services for components

MTS ensures that transactions are atomic, consistent, have proper isolation and are durable

MTS components are those that execute in the MTS run-time environment

Page 25: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

25

Monikers

A moniker is a name for a specific object instance, that is, one particular combination of CLSID(GUID) and persistent data

Monikers are themselves COM objects which support an interface called Imoniker

Each moniker has its own persistent data; which includes all it needs to instantiate and initialize the single object instance which it identifies

Page 26: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

28

The Future of COM

Active Directory Services What is DNA? Implementation problems Summary

Page 27: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

29

COM+ Features

Transactions and transaction management Databinding Persistence Load balancing Security In-memory database Event infrastructure Ubiquitous type description Dynamic invocation Garbage collection Interception

Page 28: 1 COM/DCOM n Part of Project Presentation (Concept Outline)

30

References The Component Object Model Specification(Introduction)

Draft Version 0.9, October 24, 1995

Microsoft Corporation and Digital Equipment Corporation

Copyright © 1992-95 Microsoft Corporation.

http://www.microsoft.com/oledev/olecom/title.htm

DCOM Technical Overview

© 1996 Microsoft Corporation. All rights reserved

http://www.microsoft.com/activex/complus-f.htm

DCOM and CORBA Side by Side, Step by Step, and Layer by Layer

September 3, 1997 P. Emerald Chung Yennun Huang Shalini Yajnik

Bell Laboratories, Lucent Technologies, Murray Hill, New Jersey

Deron Liang Joanne C. Shih Chung-Yih Wang

Institute of Information Science, Academia Sinica, Republic of China, Taiwan

Yi-Min Wang, AT&T Labs, Research, Florham Park, New Jersey

Distributed Component Object Model (DCOM) Binary Protocol

Nat Brown and Charlie Kindel, Network Working Group

Microsoft Corporation, May 1996, Updated: November 1996

http://premium.microsoft.com/msdn/library/techart/f365/f36c/f380/d390/s1305c.htm

Inside OLE, 2nd Edition

Kraig Brockschmidt

Microsoft Press

Redmond WA 1995

The COM Programmer's Cookbook (great implementation guide)

Crispin GoswellMicrosoft Office Product Unit, Spring 1995, Revised: September 13, 1995

http://premium.microsoft.com/msdn/library/techart/f365/f36c/f380/d390/s8b24.htm