120 likes | 144 Views
Dive into Component Object Model (COM) and its role in software engineering, covering topics like binary software components, interoperability, object reuse, versioning, object creation, monikers, and services. Explore COM interfaces, QueryInterface, object reuse techniques, versioning strategies, and services like compound documents and OLE.
E N D
Seminarium onComponent-based Software Engineering Component Object Model (COM) Feraaz Imami LIACS – Leiden University Fall 2005
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 Seminar Component Based Software Engineering
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. Seminar Component Based Software Engineering
COM – Multiple Interfaces • Com component is free to contain implementations for any number of interfaces. • Multiple interfaces • IDL ex. page 333 • Avoid versioning problem; Logical immutable Seminar Component Based Software Engineering
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 Seminar Component Based Software Engineering
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. Seminar Component Based Software Engineering
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. Seminar Component Based Software Engineering
COM object creation • COM, Class Instance, GUID, CLSID. • The Com library provides a way for clients to start an object server. Seminar Component Based Software Engineering
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. Seminar Component Based Software Engineering
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. Seminar Component Based Software Engineering
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 Seminar Component Based Software Engineering
Questions ? Seminar Component Based Software Engineering