© Chinese University, CSE Dept. Distributed Systems / 2 - 1 Distributed Systems Topic 2: Distributed Software Engineering Using CORBA Dr. Michael R. Lyu.

Slides:



Advertisements
Similar presentations
Object-Oriented Programming. 2 An object, similar to a real-world object, is an entity with certain properties, and with the ability to react in certain.
Advertisements

Modeling Main issues: What do we want to build How do we write this down.
Programming Languages and Paradigms
Written by: Dr. JJ Shepherd
Graph Coverage for Design Elements 1.  Use of data abstraction and object oriented software has increased importance on modularity and reuse.  Therefore.
Modeling Main issues: What do we want to build How do we write this down ©2008 John Wiley & Sons Ltd. vliet.
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
© City University London, Dept. of Computing Distributed Systems / Distributed Systems Session 2: Distributed Software Engineering Christos Kloukinas.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 5: CORBA, COM and Java/RMI Dr. Michael R. Lyu Computer Science &
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
Netprog CORBA Intro1 CORBA Common Object Request Broker Architecture Based partially on Notes by D. Hollinger and Java Network Programming and Distributed.
CORBA Case Study By Jeffrey Oliver March March 17, 2003CORBA Case Study by J. T. Oliver2 History The CORBA (Common Object Request Broker Architecture)
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Principles of Object-Oriented Software Development Interface Definition Language.
OCT 1 Master of Information System Management Organizational Communications and Distributed Object Technologies Lecture 5: Distributed Objects.
IDL Interface Definition Language. IDL products Interface repository Dynamic Interface Static skeletons Client IDL stubs Dynamic skeletons Server Object.
Designing Distributed Objects 1 Distributed Objects  Objective  Understand the difference between local and distributed objects and how to correctly.
II. Middleware for Distributed Systems
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 6: Resolving Heterogeneity Dr. Michael R. Lyu Computer Science &
Communication in Distributed Systems –Part 2
Data Abstraction and Object- Oriented Programming CS351 – Programming Paradigms.
Object Oriented Databases - Overview
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 4: RPCs vs. CORBA Dr. Michael R. Lyu Computer Science & Engineering.
Abstract Data Types and Encapsulation Concepts
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
1 Procedural Concept The main program coordinates calls to procedures and hands over appropriate data as parameters.
C++ fundamentals.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
Slide 1 © Ingeniørhøjskolen i Århus ITONK1 CORBA & ICE Introduction.
Slide 1 © Ingeniørhøjskolen i Århus Objektorienteret Middleware (OOMI) CORBA Introduction.
1 Abstraction  Identify important aspects and ignore the details  Permeates software development programming languages are abstractions built on hardware.
Information Management NTU Interprocess Communication and Middleware.
Object Orientation Yaodong Bi, Ph.D. Department of Computer Sciences University of Scranton October 18, 2015October 18, 2015October 18, 2015.
Database Management COP4540, SCS, FIU Database Modeling A Introduction to object definition language (ODL)
OOP Class Lawrence D’Antonio Lecture 3 An Overview of C++
Objekt orienteret Netværkskommunikation CORBA Introduction & CORBA Programming.
CS551 - Lecture 15 1 CS551 Object Oriented Middleware (IV) Dynamic Requests (Chap. 6 of EDO) Yugi Lee STB #555 (816)
Design Model Lecture p6 T120B pavasario sem.
Types in programming languages1 What are types, and why do we need them?
Objektorienteret Middleware (OOMI)
1DT057 D ISTRIBUTED I NFORMATION S YSTEM Middleware: RPC and CORBA 1.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 3: Communication Dr. Michael R. Lyu Computer Science & Engineering.
11-1 CHAPTER 11 Concepts for Object-Oriented Databases.
CS551 - Lecture 10 1 CS551 Object Oriented Middleware (II) (Chap. 4 of EDO) Yugi Lee STB #555 (816)
Objektorienteret Netværkskommunikation (ITONK1) CORBA Introduction.
January 25, 2016 First experiences with CORBA Niko Neufeld.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
1 Distributed Programming low level: sending data among distributed computations higher level: supporting invocations among distributed computations network.
Chapter 7 Classes and Methods III: Static Methods and Variables Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition)
(C) 2003 University of ManchesterCS31010 Lecture 14: CORBA.
Fusion Design Overview Object Interaction Graph Visibility Graph Class Descriptions Inheritance Graphs Fusion: Design The overall goal of Design is to.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
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.
Topic 4: Distributed Objects Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Main issues: • What do we want to build • How do we write this down
Prof. Leonardo Mostarda University of Camerino
Object-Oriented Network Communication (OOMI)
OOP What is problem? Solution? OOP
CS551 UML for Distributed Objects (Engineering Distributed Objects)
Object Orientation Yaodong Bi, Ph.D. Department of Computer Sciences
Paul Ammann & Jeff Offutt
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
1DT057 Distributed Information System
Object Oriented Programming
Programs and Classes A program is made up from classes
Object Oriented System Design Class Diagrams
Presentation transcript:

© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 2: Distributed Software Engineering Using CORBA Dr. Michael R. Lyu Computer Science & Engineering Department The Chinese University of Hong Kong

© Chinese University, CSE Dept. Distributed Systems / Outline 1 Motivation 2 The CORBA Object Model 3 The OMG Interface Definition Language 4 Summary

© Chinese University, CSE Dept. Distributed Systems / Motivation  Distributed Systems consist of multiple components.  Components are heterogeneous.  Components still have to be interoperable.  There has to be a common model for components that expresses –component states, –component services, and –interaction of components with other components.

© Chinese University, CSE Dept. Distributed Systems / The CORBA Object Model  Components  objects.  Visible component state  object attributes.  Usable component services  object operations.  Component interactions  operation execution requests.  Component service failures  exceptions.

© Chinese University, CSE Dept. Distributed Systems / Automatic Teller Machine Network

© Chinese University, CSE Dept. Distributed Systems / Types of Distributed Objects  Attributes, operations and exceptions are properties objects may export to other objects.  Multiple objects may export the same properties.  Only define the properties once!  Attributes and operations, and exceptions are defined in object types.

© Chinese University, CSE Dept. Distributed Systems / Attributes  Attributes have a name and a type.  Type can be an object type or a non-object type.  Attributes are readable by other components.  Attributes may or may not be modifyable by other components.  Attributes correspond to one or two operations (set/get).

© Chinese University, CSE Dept. Distributed Systems / Exceptions  Service requests in a distributed system may not be properly executed.  Exceptions are used to explain reason of failure to requester of operation execution.  Operation execution failures may be –generic or –specific.  Specific failures may be explained in specific exceptions.

© Chinese University, CSE Dept. Distributed Systems / Operations  Operations have a signature that consists of –a name, –a list of in, out, or inout parameters, –a return value type, and –a list of exceptions that the operation can raise.

© Chinese University, CSE Dept. Distributed Systems / Operation Execution Requests  A client object can request an operation execution from a server object.  Operation request is expressed by sending a message (operation name) to server object.  Clients have to react to exceptions that the operation may raise.

© Chinese University, CSE Dept. Distributed Systems / Subtyping  Properties shared by several types should be defined only once.  Object types are organized in a type hierarchy. –irreflexive, anti-symmetric, transitive  Subtypes inherit attributes, operations and exceptions from their supertypes.  Subtypes can add more specific properties.  Subtypes can redefine inherited properties.

© Chinese University, CSE Dept. Distributed Systems / Problems of the Model  Interactions between components are not defined in the model.  No concept for abstract or deferred types.  Model does not include primitives for the behavioral specification of operations.  Semantics of the model is only defined informally.

© Chinese University, CSE Dept. Distributed Systems / The OMG Interface Definition Language  OMG/IDL is a language for expressing all concepts of the CORBA object model.  OMG/IDL is –programming-language independent, –orientated towards C++, and –not computationally complete.  Different programming language bindings are available.

© Chinese University, CSE Dept. Distributed Systems / Types A type is one of the following:  Atomic types ( void, boolean, short, long, float, char, string ),  Object types ( interface ),  Constructed types: –Records ( struct ), –Variants ( union ), and –Lists ( sequence ), or  Named types ( typedef ).

© Chinese University, CSE Dept. Distributed Systems / Types (Examples) struct Requester { int PIN; string AccountNo; string Bank; }; typedef sequence ATMList;

© Chinese University, CSE Dept. Distributed Systems / Attributes  Attributes are declared within an interface.  Attributes have a type and a name.  Attribute name must be unique within the interface.  Attributes can be declared as read-only.

© Chinese University, CSE Dept. Distributed Systems / Attributes (Examples) readonly attribute ATMList ATMs; readonly attribute BankList banks;

© Chinese University, CSE Dept. Distributed Systems / Exceptions  Exceptions have a unique name.  Exceptions may declare additional data structures.  These can be used to locate reasons for failures.

© Chinese University, CSE Dept. Distributed Systems / Exceptions (Example) exception InvalidPIN; exception InvalidATM; exception NotEnoughMoneyInAccount { short available; };

© Chinese University, CSE Dept. Distributed Systems / Operations  Operations have a unique identifier.  Operations have a parameter list. –parameters are in, out or inout, –parameter identifiers are unique within the list, and –parameter types have been declared.  Operations have a result type.  Operations declare exceptions they may raise.

© Chinese University, CSE Dept. Distributed Systems / Operations (Examples) void accept_request(in Requester req, in short amount) raises(InvalidPIN, NotEnoughMoneyInAccount); short money_in_dispenser(in ATM dispenser) raises(InvalidATM);

© Chinese University, CSE Dept. Distributed Systems / Interfaces  Attributes, exceptions and operations are defined in interfaces.  Interfaces have an identifier, which denotes the object type associated with the interface.  Interfaces must be declared before they can be used.  Interfaces can be declared forward.

© Chinese University, CSE Dept. Distributed Systems / Interfaces (Example) interface ATM; interface TellerCtrl { typedef sequence ATMList; exception InvalidPIN; exception NotEnoughMoneyInAccount {...}; readonly attribute ATMList ATMs; readonly attribute BankList banks; void accept_request(in Requester req, in short amount) raises(InvalidPIN,NotEnoughMoneyInAccount); };

© Chinese University, CSE Dept. Distributed Systems / Modules  A global name space for identifiers is unreasonable.  IDL includes Modules to restrict visibility of identifiers.  Access to identifiers from other modules by qualification with module identifier.

© Chinese University, CSE Dept. Distributed Systems / Modules (Example) module Bank { interface AccountDB {}; }; module ATMNetwork { typedef sequence BankList; exception InvalidPIN; interface ATM; interface TellerCtrl {...}; };

© Chinese University, CSE Dept. Distributed Systems / Inheritance  Notation to define object type hierarchy.  Type hierarchy has to form an acyclic graph.  Type hierarchy graph has one root called ( Object ).  Subtypes inherit the attributes, exceptions and operations of all super-types.

© Chinese University, CSE Dept. Distributed Systems / Inheritance (Examples) interface Controllee; interface Ctrl { typedef sequence CtrleeList; readonly attribute CtrleeList controls; void add(in Controllee new_controllee); void discard(in Controllee old_controllee); }; interface ATM : Controllee {...}; interface TellerCtrl : Ctrl {...};

© Chinese University, CSE Dept. Distributed Systems / Inheritance (Multiple)  Multiple Inheritance  May cause name clashes if different super- types export the same identifier.  Example: interface Set { void add(in Element new_elem); }; interface TellerCtrl:Set, Ctrl {... };  Name clashes are not allowed!

© Chinese University, CSE Dept. Distributed Systems / Redefinition  Behavior of an operation as defined in a super-type may not be appropriate for a subtype.  Operation can be re-defined in the subtype.  Binding messages to operations is dynamic.  Operation signature must not be changed.  Operations in (abstract) super-types are often not implemented and used as ‘callbacks’.

© Chinese University, CSE Dept. Distributed Systems / Redefinition (Example) interface Ctrl { void add(in Controllee new_controllee); }; interface TellerCtrl : Ctrl { void add(in ATM new_controllee); };

© Chinese University, CSE Dept. Distributed Systems / Polymorphism  Objects can be assigned to an attribute or passed as a parameter that are instances of subtypes of the respective static type.  Attributes, parameters and operations are polymorph.  Example: Using Polymorphism, instances of type ATM can be inserted into attribute controls that TellerCtrl has inherited from Ctrl.

© Chinese University, CSE Dept. Distributed Systems / A Running Example Team -name:string +bookGoalies() coaches 1..* Player -name:string -Number:int +book() +transfer(p:Player) Club -noOfMembers:int -location:Address Trainer -name:string Organization #name:string works for 11..* uses plays in has 1 * +train()

© Chinese University, CSE Dept. Distributed Systems / CORBA Object Model: Types typedef struct _Address { string street; string postcode; string city; } Address; typedef sequence AddressList; interface Team {... }; Atomic types Atomic types Object type Object type Constructed types Constructed types

© Chinese University, CSE Dept. Distributed Systems / CORBA Object Model: Modules module Soccer { typedef struct _Address { string street; string postcode; string city; } Address; }; module People { typedef struct _Address { string flat_number; string street; string postcode; string city; string country; } Address; }; module Soccer { typedef struct _Address { string street; string postcode; string city; } Address; }; module People { typedef struct _Address { string flat_number; string street; string postcode; string city; string country; } Address; }; Modules Soccer::Address People::Address

© Chinese University, CSE Dept. Distributed Systems / CORBA Object Model: Attributes interface Player; typedef sequence PlayerList; interface Trainer; typedef sequence TrainerList; interface Team { readonly attribute string name; attribute TrainerList coached_by; attribute Club belongs_to; attribute PlayerList players;... }; interface Player; typedef sequence PlayerList; interface Trainer; typedef sequence TrainerList; interface Team { readonly attribute string name; attribute TrainerList coached_by; attribute Club belongs_to; attribute PlayerList players;... }; Attribute type Attribute name changeable Clients cannot change value Clients cannot change value

© Chinese University, CSE Dept. Distributed Systems / CORBA Object Model: Operations interface Team {... void bookGoalies(in Date d); string print(); }; Parameter list Parameter kind Parameter type Parameter name Operation name used in requests Operation name used in requests Return types

© Chinese University, CSE Dept. Distributed Systems / CORBA Object Model: Requests  Requests are defined by client objects  Request consist of –Reference of server object –Name of requested operation –Actual request parameters –Context information  Request is executed synchronously  Requests can be defined –statically –dynamically

© Chinese University, CSE Dept. Distributed Systems / CORBA Object Model: Exceptions  Generic Exceptions (e.g. network down, invalid object reference, out of memory)  Type-specific Exceptions exception PlayerBooked{sequence free;}; interface Team {... void bookGoalies(in Date d) raises(PlayerBooked); }; exception PlayerBooked{sequence free;}; interface Team {... void bookGoalies(in Date d) raises(PlayerBooked); }; Exception data Operations declare exceptions they raise Operations declare exceptions they raise Exception name

© Chinese University, CSE Dept. Distributed Systems / CORBA Object Model: Subtypes interface Organization { readonly attribute string name; }; interface Club : Organization { exception NotInClub{}; readonly attribute short noOfMembers; readonly attribute Address location; attribute TeamList teams; attribute TrainerList trainers; void transfer(in Player p) raises NotInClub; }; interface Organization { readonly attribute string name; }; interface Club : Organization { exception NotInClub{}; readonly attribute short noOfMembers; readonly attribute Address location; attribute TeamList teams; attribute TrainerList trainers; void transfer(in Player p) raises NotInClub; }; Inherited by Club Supertype Implicit supertype: Object Implicit supertype: Object

© Chinese University, CSE Dept. Distributed Systems / Summary  Why do we need a component model?  What are the primitives of the CORBA object model?  What is OMG/IDL?  What are the strength and weaknesses of the CORBA approach in realizing object orientation?