• No results found

com.ppt

N/A
N/A
Protected

Academic year: 2020

Share "com.ppt"

Copied!
34
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

Unit Structure

About COM

COM Components

COM Architecture

COM Data types

(3)

Introduction to Distributed Objects

Categories of Distributed object architecture

Distributed Object Architecture

Remoting

Architecture Component

(4)

About COM…

Is a platform-independent, distributed,

object-oriented system for creating binary

software components that can interact

COM is the dominant component

architecture

Microsoft created the Component Object

(5)

About COM…

Provides the communication in a

completely

transparent

fashion:

It

intercepts calls from the client and

forwards them to the component in

another process

COM objects can be created with a

variety of programming languages

COM is implemented in a

(6)

COM is not ….

COM is not a computer language

COM does not compete with or replace

DLLs.

COM is not primarily an API or a set of

functions like the Win32 API

COM is also not a C++ class library like the

(7)

COM Evolution

1990’s – Microsoft’s OLE

Microsoft created the Component Object Model (COM)

to provide the infrastructure that was needed to realize

its vision for OLE

1996 - Microsoft ActiveX

ActiveX controls enables the developer to build

sophisticated controls based on the Common Object

Model (COM).

End of 1996 - Microsoft DCOM

a set of RPC-based extensions to COM that allow COM

objects to be distributed

Now -

COM architecture is deprecated by Microsoft’s .Net
(8)

Benefits

Application CustomizationComponent Libraries

Distributed Components

Component A

Component B

Remoting C

Remoting D

Netwo

rk

Component C

(9)

COM Components

Consist of executable code distributed either as

Win32 dynamic link libraries (DLLs) or as

executables (EXEs).

Are fully language independent

Any language can be modified to use COM

components, including Smalltalk and Visual Basic

Can be shipped in binary form

(10)

COM

The most fundamental question COM

addresses is:

(11)

To solve this problem…

It is necessary to find solutions for 4 specific

problems

Basic Interoperability

Versioning

Language Independence

(12)

Component Object Model (COM)

The Component Object Model (COM) is a component

software architecture that allows applications and

systems to be built from components supplied by

different software vendors

These services provide distinctly different functionality

(13)
(14)

Types of Servers

In-Process server

Implemented as a dynamic linking library (DLL)

that executes within the same process space as the

application

Local Server

Executes in a separate process space on the same

computer. Communication between an application

and a local server is accomplished by the COM

runtime system

Remote Server

Executes on a remote computer. DCOM extends

(15)

Client Application

In-Process Server (DLL)

Local Server

Remote Server

Computer A Computer B

COM

DCOM

(16)

COM Fundamentals

A Binary standard for function calling between

components

A provision for strongly-typed groupings of

functions into interfaces

A Base interface providing

Reference counting to allow components to track

their own lifetime

A mechanism to uniquely identify components and

their interfaces

A "component loader" to set up component

(17)

COM defines a standard way to lay out virtual function

tables (vtables) in memory, and a standard way to call

functions through the vtables

(18)

Interface

A COM interface is a strongly-typed

contract

between software components to provide a small

but useful set of semantically related operations

(methods)

All of the functionality that a component must

implement to be a drop target is collected into the

IDropTarget

interface

All the drag source functionality is in the

IDragSource

interface.

(19)

COM Data types : Base Types

IDL C Visual Basic Java

Boolean unsigned char Unsupported char

Byte unsigned char Unsupported char

Small char Unsupported char

Short Short Integer short

Long long Long int

hyper _int64 Unsupported long

float Float Single float

double Double Double double

Char Unsigned char Unsupported char

Wchar_t Wcgar_t integer short

enum enum enum int

(20)

COM Data types : Extended types

IDL

C

Visual Basic Java

VARIANT VARIANT

Variant

ms.com.Variant

BSTR

BSTR

String

Java.lang.String

BOOL

short [-1/0]

Boolean

[True/False]

boolean

(21)

Automation Data types

COM IDL Type Description

short 16-bit signed integer long 32-bit signed integer

float 32-bit signed floating point number double 64-bit floating point number

BSTR length-prefixed wide character array

VARIANT_BOOL short integer used to indicate true or false

DATE 64-bit floating point number representing the fractional number of days

(22)

A Distributed Object Example

Checking Account class

IAccount

IAccountInit

ICheckingAccount : IAccount

COM Object

COM Client COM Client

Deposit, Withdraw

Withdraw Using Cheque

(23)

Both COM and CORBA rely on client-side and server-side mechanisms to

manage issues related to remoting

These mechanisms are referred to as proxies and stubs in COM. In CORBA,

the mechanisms are referred to as stubs and skeletons

In COM, the proxy and stub are packaged in a single DLL. The DLL is

associated with the appropriate interfaces in the windows system registry.

The COM runtime system uses the registry to locate proxy-stub DLLs

associated with an interface when marshaling of the interface is required.

Client Client Stub (COM Proxy) (CORBA Stub) Server Server Stub (COM Stub) (CORBA Skeleton) Communication Bus (DCOM or CORBA)

(24)

Remote Method Invocation

A client invokes a remote method

The client stub creates a message containing information needed for the

remote invocation. (The message creation process is referred to as

marshaling.)

The client stub sends the message to the server stub using the

communication bus.

The server stub receives the message and unpacks it. (The unpacking

process is referred to as unmarshalling.)

The server stub calls the appropriate server method based on the

information provided in the received message

The server stub creates a message based on the outputs of the call to the

server method (i.e., the return value and out parameters).

The server stub sends the result message to the client stub using the

communication bus.

The client stub receives the result message, unpacks the message, and

(25)

Client

(Visual Basic or C++ Client)

Proxy

(ComServer.dll)

Client

(Visual C++ COM Server

Stub

(ComServer.dll)

COM/DCOM

RPC

COM/DCOM
(26)
(27)

COM uses LPC’s for communicating between

processes

LPCs are a means of communication between

different processes on the same machine based on

remote procedure call

(RPC)

RPCs allow applications on different machines to

communicate with each other using a variety of

network transport mechanisms.

Distributed COM (DCOM), uses RPCs to

communicate across the network

(28)

Client Proxy marshals parameters Component Stub unmarshals parameters P ro ce ss B ou n d ar y EXE EXE DLL DLL

(29)

Marshaling & Un-Marshaling

An interface named

IMarshal

has to be

implemented

COM queries your component for

IMarshal

as part

of its creation strategy

It then calls member functions in

IMarshal

to

marshal and unmarshal the parameters before and

after calling functions

COM library implements a standard version of

(30)

Client / Server Implementation

Creating the Component

The function CreateInstance created an instance of the component

and returned the IUnknown interface pointer to the client

Exporting a Function from a DLL

The name of the Library functions has to be listed by exporting in

the EXPORTS section of the file

Loading the DLL

The files CREATE.H and CREATE.CPP implement the function

CallCreateInstance

CallCreateInstance takes the name of the DLL as a parameter, loads

(31)

Advantages

COM forces the Operating System to act as a central registry for

objects

COM components are never linked to any application

Garbage Collection is one other major advantage to using COM.

When there are no outstanding references to an object, the COM object destroys itself

COM supports Marshalling COM is a binary standard

Disadvantages

Resiliency

COM/ActiveX RegistrationIsolated Components

(32)

AU Distance Education – DMC1754 - Middleware Technologies - Unit V

(33)

AU Distance Education – DMC1754 - Middleware Technologies - Unit V

(34)

AU Distance Education – DMC1754 - Middleware Technologies - Unit V

COM - Component Object Model

Defines a binary standard for component interoperability Is programming-language-independent

Is provided on multiple platforms

Provides for robust evolution of component-based applications

and systems

Is extensible by developers in a consistent manner

Uses a single programming model for components to communicate

within the same process, and also across process and network boundaries

Allows for shared memory management between components Provides rich error and status reporting

Allows dynamic loading and unloading of components

A software architecture that allows the components made by

different software vendors to be combined into a variety of applications

References

Related documents

Panel B illustrates the interaction between mtDNA haplogroups and APOE genotype on outcome, illus- trated by the 95% confidence interval of the collapsed Glas- gow Outcome Scale

Each grade level and subject may be organized into three distinct sets of instruction that include several weeks of Daily Lessons and Weekly Assessments (evaluations),

Contrary to adults where NHL is usually of low or intermediate grade, in children it is usually dis- seminated, diffuse not nodular, high grade, rapidly grow- ing, originating

In this thesis work, the process-based coupled hydrological model CATHY and the data assimilation methods EnKF and SIR are used to estimate the spatial distribution of

This study proposed to examine how a brain measure, specifically ERP response, was influenced by disgust sensitivity and how that could be moderated by ideological factors.. The

Moreover, exploiting capabilities such as concurrent multi- chat and robust, proxy-based cobrowsing, customer service organizations can drive down chat interaction costs,

Test 5, numerical solutions and corresponding contour plots obtained with CN − FDs − FDt approach on uniform grid at the cut planes z = 0.. Test 5, numerical solutions

Translation SYNC TCP 21874 Main Office Shared Server IP address Remote Site firewall public IP address Used in Avaya Communication manager Release 3.x for translation