ole / com

14
OLE / COM Helia / Martti Laiho Sources: MSDN Kraig Brockschmidt: Inside OLE Orfali-Harkey-Erwards: Client/Server Survival Guide

Upload: emery-joseph

Post on 30-Dec-2015

33 views

Category:

Documents


3 download

DESCRIPTION

OLE / COM. Helia / Martti Laiho. Sources: MSDN Kraig Brockschmidt: Inside OLE Orfali-Harkey-Erwards: Client/Server Survival Guide. OLE History. OLE 1.0 1990 Compound documents Object Linking and Embedding (OLE) OLE 2.0 1993 Component Object Model (COM) OLE Automation - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: OLE / COM

OLE / COMHelia / Martti Laiho

Sources:MSDNKraig Brockschmidt: Inside OLEOrfali-Harkey-Erwards: Client/Server Survival Guide

Page 2: OLE / COM

OLE History

• OLE 1.0 1990– Compound documents

– Object Linking and Embedding (OLE)

• OLE 2.0 1993– Component Object Model (COM)

– OLE Automation

• OLE Controls, OCX 1994

• ActiveX 1996

• DCOM 1996

• COM+ 1997

• Distributed interNet Application Architecture (DNA) 1997

Page 3: OLE / COM

Object type

ClassName=========properties...------------events…------------methods…

Interfaces

Property Get <property> - read propertyProperty Let <property> - write propertyProperty Set <property> - assigns child objref to property

Initialize

Declared using Interface Definition Language (IDL)

Page 4: OLE / COM

DCOM Server

DCOM Server

Class- properties- events- methods (functions)

Class- properties- events- methods (functions)

ClassFactoryClassFactoryIClassFactory(2)- CreateInstance- LockServer- GetLicInfo- RequestLicKey- CreateInstanceLic

IUnknown- QueryInterface- AddRef- Release

Interface- Get/Let/Set methods- set of methods

.EXE or .DLL

Page 5: OLE / COM

Creating an Object

IClassFactory(2)- CreateInstance- LockServer- GetLicInfo- RequestLicKey- CreateInstanceLic

DCOM Server

Class- properties- events- methods (functions)

Class- properties- events- methods (functions)

ClassFactoryClassFactory

IUnknown- QueryInterface- AddRef- Release

Client Instance- properties

- vtable of methods

Instance- properties

- vtable of methods

Page 6: OLE / COM

Collection and Member indexing

collection===========

------------

------------methods:AddCountItemRemove

Object instanceObject instance

. . .

Collection.item(1)

Collection.item(2)

Collection.item(count)

Collection(0) or

Page 7: OLE / COM

Collection Methods

colObj

colObj.Add

colObj.Clear

colObj.Remove

colObj.Count

colObj.item(..)

Page 8: OLE / COM

Type Library & Instance

Object Type

(class factory)

ObjectinstanceObject

instance

callerObjectcallerObject

Dim objRef As New <ObjectType>or Set objRef = CreateObject("< ObjectType >" )

objRef

COM Object Reference is an interface pointer to an object

Page 9: OLE / COM

OLE TechnologiesOLE ControlsOLE Controls

In-Place Activation(Visual editing)

In-Place Activation(Visual editing)

LinkingLinking PropertyPages

PropertyPages EventsEvents Property Change

NotificationProperty Change

NotificationEmbeddingEmbedding

Drag and DropDrag and Drop

UniformData Transfer

UniformData Transfer

Persistent ObjectsPersistent Objects

Structured StorageStructured Storage

ConnectableObjects

ConnectableObjects

Type InformationType Information

Component Object Model: Objects and InterfacesComponent Object Model: Objects and Interfaces

OLE AutomationOLE Automation

Naming and Binding

Naming and Binding

OLEDocuments

Kraig Brockschmidt:Inside OLE, 1995

Page 10: OLE / COM

Object Linking and Embedding

Document1 Document2

Linkedobject

Document1 Document2

emb. obj

Sourceobject

emb. obj

Embedding a copyLinking the object

Page 11: OLE / COM

Automation Object Hierarchy

Application

Documentscollection

Document

Object

Rich propertiescollection

Objectscollection

Rich property

Enumerator

Enumerator

Enumerator- Open- Save- Close

Kraig Brockschmidt:Inside OLE, 1995

(container)

i.e. Font

Hierarchy of ...

Page 12: OLE / COM

Object Path

Child Type-------------------propertiesmethods

ChildObjectChildObject

Parent Type-------------------

ParentObjectParentObject

Parent.Child.Method [arguments]

Page 13: OLE / COM

DCOM

ClientClient ObjectproxyObjectproxy

ServerServer

StubStub ActualobjectActualobject

RPC

Page 14: OLE / COM

COM+Load balancing

In-memory databasesObject pooling

Queued componentsEvent model

Administration extensions

Evolution of Component Services

Microsoft Transaction ServerTransaction servicesResource poolingJust-in-time activationRole-based securityAdministration

Distributed COMRemoting architectureDistributed component services

COMInterface-based programmingBasic component facilities

Inside COM+