seminarium on component-based software engineering feraaz imami liacs – leiden university fall...
TRANSCRIPT
Seminarium onComponent-based Software Engineering
Feraaz ImamiLIACS – Leiden UniversityFall 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
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.
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
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
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.
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.
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.
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.
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.
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
11/11/2005 Seminar Component Based Software Engineering
12
Questions ?Questions ?