1 ООПРС Лекция 1 COM Технологии. 2 COM технологии COM е патентована технология на Microsoft Corporation въведена през 1993 г. и изградена около платформата.

Slides:



Advertisements
Similar presentations
Component Object Model
Advertisements

Лекция 9 I/O Управление и Disk Scheduling. Roadmap  I/O Devices  Organization of the I/O Function  Operating System Design Issues  I/O Buffering 
COM vs. CORBA.
Creating Vector Graphics in the Web Learning & Development Telerik Software Academy.
Telerik Software Academy ASP.NET MVC.
18-19 March 2011, Gabrovo, Project No: BG 051 PO /13 Подкрепа на творческото развитие на докторанти……..” Institute of Information and Communication.
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.
Middleware Fatemeh Hendijanifard 1 آزمايشگاه سيستم هاي هوشمند (
University of Genoa Course of Software Engineering II 01-02
Eclipse + Android SDK, VS + Windows Phone SDK Telerik Software Academy Hybrid Mobile Applications.
Welcome to the JSON-stores world Learning & Development Telerik Software Academy.
Eclipse + Android SDK, VS + Windows Phone SDK Svetlin Nakov Telerik Software Academy academy.telerik.com Technical Trainer
Things you need to know George Georgiev Technical Trainer GeorgeAtanasov George Atanasov Front-End Developer.
Intro to COM What is it and what can it do for me?
Group Policy Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator
Екскурзия в света на мобилните приложения с.NET Compact Framework Руслан Трифонов RIT Software
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.
CSIS0402 System Architecture Distributed Computing - Middleware Technology (2) K.P. Chow University of Hong Kong.
Oracle External Procedure Calls Теодор Иванов Софтуерен инженер.
Telerik Software Academy ASP.NET MVC.
Design Patterns that ease the design by identifying a simple way to realize relationships between entities. Antony Jekov Telerik Software Academy academy.telerik.com.
Разширеното разбиране за интерфейси (вкл. в.NET) * Когато не искаме да реализираме наследство на типове, но общ договор за поведение. * CLR поддържа единично.
COM vs. CORBA Computer Science at Azusa Pacific University September 19, 2015 Azusa Pacific University, Azusa, CA 91702, Tel: (800) Department.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Other Topics RPC & Middleware.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
Microsoft’s Distributed Component Object Model (DCOM) Jim Ries Updated 10/5/1999 A semi-technical overview.
OLE / COM Helia / Martti Laiho Sources: MSDN Kraig Brockschmidt: Inside OLE Orfali-Harkey-Erwards: Client/Server Survival Guide.
OOMI From COM to DCOM.
Google APIs and Facebook API Ivaylo Kenov Penka Borukova Telerik Corporation Telerik Academy Students.
Amazon RDS (MySQL and Oracle) and SQL Azure Emil Tabakov Telerik Software Academy academy.telerik.com
What is C++, Features, IDEs
Academy.telerik.com Class of , Fall 2013.
Google APIs and Facebook API Ivaylo Kenov Penka Borukova Telerik Corporation Telerik Academy Students.
Telerik Software Academy ASP.NET Web Forms.
What are WinJS and WinRT, Using the APIs in JavaScript George Georgiev Telerik Software Academy academy.telerik.com Technical Trainer itgeorge.net.
The True power of dynamic web pages Learning & Development Team Telerik Software Academy.
CS551 - Lecture 11 1 CS551 Object Oriented Middleware (III) (Chap. 5 of EDO) Yugi Lee STB #555 (816)
George Georgiev Telerik Software Academy academy.telerik.com Technical Trainer itgeorge.net Using and creating Promises and Web Workers.
Build a simple UI for your application Learning & Development Team Telerik Software Academy.
Xamarin with SQLite Telerik School Academy Xamarin apps for iOS, Android & WinPhone.
Describe ways to assemble objects to implement a new functionality Telerik Software Academy High-Quality Code.
Ivaylo Kenov Telerik Software Academy Technical Assistant.
COM / DCOM Xiaolan Lu Mingzhen Wang Dong Xie. Why COM / DCOM?  Challenges facing the software industry  Component software provides a solution  General.
Process and Writing Styles Tina Stancheva Doroteya Agayna Telerik Software Academy academy.telerik.com Writing Documentation.
The PhoneGap History Doncho Minkov Telerik Software Academy Technical Trainer
Seminarium on Component-based Software Engineering Feraaz Imami LIACS – Leiden University Fall 2005 Component Object Model (COM)
Building Rock-Solid Software Svetlin Nakov Telerik Software Academy Manager Technical Training
Remote Method Invocation by James Hunt, Joel Dominic, and Adam Mcculloch.
The way of the ViewModel and the Binding Learning & Development Telerik School Academy.
Installation, Sample Usage, Strings and OOP Telerik Software Academy Software Quality Assurance.
In JavaScript Learning & Development Telerik Software Academy.
Virtualization Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator
Cross-platform mobile development. Simplified. Pavel Kolev Telerik Software Academy Software Developer
Monitoring Server Performance Organizing Your Support Model Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator
Windows Administration Course Overview Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator
Automating Windows Deployment Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator
Serving HTTP requests Learning & Development Telerik School Academy.
SaaS Cloud Platform Providing Database Access Through RESTful API Learning & Development Telerik Software Academy.
Shared Application Telerik School Academy Xamarin apps for iOS, Android & WinPhone.
Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator Marian Marinov CEO of 1H Ltd.
Store Apps, Development Tools, App key features George Georgiev Telerik Corporation Technical Trainer itgeorge.net.
Server Roles and Features Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator
1 Copyright 2007 MySQL AB The World’s Most Popular Open Source Database MySQL Proxy WebTech 2007 Варна, България 29-ти Юни 2007 Aндрей Христов.
File and Print Services Borislav Varadinov Telerik Software Academy academy.telerik.com System Administrator
Internet Information Server (IIS) Security. Table of Contents Brief History of Internet Information Server (IIS) IIS Architecture HTTP.SYS Processing.
Java Programming: JDBC Vyacheslav Grebenyuk CTDE, AI dept., KhNURE.
RMI (Java RMI) P 460 in text UUIDs / system wide references Transparent: all objects either by ref. or by value. Not efficient, especially int, bool, etc.
E NGLISH Topic: HARDWARE, SOFTWARE, AND FIRMWARE (Оборудование, программное обеспечение и прошивка)
Microsoft’s Distributed Component Object Model (DCOM)
N:\DOC\4M\lekcii\3_5Бази от данни.ppt
Presentation transcript:

1 ООПРС Лекция 1 COM Технологии

2 COM технологии COM е патентована технология на Microsoft Corporation въведена през 1993 г. и изградена около платформата Windows.

3

4

5 Генезис на COM и промени в технологиите Обекти за вграждане и свързване (OLE) Конвенционални GUI базирани ОС, Windows Динамичен обмен на данни (DDE) Обектно-ориентирано програмиране (ООП) Component Object Model(COM) Разпределени COM (DCOM) COM +

6 clipboard DDE OLE COM 1/2 Интегритет м/у приложенията. Комуникация м/у тях

7 2/2 DLL : зависимост от разположението. Зависимост от езика с COM технологията се решават тези проблеми повишена защита поддържа възможност за множество потребители поддържат DB connection pool DLL и COM

8 COM Терминология Class Object Component Interface Object – combination of code and data that can be treated as a unit Component – reusable piece of executable code that can be used with other applications with minimum efforts; could be.EXE,.DLL or.OCX Interface – set of functions grouped together under one name; COM can support more than one interface DLL – dynamic link library is a highly reusable component that can communicate with objects in client/server application GUID – globally unique identifiers are 128 bit integers used to identify every interface and component object class

9 Interface Definition Language [ object, uuid( E7CD0D CF ) ] interface ISpellChecker : IUnknown{ import “unknown.idl”; HRESULT LookUpWord( [in] OLECHAR word[31], [out] boolean *found ); HRESULT AddToDictionary( [in] OLECHAR word[31]); HRESULT RemoveFromDictionary( [in] OLECHAR word[31]); }

10 Обекти и интерфейси Интерфейсът е набор от семантично свързани функции, реализирани в определен обект. Това включва прототип или сигнатура. Използването (instantiation) става, когато интефейсът е реализиран и е изработен указател към масив от указатели към функциите му: обект на потребителя указател към fn1() обект pInterface указател към fn2() реализация на интерфейса

11 обекти и интерфейси интерфейс А Потребителски Обект (компонент) pInterfaceA Реализация на Интерфейса А потребителски достъп до функцииобект с обект на интерфейс А интерфейси Реализация на интерфейса Б Вътрешни Данни На обета A Б Обект, поддържащ 2 интерфейса A::QueryInterface() COM обект

12 таблица от указатели към IUnknownкъм друг интерфейс QueryInterface() QueryInterface() Release() Release() AddRef() AddRef() *fn1() *fn2() Базов интерфйсПроизволен интерфейс с 2 собствени метода Намираме се в 1 компонент

13 Interface IUnknown Всеки COM интерфейс и COM компонент трябва да реализира стандартния интерфейс IUnknown:

14 На Windows ниво COM обект се създава обикновено чрез извикване на API функцията CoCreateInstanse, която създава обект и връща указател към него от тип IUnknown, чийто вътрешен брояч е със стойност 1. Ако подадем този указател на друг клиент, той трябва да увеличи брояча му, извиквайки метода AddRef. Когато обектът повече не е необходим, се извиква неговия метод Release, който намалява брояча с единица и автоматично проверява дали е станал нула (т.е. дали това е бил последният активен интерфейс към обекта). Ако това е така, то самият обект се самоунищожава. Когато клиентът иска да работи с друг интерфейс на обекта, той извиква метода му QueryInterface с аргумент идентификатора на искания интерфейс. Ако обектът може да му го предостави му връща указател и увеличава брояча си с единица. Трябва да подчертаем, че COM клиентът никога не получава указател към истинския обект, а винаги указател към интерфейс, който е наследник на IUnknown.

15 Software Tools Basic and Visual Basic Visual FoxPro C, C++ and Visual C++ Small Talk Ada Visual J++

16 Component Object Library Registration DB Application CLSID DLL.EXE Creating a component object CLSID

17 Cient Application In-Process Object Local Object Proxy Client Process In-Process Server Remote Object Proxy Stub Local Object Local Server Process COM Local Server RPC Remote Machine Stub COM Remote Object Remote Server Remote Server Process RPC COM

18 Client Application COM Object Server 1) Create Object 2) Locate Implementation 4) Call interface members 3) Get object interface pointer return to client What happens when a client wishes to create and use a COM object?

19 When an application uses a COM object: 2) calls CoCreateInstance (exported by COMPOBJ.DLL) passing the CLSID of the used object; CoCreateInstance :  uses the registry to discover which server implements the desidered class  asks the server to create an instance  receives from the server a pointer to the IUnknown interface 1) initializes the system : CoInitialize 3) uses IUnknown.QueryInterface to access the wanted interface 4) uses Addref and Release to manage the object lifecycle 5) in the end calls CoUninitialize

20 Introducing DCOM DCOM (1995) is a seamless evolution of COM  you can take advantage of your existing investment in COM-based applications, components, tools and knowledge An extension to COM that allows network-based component interaction COM : processes can run on the same machine but in different address spaces DCOM extension : allows processes to be spread across a network

21 DCOM Architecture DCOM sits right in the middle of the components fo your application; it provides the invisible glue that ties things together. COM Object Component Security Provider DCE RPC Protocol Stack Security Provider DCE RPC Protocol Stack DCOM network- protocol COM Object Component

22 Security by Configuration 1)DCOM obtains user name 2) Authenticate user 3) Is user in the list? 4) Fail or allow call

23 DCOM, CORBA, RMI Java RMI - JavaSoft CORBA -OMG DCOM - Microsoft

24 Java RMI Very easy to use Remoteable interfaces have a special exception Supports object-by-value Versioning is built into serialization Callbacks are blocked in synchronized methods Not always intuitive Not available to other languages There are limited development tools Performance can be slow as you scale

25 CORBA 1/2 Architecture for system composition Has a standard terminology for concepts Declarative interfaces separate the interface from the implementation Provides mappings from IDL to C, C++, SmallTalk and Java Supports : evolvable and marshallable data design portability standard interoperability protocols Scalable for large systems

26 CORBA 2/2 No inheritance for Exceptions Objects cannot support two versions of the same interface IDL is not internationalized Divergent security mechanisms (Kerberos, SSL) Few advanced services C++ mapping has complicated memory management rules Limited developer tools (usually just an IDL compiler) Limited concurrency model

27 DCOM Lots of tools, books and developers Separates interface from implementation Good integration of automation objects with VisualBasic and Java Good set of compound document interfaces Microsoft depends on it working Minimal support on non-Microsoft platforms Hard to keep registry consistent Reference counting is a problem Client has to choose the interaction model

28 I1 : C1 Pointer to VMT Attribute 1 Attribute 2 Attribute 3 …………………… I2 : C1 Pointer to VMT Attribute 1 Attribute 2 Attribute 3 …………………… Pointer to function 1 Pointer to function 2 Pointer to function 3 Pointer to function 4 VMT of class C1 implementationsimplementations back VMT : Virtual Method Table 2/2

29 MTS : Microsoft transaction Server 1/2 A container for in-process server side components. A component-based programming model. An MTS component is a type of COM component that executes in the MTS run-time environment. Allows you to define and use transactions within COM objects What does it do? Enforces modelling based on components – just as COM

30 Uses roles and packages Uses Just In TIME (JIT) Activation Run-time divided into three parts : Surrogate Process (MTS.EXE) Microsoft Distributed Transaction Coordinator (MS DCT) MTS Explorer back Handles communication between components through DCOM and HTTP protocols MTS : Microsoft transaction Server 2/2

31 Пример

32

33 Методи на COM … public bool delete (int accountKey) { bool result = false; MessageBox.Show ("Bank::delete() invoked...", "Key Value = "+accountKey); ……

34 Използване на компонента using Bank; try { // Create the COM+ component Bank.AccountManager manager = new Bank.AccountManager ();

35

36 Пример 2 – Ole automation (com) Sub SpellCheck( ) Dim Obj As Object Set Obj = CreateObject(“Excel.Application”) Word = InputBox(“Enter word”) If Obj.CheckSpelling(Word) Then MsgBox( “Valid word” ) Else MsgBox( “Word not found” ) End If End Sub