Presentation is loading. Please wait.

Presentation is loading. Please wait.

© Chinese University, CSE Dept. Distributed Systems / 6 - 1 Distributed Systems Topic 6: Resolving Heterogeneity Dr. Michael R. Lyu Computer Science &

Similar presentations


Presentation on theme: "© Chinese University, CSE Dept. Distributed Systems / 6 - 1 Distributed Systems Topic 6: Resolving Heterogeneity Dr. Michael R. Lyu Computer Science &"— Presentation transcript:

1 © Chinese University, CSE Dept. Distributed Systems / 6 - 1 Distributed Systems Topic 6: Resolving Heterogeneity Dr. Michael R. Lyu Computer Science & Engineering Department The Chinese University of Hong Kong

2 © Chinese University, CSE Dept. Distributed Systems / 6 - 2 Outline  Heterogeneous Programming Languages –Common Object Model –Common Interface Definition Language –Programming Language Bindings  Heterogeneous Middleware –Interoperability –Interworking  Heterogeneous Data Representation –Standardized Data Representation –Application-Level Transport Protocol –Virtual Machines

3 © Chinese University, CSE Dept. Distributed Systems / 6 - 3 1.1 Heterogeneous Languages: Motivation  Components of distributed systems are written in different programming languages  Programming languages may or may not have their own object model  Object models largely vary  Differences need to be overcome in order to facilitate integration and portability

4 © Chinese University, CSE Dept. Distributed Systems / 6 - 4 1.1 Heterogeneous Programming Languages 1 Polylingual applications. 2 Standardization of bindings. 3 Available bindings. 4 What bindings need to address. 5 An example: IDL/C++.

5 © Chinese University, CSE Dept. Distributed Systems / 6 - 5 1.1 Polylingual Applications  Polylingual applications have components in different programming languages.  Language bindings address language interoperability.  Problem: with n different languages, n(n-1) different language bindings needed.  Solution: One language (such as IDL) as a mediator. Requires only n bindings.

6 © Chinese University, CSE Dept. Distributed Systems / 6 - 6 PL 6 6 2 2 5 5 1 1 4 4 3 3 6 6 2 2 5 5 1 1 4 4 3 3 IDL 1.1 Why do we use an IDL?

7 © Chinese University, CSE Dept. Distributed Systems / 6 - 7 1.2 Interface Definition Language  Language for expressing all concepts of the middleware’s object model  Should be –programming-language independent –not computationally complete  Bindings to different programming languages are needed  As an example: OMG object model and OMG/IDL

8 © Chinese University, CSE Dept. Distributed Systems / 6 - 8 1.2 Polylingual Applications with IDL Infra- structure Client side Object Implementation Side IDL Java Client C++ Object Implementation IDL

9 © Chinese University, CSE Dept. Distributed Systems / 6 - 9 IDL Common Object Model Common Object Model Smalltalk Cobol Java Ada C++ C C 1.3 CORBA Programming Language Bindings Python Lisp IDLscript

10 © Chinese University, CSE Dept. Distributed Systems / 6 - 10 1.4 What Bindings Need to Address  Atomic data types and type constructors  Constants  Interfaces and multiple inheritance  Object references  Attribute accesses  Operation execution requests  Exceptions  Invocation of ORB operations

11 © Chinese University, CSE Dept. Distributed Systems / 6 - 11 1.5 An Example: IDL/C++ 1 Modules 2 Atomic Types 3 Records 4 Interfaces 5 Attributes 6 Operations 7 Inheritance 8 Exceptions 9 Operation Execution Requests

12 © Chinese University, CSE Dept. Distributed Systems / 6 - 12 1.5.1 Modules IDL: C++: module BankApplication {... }; namespace BankApplication {... };

13 © Chinese University, CSE Dept. Distributed Systems / 6 - 13 1.5.2 Atomic Types IDL C++ shortCORBA::Short longCORBA::Long unsigned shortCORBA::UShort unsigned longCORBA::ULong floatCORBA::Float doubleCORBA::Double charCORBA::Char booleanCORBA::Boolean octetCORBA::Octet enum

14 © Chinese University, CSE Dept. Distributed Systems / 6 - 14 1.5.3 Records struct info { CORBA::Long height; CORBA::Short weight; }; struct info { long height; short weight; }; IDL C++

15 © Chinese University, CSE Dept. Distributed Systems / 6 - 15 1.5.4 Interfaces interface person {... }; class person {... }; IDL C++

16 © Chinese University, CSE Dept. Distributed Systems / 6 - 16 1.5.5 Attributes IDL C++ interface person { attribute readonly string name; attribute address lives_at; }; class person { public: string name(); void lives_at(address &); address lives_at(); };

17 © Chinese University, CSE Dept. Distributed Systems / 6 - 17 1.5.6 Operations IDL C++ interface person { void move(in address new); }; class person { public: void move(const address & new); };

18 © Chinese University, CSE Dept. Distributed Systems / 6 - 18 1.5.7 Inheritance interface employee : person {... person boss(); }; class employee : public virtual person { public: person boss(); }; IDL C++

19 © Chinese University, CSE Dept. Distributed Systems / 6 - 19 1.5.8 Exceptions interface employee : person { exception too_young{...}; void retire() raises (too_young); }; class employee : public virtual person { public: class too_young:public UserException { too_young (const char *id); ~too_young (); }; void retire() throw (too_young); }; IDL C++

20 © Chinese University, CSE Dept. Distributed Systems / 6 - 20 1.5.9 Operation Execution Requests employee * emp;... try { emp->retire(); } catch (const too_young &IsTooYoung){ // Handle the Specific Exception } catch (const SystemException &SysEx){ switch (SysEx->minor() ) { case BAD_PARAM :... ; break; case NO_MEMORY :... ; break; }; C++

21 © Chinese University, CSE Dept. Distributed Systems / 6 - 21 2 Need for Heterogeneous Middleware  Middleware implementations differ: –Available programming language bindings –Available services & facilities –Supported hardware platforms –Supported operating system platforms  Separation of security domains.  Large scale distributed systems.

22 © Chinese University, CSE Dept. Distributed Systems / 6 - 22 Component Middleware Vendor A Component Middleware Vendor B Component Middleware Vendor C 2.1 Heterogeneous Middleware

23 © Chinese University, CSE Dept. Distributed Systems / 6 - 23 2.2 Middleware Integration ORB OLE RPC Bridge ORB Component

24 © Chinese University, CSE Dept. Distributed Systems / 6 - 24 2.2 Bridging Client ORB Core Obj. Imp. Client ORB Core Obj. Imp. DSI DII  in-line  request-level

25 © Chinese University, CSE Dept. Distributed Systems / 6 - 25 2.3 Interoperability vs. Interworking  Interoperability denotes the ability of different implementations of the same middleware standard to work together. Requires –Definition of interaction protocols  Interworking defines how different middleware standards are integrated. Requires –Mapping of object models –Definition of interaction protocols

26 © Chinese University, CSE Dept. Distributed Systems / 6 - 26 2.3 Interoperability vs. Interworking  Interoperability between different implementations of the same standard (CORBA)  Interworking between different standards –CORBA  DCE –CORBA  COM/DCOM/OLE  First CORBA interoperability  Then COM/CORBA interworking

27 © Chinese University, CSE Dept. Distributed Systems / 6 - 27 CORBA 2.0 Applications GIOP ESIOP IIOP DOETalk........ DCE-CIOP........ Mandatory: provides "out of the box" interoperability 2.4 Interoperability Protocols

28 © Chinese University, CSE Dept. Distributed Systems / 6 - 28 2.4.1 General Inter-ORB Protocol (GIOP)  Define eight messages: –Request –Reply –Fragment –Locate Request –Locate Reply –Cancel request –Close Connection –Message Error

29 © Chinese University, CSE Dept. Distributed Systems / 6 - 29 2.4.2 Common Data Representation  Defined as part of GIOP.  Presentation layer implementation to support heterogeneity.  Mapping of IDL data types to transport byte stream.  Encodings of –primitive types –constructed types –interoperable object references

30 © Chinese University, CSE Dept. Distributed Systems / 6 - 30 2.4.3 Internet Inter-ORB Protocol (IIOP)  Maps GIOP to TCP/IP.  Provides operations to open and close TCP/IP connections.  Is required from ORBs for CORBA compliance.  Supported by Netscape Communicator and others.

31 © Chinese University, CSE Dept. Distributed Systems / 6 - 31 2.5 Motivation for Interworking  COM and OLE/Automation are widely used for desktop integration of PC applications –Compound documents –Visual Basic / Visual C++ User Interfaces.  OMG has no support for compound documents and user interfaces yet.  COM and OLE do not support distribution.  CORBA was designed to support distribution.

32 © Chinese University, CSE Dept. Distributed Systems / 6 - 32 2.5.1 COM-CORBA Interworking  Goal: provide transparent bi-directional mapping between COM/OLE and CORBA.  Adopted specification was submitted by consortium of 11 ORB vendors. Most of them have COM/OLE Interworking implemented in their ORB products.  Microsoft decided not to be involved in this effort but rather pursue its own distributed object environment (DCOM).  CORBA2.2 specification defines interworking between CORBA and DCOM.

33 © Chinese University, CSE Dept. Distributed Systems / 6 - 33 Object System A Object System B objref in A objref in A Bridge objref in B objref in B View in A of target in B View in A of target in B target object implementa- tion in B target object implementa- tion in B 2.5.2 Interworking Architecture

34 © Chinese University, CSE Dept. Distributed Systems / 6 - 34 CORBA clientCOM server CORBA objref Bridge CORBA view of COM object Target COM object CORBA client Automation server CORBA objref Bridge CORBA view of Autom. object Automation object CORBA serverCOM client Bridge COM view of CORBA object Target CORBA object CORBA serverAutomation client Bridge Autom. view of CORBA object Target CORBA object 2.5.3 Architecture Instantiations

35 © Chinese University, CSE Dept. Distributed Systems / 6 - 35 2.5.5 CORBA  COM  Enables COM Clients to access CORBA objects  Fairly straight-forward mapping: –IDL atomic types map closely to COM primitives –Constructed types also map closely –CORBA object references map to COM interface pointers –Inherited CORBA interfaces may be represented as multiple COM interfaces –CORBA attributes mapped to ´set´ and ´get´ operations in COM.

36 © Chinese University, CSE Dept. Distributed Systems / 6 - 36 3 Heterogeneous Data Representation  Examples of Heterogeneity –Big-endian versus little-endian data representation –Different encoding schemes for character set –Different ways complex data types are implemented by run-time environment of programming languages  Resolution: Standardized Data Representation  Resolution: Application-Level Transport Protocol  Resolution: Virtual Machines

37 © Chinese University, CSE Dept. Distributed Systems / 6 - 37 4 Summary  Polylingual applications.  IDL programming language bindings.  Heterogeneous Middleware  Heterogeneous Data Representation.


Download ppt "© Chinese University, CSE Dept. Distributed Systems / 6 - 1 Distributed Systems Topic 6: Resolving Heterogeneity Dr. Michael R. Lyu Computer Science &"

Similar presentations


Ads by Google