Top Banner
Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)
12

Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

Jan 18, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

Seminarium onComponent-based Software Engineering

Feraaz ImamiLIACS – Leiden UniversityFall 2005

Component Object Model (COM)

Page 2: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

2

Introduction: COM

Binary software components Foundation for higher-level software services

Example OLE, Compound documents, custom controls, inter-application scripting, data transfer etc.

Com, developing and supporting program component objects. Dynamic Link library Interoperability and reusability

Page 3: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

3

COM

Com is a binary standard. defines an interface,

pointer to an interface node

Basis for interoperability. Point of contact is the runtime binary represent.,

C, C++, SmallTalk, Ada, and BASIC.

Page 4: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

4

COM – Multiple Interfaces Com component is free to contain implementations for

any number of interfaces. Multiple interfaces

Avoid versioning problem; Logical immutable

IDL ex. page 333

Page 5: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

5

QueryInterface How does a client access the other

interfaces on that same object? IID – Interface Identifier IUnknown

QueryInterface AddRef Release.

AddRef, Release used in reference counting

Page 6: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

6

COM object reuse Containment/Delegation: The outer object

behaves like an object client to the inner object.

Aggregation: The outer object wishes to expose interfaces from the inner object as if they where implemented on the outer object itself.

Page 7: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

7

Versioning A good versioning mechanism allows system

component be upgraded without requiring all the system components to be upgraded.

QueryInterface allows an object to make more interfaces (that is, new groups of functions) available to new clients while at the same time retaining complete binary compatibility with existing client code.

Page 8: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

8

COM object creation COM, Class Instance, GUID, CLSID. The Com library provides a way for clients to

start an object server.

Page 9: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

9

Monikers, storage and persistence

Structured storage and persistence: Com objects need a way to store their data when they are running.

Monikers: Clients often require a way to allow them to connect to the exact same object instance with the exact same state at a later point in time.

Page 10: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

10

COM services Uniform data transfer: UDT is a important

mechanism in any component-based software. Ex. OLE

Dispatch Interfaces: Includes the method invoke that can invoke other methods.

Dual interfaces: Access methods as either dispInterface methods or vtables methods.

Connectable Objects: This enables two-way communication between the client and the component.

Page 11: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

11

Compound Documents and OLE Documents that contain a document

from a different application within itself. Excel spreadsheet that is contained within a

larger Word document OLE, Object Linking and Embedding

Specially designed for compound documents.

OLE builds on COM provide services such as object "linking" and

"embedding" that are used in the creation of compound document

Page 12: Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)

11/11/2005 Seminar Component Based Software Engineering

12

Questions ?Questions ?