Fundamentals of COM Mary Kirtland Program Manager COM Team Microsoft Corporation.

Slides:



Advertisements
Similar presentations
Component Object Model
Advertisements

Copyright © 2003 Pearson Education, Inc. Slide 7-1 The Web Wizards Guide to PHP by David Lash.
J0 1 Marco Ronchetti - Basi di Dati Web e Distribuite – Laurea Specialistica in Informatica – Università di Trento.
Distributed Systems Architectures
What's a Proxy Printer Provider? PWG WIMS-CIM Working Group Rick Landau Dell, CTO Office 2008/08/08 v0.2.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
©2003 aQute, All Rights Reserved Tokyo, August 2003 : 1 OSGi Service Platform Tokyo August 28, 2003 Peter Kriens CEO aQute, OSGi Fellow
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
COM and.Net Components By Sam Nasr January 25,
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Overview Environment for Internet database connectivity
1 Communication in Distributed Systems REKs adaptation of Tanenbaums Distributed Systems Chapter 2.
Server Access The REST of the Story David Cleary
Qisheng Hong Yani Mulyani Paul Visokey
GETTING STARTED WITH WINDOWS COMMUNICATION FOUNDATION 4.5 Ed Jones & Grey Guindon.
YesTurnkey Network Application Switch Provider 1 RFID Applications for School Campuses Yuh-Rong Leu, Ph.D. CEO 9/1/2010 YesTurnkey Technology, Inc.
COM, DCOM and Software Components
COM: A Brief Introduction Dan Berger
31242/32549 Advanced Internet Programming Advanced Java Programming
Chapter 9: The Client/Server Database Environment
Executional Architecture
1 Chapter 11: Data Centre Administration Objectives Data Centre Structure Data Centre Structure Data Centre Administration Data Centre Administration Data.
25 seconds left…...
COM vs. CORBA.
Component Object Model (COM) A short introduction
OOMI A short introduction to Microsoft's Component Object Model (COM)
Intro to COM What is it and how do I use it?. Objectives Teach the fundamentals of COM. Understand the reason for using it. Learn to make a simple in-process.
OPC - OLE For Process Control Paul C. Shafer Bently Nevada Corp.
Hadar Vorenshtein & Meital Levy Instructor yavgeni Rivkin.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
1 COM/DCOM n Part of Project Presentation (Concept Outline)
Object Based Operating Systems1 Learning Objectives Object Orientation and its benefits Controversy over object based operating systems Object based operating.
COM: Microsoft's Component Object Model Andrew C. Hopkins CSCI 397C-16 Object Oriented Database Design and Management Professor Renee Renner.
Intro to COM What is it and what can it do for me?
DCOM Technology. What is DCOM? DCOM is just COM with a longer wire DCOM is just COM with a longer wire DCOM extends COM to support communication among.
DCOM Technology Şevket Duran Haşim Sak.
1 Modular Software/ Component Software 2 Modular Software Code developed in modules. Modules can then be linked together to produce finished product/program.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
CSC Proprietary 9/11/2015 2:16:16 AM 008_P2_CSC_white 1.
Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development.
COM vs. CORBA Computer Science at Azusa Pacific University September 19, 2015 Azusa Pacific University, Azusa, CA 91702, Tel: (800) Department.
DCOM (Overview) by- Jeevan Varma Anga.
Microsoft’s Distributed Component Object Model (DCOM) Jim Ries Updated 10/5/1999 A semi-technical overview.
COM/DCOM Implementation Basics of: Object creation and access Object Reuse Interface referencing.
OLE / COM Helia / Martti Laiho Sources: MSDN Kraig Brockschmidt: Inside OLE Orfali-Harkey-Erwards: Client/Server Survival Guide.
COM and DCOM CS 562 February 27, Motivation Data Analyzer Resource Monitor int compute (…) { } int compute (…) { } Data Analyzer int compute (…)
Introduction to COM and DCOM Organizational Communications and Technologies Prithvi N. Rao H. John Heinz III School of Public Policy and Management Carnegie.
CS 603 DCOM April 5, DCOM – What is it? Start with COM – Component Object Model –Language-independent object interface Add interprocess communication.
COMCOM omponent bject odel After this presentation, you will: Be Able To: Conceptual understanding of COM How it works, What it’s used for Decode Acronyms.
A COM implementation of the KSpace A ‘Knowledge Space prototype’ by Santhosh CST
OOMI From COM to DCOM.
Ni.com Understanding COM/ActiveX Jeff Paulter Staff Software Engineer Thurs Aug 17 10:15-11:30 a.m., 1:45-3:00 p.m. Ash (10A) Jeff Paulter Staff Software.
Introduction to COM and ActiveX Controls. What is an object? In the Fayad sense of the word.
OOMI A short introduction to Microsoft's COM From COM to DCOM.
GAM666 – Introduction To Game Programming ● DirectX is implemented as a collection of COM objects ● To use a DirectX program, the user must have the correct.
COM / DCOM Xiaolan Lu Mingzhen Wang Dong Xie. Why COM / DCOM?  Challenges facing the software industry  Component software provides a solution  General.
Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)
Component Object Model(COM)
Putting the Distributed into COM
Microsoft’s Distributed Component Object Model (DCOM)
Out-of-Process Components
COM: A Brief Introduction
COM: A Brief Introduction
Interpreter Style Examples
COM, DCOM and Software Components
Out-of-Process Components
Presented By Justas Raslanas
Presentation transcript:

Fundamentals of COM Mary Kirtland Program Manager COM Team Microsoft Corporation

Fundamentals of COM Slide 3 Agenda “Fundamentals of COM” “Fundamentals of COM”  components “Fundamentals of MTS” “Fundamentals of MTS”  distributed, component-based applications “COM+ Architecture” “COM+ Architecture”  future directions for COM, MTS

Fundamentals of COM Slide 4 Agenda Why COM? Why COM? Programming Model Programming Model Sample Code Sample Code Next Steps Next Steps

Fundamentals of COM Slide 5 Why COM? Imagine a world where developers can assemble applications from existing, reusable, pieces of code... Imagine a world where developers can assemble applications from existing, reusable, pieces of code...  “component” -- a reusable, binary, piece of software that provides a service Scenarios Scenarios  User-Interface Controls  Line-of-business applications  Manufacturing process control  etc...

Fundamentals of COM Slide 6 Component Architecture What would the requirements be? What would the requirements be?  component interoperability  Robust evolution (versioning)  Language independence  Location transparency  Scalability COM does all of these things! COM does all of these things! Tools choose how to expose COM Tools choose how to expose COM

Fundamentals of COM Slide 7 COM Fundamental Principles What the designers of COM were striving for... Binary components Binary components  Any programming language  Any location (in-process, cross-process, cross-machine)  No centralized authority Zero sacrifice in-proc performance Zero sacrifice in-proc performance Simplest model possible Simplest model possible  Enable extensibility and adaptability

Fundamentals of COM Slide 8 COM Principles Rigorous Encapsulation Rigorous Encapsulation  Black box -- no leakage of implementation details  All object manipulation through strict interfaces Polymorphism Polymorphism  via multiple interfaces per class  “Discoverable”: QueryInterface

Fundamentals of COM Slide 9 COM Programming Model Client Object 1 Object 2

Fundamentals of COM Slide 10 COM Identifiers text strings not unique, slow text strings not unique, slow Globally Unique Identifiers (GUIDs) are 128-bit integers Globally Unique Identifiers (GUIDs) are 128-bit integers  statistically guaranteed to be unique  each interface has a unique GUID (IID)  each class has a unique GUID (CLSID) GUIDs can be mapped to text strings GUIDs can be mapped to text strings

Fundamentals of COM Slide 11 Interfaces An interface is a group of related functions that specifies a contract An interface is a group of related functions that specifies a contract  once published, can never change  establishs a protocol for object communications Each interface is identified via an Interface Identifier or IID Each interface is identified via an Interface Identifier or IID /* IID 69B4985B-312D-11D1-835C-00C04FB957D8 */ interface IWordCount : public IDispatch { HRESULT CountWords(BSTR sentence, HRESULT CountWords(BSTR sentence, LPLONG words); LPLONG words); };

Fundamentals of COM Slide 12 IUnknown Every COM component must implement IUnknown Every COM component must implement IUnknown  all COM interfaces derive from IUnknown Provides... Provides...  object lifetime (AddRef, Release)  feature discovery (QueryInterface) interface IUnknown { HRESULT QueryInterface([in] REFIID riid, HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppv); [out, iid_is(riid)] void **ppv); ULONG AddRef(void); ULONG AddRef(void); ULONG Release(void); ULONG Release(void);};

Fundamentals of COM Slide 13 QueryInterface essential for multiple independent interfaces essential for multiple independent interfaces enables run-time discovery of features enables run-time discovery of features  component and client communicate in the richest way they share in common  New functionality can be added with full backwards compatibility

Fundamentals of COM Slide 14 QueryInterface (2) ObjectIUnknownISpeakMandarin ISpeakFrench Client A QI(ISpeakSpanish) QI(ISpeakFrench) Client B QI(ISpeakMandarin) Client C GetInterfaceListISpeakEnglishQI(ISpeakEnglish)

Fundamentals of COM Slide 15 Reference Counting Determines object’s lifetime Determines object’s lifetime All objects keep track of a ‘reference count’ All objects keep track of a ‘reference count’  AddRef increments by one  Release decrements by one  When the implementation of Release sees a reference count of zero it frees the object from memory

Fundamentals of COM Slide 16 COM Classes named, concrete implementation of one or more interfaces named, concrete implementation of one or more interfaces named by a Class Identifier, or CLSID named by a Class Identifier, or CLSID associate a class factory with every class associate a class factory with every class  implements IClassFactory  entrypoint to the class

Fundamentals of COM Slide 17 Creating Objects create a class factory and call IClassFactory::CreateInstance create a class factory and call IClassFactory::CreateInstance  each class factory creates one type of object COM APIs hide the details COM APIs hide the details  CoGetClassObject  CoCreateInstance, CoCreateInstanceEx

Fundamentals of COM Slide 18 Component COM Programming Model Client ClassFactory IClassFactory IUnknown RegistrationPackaging Object

Fundamentals of COM Slide 19 Where can a component live? Client In-Process Component (DLL) LocalComponent(EXE) RPC Direct function Calls “Marshaling” across process boundary via RPC “Marshaling” across machine boundary via networked RPC Remote Component on another machine RPC RPCRPC

Fundamentals of COM Slide 20 COM Runtime The COM Runtime [D]COM Registry Pluggable Security (SSPI) NTLM Kerberos Pluggable Transports DCE MS-RPC TCPUDPIPXTunneled TCPETC... Core Services (Monikers, Storage, Data Transfer,...) Components and Applications

Fundamentals of COM Slide 21 COM Runtime COM library exposes the COM API to applications and provides several default implementations COM library exposes the COM API to applications and provides several default implementations  Implemented as OLE32.DLL Service Control Manager (SCM) starts server processes/loads server DLLs at activation-time Service Control Manager (SCM) starts server processes/loads server DLLs at activation-time  Implemented in OLE32.DLL/RPCSS.EXE

Fundamentals of COM Slide 22 The SCM starts server processes and loads DLL implementations at activation-time starts server processes and loads DLL implementations at activation-time finds desired object and gets out of the way finds desired object and gets out of the way For inprocess objects, no third-party is involved in client->object communications For inprocess objects, no third-party is involved in client->object communications For out-of-process objects, a client-side proxy sends packets to a server-side stub For out-of-process objects, a client-side proxy sends packets to a server-side stub

Fundamentals of COM Slide 23 Sample Code “Island Hopper” util_WordCount (ATL, C++) util_TakeANumber (VB)

CustomersInvoicesAdsCategoriesTakeaNumber Island Hopper MTS Classifieds bus_Ad db_Ad db_Category Accounting bus_Customer db_Customer bus_Invoice db_Invoice App. Utilities Util_Takeanumber Util_TNUpdate Util_Wordcount

Fundamentals of COM Slide 25 Next Steps Automation Automation  IDispatch  Type Libraries Monikers Monikers Persistence Persistence  IStorage, IStream Remoting Remoting  DCOM  Security  Threading

Fundamentals of COM Slide 26 Call To Action Use COM to build component-based applications today Use COM to build component-based applications today Understand the programming model and what your tools do for you Understand the programming model and what your tools do for you Use resources to learn more about COM Use resources to learn more about COM

Fundamentals of COM Slide 27 Resources On the web… On the web…   In print… In print…  “Understanding ActiveX and OLE” (David Chappell, MSPress)  “Inside COM” (Dale Rogerson, MSPress)  “The Component Object Model” (Don Box, Addison-Wesley)  “Professional DCOM” (Richard Grimes, WROX)