160 likes | 379 Views
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
E N D
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 • OLE Controls, OCX 1994 • ActiveX 1996 • DCOM 1996 • COM+ 1997 • Distributed interNet Application Architecture (DNA) 1997
Object type ClassName ========= properties ... ------------ events … ------------ methods … Property Get <property> - read property Property Let <property> - write property Property Set <property> - assigns child objref to property Initialize Interfaces Declared using Interface Definition Language (IDL)
DCOM Server IUnknown - QueryInterface - AddRef - Release DCOM Server Interface - Get/Let/Set methods - set of methods Class - properties - events - methods (functions) IClassFactory(2) - CreateInstance - LockServer - GetLicInfo - RequestLicKey - CreateInstanceLic ClassFactory .EXE or .DLL
Creating an Object IUnknown - QueryInterface - AddRef - Release Client Instance - properties - vtable of methods DCOM Server Class - properties - events - methods (functions) IClassFactory(2) - CreateInstance - LockServer - GetLicInfo - RequestLicKey - CreateInstanceLic ClassFactory
collection =========== ------------ ------------ methods: Add Count Item Remove Collection(0) or Collection.item(1) Object instance Collection.item(2) . . . Collection.item(count) Collection and Member indexing
Collection Methods colObj colObj.Remove colObj.item(..) colObj.Count colObj.Add colObj.Clear
Type Library & Instance Object Type (class factory) Dim objRef As New <ObjectType> or Set objRef = CreateObject("< ObjectType >" ) COM Object Reference is an interface pointer to an object caller Object Object instance objRef
Kraig Brockschmidt: Inside OLE, 1995 OLE Technologies OLE Controls OLE Documents In-Place Activation (Visual editing) Linking Property Pages Events Property Change Notification Embedding OLE Automation Drag and Drop Uniform Data Transfer Naming and Binding Connectable Objects Persistent Objects Type Information Structured Storage Component Object Model: Objects and Interfaces
Object Linking and Embedding Linked object Source object Embedding a copy Linking the object Document1 Document2 Document1 Document2 emb. obj emb. obj
Kraig Brockschmidt: Inside OLE, 1995 Automation Object Hierarchy (container) Application - Open - Save - Close Documents collection Enumerator Document Hierarchy of ... Objects collection Enumerator Object Rich properties collection Enumerator Rich property i.e. Font
Object Path Parent Type ------------------- Child Type ------------------- properties methods Parent Object Child Object Parent.Child.Method [arguments]
DCOM Server Client Object proxy Stub Actual object RPC
Evolution of Component Services Inside COM+ COM+ Load balancing In-memory databases Object pooling Queued components Event model Administration extensions Microsoft Transaction Server Transaction services Resource pooling Just-in-time activation Role-based security Administration Distributed COM Remoting architecture Distributed component services COM Interface-based programming Basic component facilities