Title: Distributed Systems
1Distributed Systems
- Topic 6
- Resolving Heterogeneity
- Dr. Michael R. Lyu
- Computer Science Engineering Department
- The Chinese University of Hong Kong
2Outline
- 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
31.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
41.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.
51.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.
61.1 Why do we use an IDL?
71.2 Interface Definition Language
- Language for expressing all concepts of the
middlewares 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
81.2 Polylingual Applications with IDL
91.3 CORBA Programming Language Bindings
101.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
111.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
121.5.1 Modules
module BankApplication ...
namespace BankApplication ...
131.5.2 Atomic Types
- IDL C
- short CORBAShort
- long CORBALong
- unsigned short CORBAUShort
- unsigned long CORBAULong
- float CORBAFloat
- double CORBADouble
- char CORBAChar
- boolean CORBABoolean
- octet CORBAOctet
- enum enum
141.5.3 Records
struct info long height short
weight
struct info CORBALong height
CORBAShort weight
151.5.4 Interfaces
interface person ...
class person ...
161.5.5 Attributes
interface person attribute readonly string
name attribute address lives_at
class person public string name()
void lives_at(address ) address
lives_at()
171.5.6 Operations
interface person void move(in address
new)
class person public void move(const
address new)
181.5.7 Inheritance
interface employee person ... person
boss()
class employee public virtual person
public person boss()
191.5.8 Exceptions
interface employee person exception
too_young... void retire() raises
(too_young)
class employee public virtual person
public class too_youngpublic UserException
too_young (const char id) too_young
() void retire() throw (too_young)
201.5.9 Operation Execution Requests
employee emp ... try emp-gtretire()
catch (const too_young IsTooYoung) //
Handle the Specific Exception catch (const
SystemException SysEx) switch
(SysEx-gtminor() ) case BAD_PARAM ...
break case NO_MEMORY ... break
212 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.
222.1 Heterogeneous Middleware
232.2 Middleware Integration
242.2 Bridging
252.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
262.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
272.4 Interoperability Protocols
282.4.1 General Inter-ORB Protocol (GIOP)
- Define eight messages
- Request
- Reply
- Fragment
- Locate Request
- Locate Reply
- Cancel request
- Close Connection
- Message Error
292.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
302.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.
312.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.
322.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.
332.5.2 Interworking Architecture
342.5.3 Architecture Instantiations
352.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.
363 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
374 Summary
- Polylingual applications.
- IDL programming language bindings.
- Heterogeneous Middleware
- Heterogeneous Data Representation.