CS551 - Lecture 12 1 CS551 Object Oriented Middleware (IV) Dynamic Requests (Chap. 6 of EDO) Yugi Lee STB #555 (816) 235-5932

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 12 Slide 1 Distributed Systems Design 2.
Advertisements

II. Middleware for Distributed Systems
GridRPC Sources / Credits: IRISA/IFSIC IRISA/INRIA Thierry Priol et. al papers.
Common Object Request Broker Architecture (CORBA) By: Sunil Gopinath David Watkins.
CORBA Architecture Nitin Prabhu. Outline CORBA Object Model CORBA Architecture Static Invocation Dynamic Invocation CORBA Communication Model.
Remote Object Invocation Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
CORBA - Common Object Request Broker Architecture.
Seminarium on Component-based Software Engineering Jan Willem Klinkenberg CORBA.
Netprog CORBA Intro1 CORBA Common Object Request Broker Architecture Based partially on Notes by D. Hollinger and Java Network Programming and Distributed.
Advanced Comm. between Distributed Objects 1 Advanced Communication Among Distributed Objects  Outline  Request synchronization  Request multiplicity.
A brief look at CORBA. What is CORBA Common Object Request Broker Architecture developed by OMG Combine benefits of OO and distributed computing Distributed.
CORBA Framework Eelements 1 CORBA Framework Elements  Object Request Broker (ORB)  This is the object manager in CORBA  Mechanisms for specifying interfaces.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
A First Java ORB Application 1  Object Request Broker (ORB)  This is the object manager in CORBA  Mechanisms for specifying interfaces  Interface Definition.
II. Middleware for Distributed Systems
Project Title: Cobra Implementation on Association Service.
Communication in Distributed Systems –Part 2
Object Based Operating Systems1 Learning Objectives Object Orientation and its benefits Controversy over object based operating systems Object based operating.
Dynamic Object Requests 1  Outline  Motivating Examples  Dynamic Invocation  Reflection  Designing Generic Applications.
September 21, 2005 Dynamic Typing in CORBA Middleware Jeff Parsons ISIS Vanderbilt University Nashville, TN.
DCOM Technology Şevket Duran Haşim Sak.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA.
COM/DCOM Implementation Basics of: Object creation and access Object Reuse Interface referencing.
Information Management NTU Interprocess Communication and Middleware.
1 of of 25 3 of 25 ORBs (Object Request Broker) – A distributed software bus for communication among middleware services and applications – To.
CS551 - Lecture 17 1 CS551 Object Oriented Middleware (VI) Advanced Topics (Chap of EDO) Yugi Lee STB #555 (816)
CORBA Overview and Advanced Programming Issues 1998 CTIT, Nikolay Diakov 1 Table Of Contents Introduction OMG, OMA, CORBA Object Model CORBA Introspection.
New features for CORBA 3.0 by Steve Vinoski Presented by Ajay Tandon.
Chapter 6 Server-side Programming: Java Servlets
Abhishek Bachchan Vishal Patangia
CORBA IS 8030 – Integrated Computing Environments Dr. Hoganson CORBA Common Object Request Broker Architecture Published by Object Management Group (OMG)
Dynamic Invocation Interface Alternative to using IDL stubs Object cannot distinguish between the two. How is DII different for the programmer?
CS551 - Lecture 16 1 CS551 Object Oriented Middleware (V) Advanced Communication between Distributed Objects (Chap. 7 of EDO) Yugi Lee STB #555 (816)
CSC 480 Software Engineering Lecture 18 Nov 6, 2002.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
CS551 - Lecture 15 1 CS551 Object Oriented Middleware (IV) Dynamic Requests (Chap. 6 of EDO) Yugi Lee STB #555 (816)
Distributed Object Frameworks DCE and CORBA. Distributed Computing Environment (DCE) Architecture proposed by OSF Goal: to standardize an open UNIX envt.
Update on CORBA Support for Babel RMI Nanbor Wang and Roopa Pundaleeka Tech-X Corporation Boulder, CO Funded by DOE OASCR SBIR.
Electronic Payment Systems (1)
Common Object Request Broker Architecture (CORBA) The Common Object Request Broker Architecture (CORBA) is a specification of a standard architecture for.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
CS551 - Lecture 11 1 CS551 Object Oriented Middleware (III) (Chap. 5 of EDO) Yugi Lee STB #555 (816)
 Common Object Request Broker Architecture  An industry standard developed by OMG to help in distributed programming.
Apr. 8, 2002Calibration Database Browser Workshop1 Database Access Using D0OM H. Greenlee Calibration Database Browser Workshop Apr. 8, 2002.
Distributed Objects and Remote Invocation Source: George Colouris, Jean Dollimore, Tim Kinderberg & Gordon Blair (2012). Distributed Systems: Concepts.
Object-Oriented Network Communication (OOMI) Dynamic Requests Emmerich – Chapter
Persistent State Service 1  Concept  Persistence is the ability of an object state to survive termination of the process in which the object executes.
CS551 - Lecture 10 1 CS551 Object Oriented Middleware (II) (Chap. 4 of EDO) Yugi Lee STB #555 (816)
OLE Automation 主講人:虞台文. Content BSTR  String data type in OLE VARIANT & VARIANTARG IDispatch Create COM Objects Using ATL.
Presentation: Special Repetition Recap on Distributed Principles.
GridRPC Sources / Credits: IRISA/IFSIC IRISA/INRIA Thierry Priol et. al papers.
(C) 2003 University of ManchesterCS31010 Lecture 14: CORBA.
CEN6502, Spring Understanding the ORB: Client Side Structure of ORB (fig 4.1) Client requests may be passed to ORB via either SII or DII SII decide.
1 CS 501 Spring 2002 CS 501: Software Engineering Lecture 15 System Architecture III.
CORBA Antonio Vasquez, John Shelton, Nidia, Ruben.
1 Distributed Systems Architectures Distributed object architectures Reference: ©Ian Sommerville 2000 Software Engineering, 6th edition.
Prof. Leonardo Mostarda University of Camerino
Broker in practice: Middleware
Object-Oriented Network Communication (OOMI)
C# COM Interoperability Late Binding
Ch > 28.4.
Inventory of Distributed Computing Concepts and Web services
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Copyright © 2001 Qusay H. Mahmoud
Copyright 1999 B.Ramamurthy
Presentation transcript:

CS551 - Lecture 12 1 CS551 Object Oriented Middleware (IV) Dynamic Requests (Chap. 6 of EDO) Yugi Lee STB #555 (816)

2 CS551 - Lecture 12 Outline Dynamic Invocation –The CORBA Dynamic Invocation Interface –COM IDispatch Interfaces Reflection –The CORBA Interface Repository –The COM Type Library Designing Generic Applications –Using CORBA –Using COM Dynamic Invocation –The CORBA Dynamic Invocation Interface –COM IDispatch Interfaces Reflection –The CORBA Interface Repository –The COM Type Library Designing Generic Applications –Using CORBA –Using COM

3 CS551 - Lecture 12 Why Dynamic Request? Sometimes clients need to be built before their server interfaces are defined They need to defer request definition until they are executed Examples: –Object browser –Generic bridges –Scripting language interpreter Sometimes clients need to be built before their server interfaces are defined They need to defer request definition until they are executed Examples: –Object browser –Generic bridges –Scripting language interpreter

4 CS551 - Lecture 12 Commonalities Discovery of type information at run-time Use of type information to build client objects that can cope with any type of server objects Definition of object requests at run-time Requires two primitives from middleware: –Dynamic invocation interfaces –Reflection mechanisms Discovery of type information at run-time Use of type information to build client objects that can cope with any type of server objects Definition of object requests at run-time Requires two primitives from middleware: –Dynamic invocation interfaces –Reflection mechanisms

5 CS551 - Lecture 12 Dynamic Requests: Principles Any object request has to identify –server object –operation name –actual parameters –data structure for operation result In Dynamic Requests: –server object identified by object reference –operation name identified by string –actual parameters as list of name/value pairs –operation result determined by an address Any object request has to identify –server object –operation name –actual parameters –data structure for operation result In Dynamic Requests: –server object identified by object reference –operation name identified by string –actual parameters as list of name/value pairs –operation result determined by an address

6 CS551 - Lecture 12 Dynamic Invocation Dynamic Invocation Client Stubs Client Stubs ORB Interface ORB Interface Implementation Skeletons Implementation Skeletons Client Object Implementation ORB Core Object Adapter Object Adapter Dynamic Requests in CORBA

7 CS551 - Lecture 12 Dynamic Requests in CORBA Dynamic invocation interface (DII) supports dynamic creation of requests (objects). Request objects have attributes for –operation name, –parameters and –results. Request objects have operations to –change operation parameters, –issue the request and –obtain the request results. Dynamic invocation interface (DII) supports dynamic creation of requests (objects). Request objects have attributes for –operation name, –parameters and –results. Request objects have operations to –change operation parameters, –issue the request and –obtain the request results.

8 CS551 - Lecture 12 Dynamic Request in CORBA :Client r r r:Request :Server Op() r r =create_request(…,”Op”,…) add _arg() invoke() delete()

9 CS551 - Lecture 12 Dynamic Requests in COM COM often used with interpreted scripting languages (e.g. VBScript) Interpreters of these languages need to make dynamic requests. Dynamic Requests in COM are defined in the IDispatch interface Any COM server that implements IDispatch can be requested dynamically COM often used with interpreted scripting languages (e.g. VBScript) Interpreters of these languages need to make dynamic requests. Dynamic Requests in COM are defined in the IDispatch interface Any COM server that implements IDispatch can be requested dynamically

10 CS551 - Lecture 12 Dynamic Request in COM :Client :Server QueryInterface(IID_IDispatch) GetIDsOfNames(“Op”) Invoke() Op() GetIDsOfNames(“Op”) :ITypeInfo Invoke()

11 CS551 - Lecture 12 Dual Interfaces Are accessible both via stubs and via dynamic invocation Example: Interface Player : [object,dual,uuid(75DA6450-DD0E-00d1-8B C73915CB] interface DIPlayer: IDispatch { [id(1),propget] HRESULT Name([out] BSTR val); [id(2),propget] HRESULT Number([out] short val); [id(3)] HRESULT book([in] Date val) }; Interfaces have to be defined as dual! Are accessible both via stubs and via dynamic invocation Example: Interface Player : [object,dual,uuid(75DA6450-DD0E-00d1-8B C73915CB] interface DIPlayer: IDispatch { [id(1),propget] HRESULT Name([out] BSTR val); [id(2),propget] HRESULT Number([out] short val); [id(3)] HRESULT book([in] Date val) }; Interfaces have to be defined as dual!

12 CS551 - Lecture 12 Transparency of Dynamic Invocation In both COM and CORBA: –Client programs have to be written differently  Use of dynamic invocation interfaces is not transparent to client programmers In COM: –Interfaces of server objects have to be designed as dual  Use of dynamic invocation not transparent in server design In CORBA: –Server objects are unaware of dynamic invocation  Use of DII is transparent In both COM and CORBA: –Client programs have to be written differently  Use of dynamic invocation interfaces is not transparent to client programmers In COM: –Interfaces of server objects have to be designed as dual  Use of dynamic invocation not transparent in server design In CORBA: –Server objects are unaware of dynamic invocation  Use of DII is transparent

13 CS551 - Lecture 12 Reflection Principles How do clients discover attributes & operations that servers have? –capture type information during interface compilation –store type information persistently –provide an interface for clients to obtain type information during run-time Reflection interfaces provided by –CORBA Interface Repository –COM Type Library How do clients discover attributes & operations that servers have? –capture type information during interface compilation –store type information persistently –provide an interface for clients to obtain type information during run-time Reflection interfaces provided by –CORBA Interface Repository –COM Type Library

14 CS551 - Lecture 12 CORBA Interface Repository Makes type information of interfaces available at run-time. Achieves type-safe dynamic invocations. Supports construction of interface browser Used by CORBA implementations themselves Persistent storage of IDL interfaces in abstract syntax trees (ASTs) Makes type information of interfaces available at run-time. Achieves type-safe dynamic invocations. Supports construction of interface browser Used by CORBA implementations themselves Persistent storage of IDL interfaces in abstract syntax trees (ASTs)

15 CS551 - Lecture 12 COM Type Library COM’s provision of run-time type information Raw information generated by MIDL compiler Stored in tokenized form (.TLB files) Main interfaces: COM’s provision of run-time type information Raw information generated by MIDL compiler Stored in tokenized form (.TLB files) Main interfaces: ITypeLib ITypeInfo *

16 CS551 - Lecture 12 ITypeLib Provides operations to browse through all interfaces contained in the type library –GetTypeInfoCount (returns number of TypeInfo objects in the library) –GetTypeInfo (can be used to obtain type info at a particular index number) Locate ITypeInfo objects using the GUIDs Provides operations to browse through all interfaces contained in the type library –GetTypeInfoCount (returns number of TypeInfo objects in the library) –GetTypeInfo (can be used to obtain type info at a particular index number) Locate ITypeInfo objects using the GUIDs

17 CS551 - Lecture 12 ITypeInfo interface ITypeInfo : IUnknown { HRESULT GetFuncDesc( UINT index, FUNCDESC **ppFuncDesc); HRESULT GetIDsOfNames( OLECHAR **rgszNames, UINT cNames, DISPID *pMemId); HRESULT GetNames(DISPID memid, BSTR *rgBstrNames, UINT cMaxNames, UINT *pcNames); HRESULT GetTypeAttr(TYPEATTR **ppTypeAttr); HRESULT GetVarDesc(UINT index, VARDESC **ppVarDesc); HRESULT Invoke(VOID *pvInstance, DISPID memid, USHORT wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);... }; interface ITypeInfo : IUnknown { HRESULT GetFuncDesc( UINT index, FUNCDESC **ppFuncDesc); HRESULT GetIDsOfNames( OLECHAR **rgszNames, UINT cNames, DISPID *pMemId); HRESULT GetNames(DISPID memid, BSTR *rgBstrNames, UINT cMaxNames, UINT *pcNames); HRESULT GetTypeAttr(TYPEATTR **ppTypeAttr); HRESULT GetVarDesc(UINT index, VARDESC **ppVarDesc); HRESULT Invoke(VOID *pvInstance, DISPID memid, USHORT wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);... };

18 CS551 - Lecture 12 Static Invocation Advantages: –Requests are simple to define. –Availability of operations checked by programming language compiler. –Requests can be implemented fairly efficiently. Disadvantages: –Generic applications cannot be built. –Recompilation required after operation interface modification. Advantages: –Requests are simple to define. –Availability of operations checked by programming language compiler. –Requests can be implemented fairly efficiently. Disadvantages: –Generic applications cannot be built. –Recompilation required after operation interface modification.

19 CS551 - Lecture 12 Dynamic Invocation Advantages: –Components can be built without having the interfaces they use, –Higher degree of concurrency through deferred synchronous execution. –Components can react to changes of interfaces. Disadvantages: –Less efficient, –More complicated to use and –Not type safe! Advantages: –Components can be built without having the interfaces they use, –Higher degree of concurrency through deferred synchronous execution. –Components can react to changes of interfaces. Disadvantages: –Less efficient, –More complicated to use and –Not type safe!

20 CS551 - Lecture 12 Key Points Dynamic requests are used when static requests are not viable Dynamic requests supported by both CORBA and COM Dynamic requests are unsafe Reflection mechanisms provided by COM and CORBA make dynamic requests safe IDL compilers store type information persistently so that reflection implementations can provide them Dynamic requests are used when static requests are not viable Dynamic requests supported by both CORBA and COM Dynamic requests are unsafe Reflection mechanisms provided by COM and CORBA make dynamic requests safe IDL compilers store type information persistently so that reflection implementations can provide them