Introduction to the Common Object Model
Welcome to COM Fundamentals II. In this course, we will expand on the concepts covered in COM Fundamentals I.
Specifically, we will study COM's (Common Object Model's) reuse mechanisms, containment/delegation and aggregation.
Our course projects will involve creating two new COM objects that reuse the
PhBookObj object developed in the COM Fundamentals I course.
In the first project, we will create an in-process COM object called
Memo, implemented in COM server
PhBookObj via containment/delegation.
In the second project, we will create COM object
MemoAgg, in server
InfoMgrAgg, that reuses
PhBookObj via aggregation and also implements interface
Additionally, we will develop a COM client called
InfoMgrCli that uses both our new COM objects:
By the end of this course, you will be able to:
- Understand source code and binary-level reusability
- Understand COM's reusability mechanisms
- Understand containment/delegation
- Develop a COM object that reuses another COM object via containment/delegation
- Understand aggregation concepts
- Develop a COM object to support aggregation
- Develop a COM object that aggregates another COM object
- Develop a COM client that uses composite COM objects built from containment/delegation and aggregation
Microsoft's Component Object Model (COM) is a system for reusing software artifacts at the post-compilation level or binary level .
Using COM, one or more computational functionalities of a component can be made available through a system call and through constructs called interfaces.
A client of a component, for example a program that needs the functionalities of the component, is served through a protocol called interface negotiation.
Several components may be combined into one component using the aggregation method to put all or part of the functionalities of
the constituent components into the new component.
Component Object Model provides a facility to reuse software artifacts. Several programs running on a system (a personal computer running a Windows 10 operating system) can
share loaded COM software (called a server) to get a number of computational processes.
The source code of the program may be from different programming languages.
There are several ways to reuse software artifacts including
- reusing source code,
- reusing flowcharts or diagrammatic expression, and
- reusing concepts.
The stated cases of artifact reuse can be categorized as the pre-compilation ones. Reusing a .dll or a .exe file is a case of reuse at the binary level for software artifacts. A change in a non-COM .dll or .exe library usually requires a significant amount of work for adjusting it to a specific a client. COM, a standard of reusing software artifacts at the binary level, helps reduce the amount of such adjustments at a client side.