Introduction to COM Part I - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Introduction to COM Part I

Description:

COM and MSMQ / Chapter 2 / 5 of 23. Component Object Model (2) ... COM and MSMQ / Chapter 2 / 11 of 23. Attributes of Interfaces. An Interface is not a class ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 24
Provided by: sac670
Category:

less

Transcript and Presenter's Notes

Title: Introduction to COM Part I


1
Chapter 2
  • Introduction to COM (Part I)

2
Objectives
  • Describe the COM Architecture
  • Discuss Anatomy and benefits of an Interface
  • Discuss the standard COM interface
  • The IUnknown Interface
  • Describe different types of Component Packaging
  • In-process Server
  • Out-of-process Server
  • Remote Server
  • Discuss the terminologies associated with COM
  • HRESULT
  • GUID

3
Component Object Model
Elements of COM
4
Component Object Model (1)
Advantages
  • Fully language-independent

Supports version compatibility
Provides Location Transparency
5
Component Object Model (2)
COM does not compete with technologies like DLL
it uses them extensively
Highlights
COM is not a programming language it is a set of
specification
COM is not an API it is a way to develop
component-oriented application
6
Component Object Model (3)
  • Features
  • Creation and use of reusable component objects
  • A binary standard for interoperability
  • A true system model
  • Provides distributed objects

7
COM Application Architecture
8
Interface
An Interface not only defines how two components,
or a client and a component will talk to each
other but also helps in hiding the business logic
used for developing the object.
9
COM Object with Interfaces
Standard Representation
10
Using Interfaces With COM Components
Advantages
Reusable application architectures
Hidden internal implementation of the component
Language independence for developing the component
11
Attributes of Interfaces
  • An Interface is not a class
  • An Interface is not a component object
  • Interfaces are immutable
  • Clients interact only with the pointers to the
    Interfaces
  • Components can implement multiple interfaces

12
IUnknown Interface
The IUnknown interface helps the client
application to scan for other interfaces
available in the component and get their
pointers.
13
Component Packaging Types
In-process server
  Out-of-process server
Remote server
14
In-Process Server
In-proc Object
In-proc Server
Client Application
Client Process
The in-proc servers are implemented in the form
of a DLL.
15
In-process Server (1)
Advantages
Saves memory space
Saves disk space
Upgradations are easy
Supports multiple languages
16
Out-of-Process Server
The out-of process servers are implemented in the
form of an EXE.
17
Out-of-Process Server (1)
Advantages
Crash protection
Support for User Interface
18
Out-of-Process server (2)
Drawbacks
Slow responsiveness
19
Remote Server
Remote Machine
Client Machine
The remote servers are implemented in the form of
either EXE or DLL.
20
Remote Server (1)
Advantages
A single component can be shared by multiple
client applications running on multiple systems
The components can be upgraded very easily
It forms the basis for component based
distributed client/server architecture
21
Remote Server (2)
Drawbacks
Slow responsiveness
22
HRESULT
The call may or may not be successful
Processing is carried out further depending on
the HRESULT value
23
Globally Unique Identifiers
Just as a vehicle or a passport have unique
numbers for identification, components also have
unique ids called Globally Unique IDentifiers
(GUID)
Write a Comment
User Comments (0)
About PowerShow.com