CORBA Object-by-Value

Slides:



Advertisements
Similar presentations
Programming Languages and Paradigms
Advertisements

Chapter 10 THINKING IN OBJECTS 1 Object Oriented programming Instructor: Dr. Essam H. Houssein.
15 May, 2015 CORBA Object-by-Value An overview of the value type and its IDL-to-C++ mapping. George Edwards Institute for Software-Integrated Systems Vanderbilt.
What iS RMI? Remote Method Invocation. It is an approach where a method on a remote machine invokes another method on another machine to perform some computation.
Object-Oriented Application Development Using VB.NET 1 Chapter 8 Understanding Inheritance and Interfaces.
CORBA Architecture Nitin Prabhu. Outline CORBA Object Model CORBA Architecture Static Invocation Dynamic Invocation CORBA Communication Model.
ITEC200 – Week03 Inheritance and Class Hierarchies.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Persistent State Service 1 CORBA Component  Component model  Container programming model  Component implementation framework  Component packaging and.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
C++ Training Datascope Lawrence D’Antonio Lecture 4 An Overview of C++: What is a Class/Object?
II. Middleware for Distributed Systems
CS 2511 Fall  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance  Polymorphism.
8.1 Classes & Inheritance Inheritance Objects are created to model ‘things’ Sometimes, ‘things’ may be different, but still have many attributes.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Copyright © 2003 ProsoftTraining. All rights reserved. Distributed Object Computing Using Java and CORBA.
Classes and Class Members Chapter 3. 3 Public Interface Contract between class and its clients to fulfill certain responsibilities The client is an object.
Information Management NTU Interprocess Communication and Middleware.
What is MOF? The Meta Object Facility (MOF) specification provides a set of CORBA interfaces that can be used to define and manipulate a set of interoperable.
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
CSCI-383 Object-Oriented Programming & Design Lecture 13.
CSE 425: Object-Oriented Programming I Object-Oriented Programming A design method as well as a programming paradigm –For example, CRC cards, noun-verb.
OOP Class Lawrence D’Antonio Lecture 3 An Overview of C++
CORBA/IDL Common Object Resource Broker Architecture (CORBA) Interface Definition Language (IDL) Object Management Group (OMG) ( Specification.
Module 10: Inheritance in C#. Overview Deriving Classes Implementing Methods Using Sealed Classes Using Interfaces Using Abstract Classes.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
Interfaces Chapter 9. 9 Creating Interfaces An interface is a contract. Every class that implements the interface must provide the interface’s defined.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
Object-Oriented Design Concepts University of Sunderland.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Topic 5: CORBA RMI Dr. Ayman Srour
Mr H Kandjimi 2016/01/03Mr Kandjimi1 Week 3 –Modularity in C++
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
These materials where developed by Martin Schray
The Object-Oriented Thought Process Chapter 03
Inheritance Modern object-oriented (OO) programming languages provide 3 capabilities: encapsulation inheritance polymorphism which can improve the design,
Sections Inheritance and Abstract Classes
Multi-Methods in Cecil
Inheritance and Polymorphism
Java Primer 1: Types, Classes and Operators
Methods Attributes Method Modifiers ‘static’
Object-Oriented Programming
Review: Two Programming Paradigms
Chapter 3: Using Methods, Classes, and Objects
11.1 The Concept of Abstraction
Week 4 Object-Oriented Programming (1): Inheritance
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
Programming Models for Distributed Application
Lecture 9 Concepts of Programming Languages
METHODS AND BEHAVIORS AKEEL AHMED.
Corresponds with Chapter 7
IFS410: Advanced Analysis and Design
MSIS 670 Object-Oriented Software Engineering
Lecture 22 Inheritance Richard Gesick.
Interfaces.
CORBA Object-by-Value
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Java Programming Course
Defining Classes and Methods
Java Inheritance.
Fundaments of Game Design
Defining Classes and Methods
Object-Oriented PHP (1)
Jim Fawcett CSE687 – Object Oriented Design Spring 2014
Inheritance Lakshmish Ramaswamy.
C++ Object Oriented 1.
Lecture 9 Concepts of Programming Languages
Presentation transcript:

CORBA Object-by-Value An overview of the value type and its IDL-to-C++ mapping.

What is Object-by-Value? Object-by-Value (OBV) is the CORBA mechanism for enabling objects to have pass-by-value semantics in CORBA operations. Conventional CORBA objects always have pass-by-reference semantics. The IDL keyword valuetype declares an object that will be passed by value. Valuetype instances are guaranteed to be local to the context in which they are used. November 20, 2018

Object-by-Value Semantics OBV implies semantics similar to pass-by-value in standard programming languages: The receiving entity of a valuetype parameter (or returned object) instantiates a new object with identical state to the parameter. The new instance has a separate identity and no relationship to the caller’s parameter. OBV requires that the receiving entity have access to an implementation of the valuetype. [George, please briefly mention how this affects C++ vs. Java.] November 20, 2018

When to Use Valuetypes Valuetypes are often useful in the following situations: An application needs a “copy” of an object. An object’s primary purpose is encapsulation of data, rather than operation implementations. An application needs the performance predictability of local method invocations. An application needs to transfer an arbitrarily complex or recursive tree, lattice, or other graph data structure. November 20, 2018

Capabilities of Valuetypes An IDL valuetype can: Have operations, attributes, and factories. Be recursively defined. Be declared abstract. Be shared across or within other instances. Inherit from a single concrete valuetype. Inherit from multiple abstract valuetypes. Support a single concrete interface. Support multiple abstract interfaces. Be declared truncatable. Be a “boxed” value. November 20, 2018

Valuetype C++ Mapping An IDL valuetype maps to: An abstract base class with the same name. Inherits from CORBA::ValueBase. Pure virtual methods corresponding to value type operations. Pure virtual accessor and modifier methods corresponding to state members. A class with “OBV_” prepended to the fully-scoped name. Inherits from the abstract base class. Is abstract if value type has operations; concrete otherwise. Provides default implementations of accessors and modifiers. A factory class with “_init” appended to the name. A _var type for life cycle management. November 20, 2018

Valuetype Factories (1/2) For each concrete valuetype, a factory class is generated; “_init” is appended to the valuetype name. Valuetype factory classes inherit from CORBA::ValueFactoryBase which declares a pure virtual create_for_unmashal () method. The create_for_unmashal () method is used by the ORB to create an instance of a valuetype received as a parameter or return type. Valuetype factories must be registered with the ORB via ORB::register_value_factory (). November 20, 2018

Valuetype Factories (2/2) Each factory method declared in IDL maps to pure virtual method that returns an instance of the valuetype. The factory class is concrete for valueboxes and valuetypes that have no IDL factories or operations; an implementation of create_for_unmashal () is generated. If the factory class is not concrete, the programmer must provide implementations of the create_for_unmashal () method and any factories declared in IDL. November 20, 2018

Abstract Valuetypes An IDL valuetype can be declared abstract. Have only operations – no state or factories. Have no generated OBV_ classes. Are not subject to single inheritance restrictions. Are inherited as public virtual base classes. Cannot be instantiated; cannot be parameters or the return type of an IDL operation. Essentially just a bundle of operation signatures. November 20, 2018

Supporting a Concrete Interface A valuetype is declared to support a concrete interface with the IDL keyword supports. A valuetype that supports a concrete interface is NOT a subtype of the interface and is NOT substitutable. The interface’s operations are mapped to pure virtual methods in the valuetype ABC. A skeleton (POA_) class is generated for the valuetype that inherits from the interface skeleton. The valuetype can be registered with a POA and manipulated via an object reference of the interface type; pass-by-reference semantics apply. November 20, 2018

Supporting an Abstract Interface Valuetypes can support multiple abstract interfaces. Abstract interfaces inherit from CORBA::AbstractBase, not CORBA::Object. Abstract interfaces have unique parameter passing semantics to their operations. A valuetype that supports an abstract interface IS a subtype of the interface and IS substitutable. Allows determination of pass-by-value vs. pass-by-reference semantics to be made at run-time. November 20, 2018

Reference Counting CORBA::ValueBase declares pure virtual _add_ref () and _remove_ref () methods. Programmer must fulfill the ValueBase reference counting interface with custom implementations or mix-in classes. CORBA::DefaultValueRefCountBase can serve as a base class for valuetypes that will never be registered with a POA. PortableServer::ValueRefCountBase must serve as a base class for valuetypes that will be registered with a POA. November 20, 2018

Valueboxes A valuetype with only a single state member is a “valuebox.” Declared as “valuetype” <identifier> <type> Ex: valuetype StringValue string; Any IDL type except a valuetype can be boxed. Valueboxes may not be a subtype or base type. Valueboxes for string and wstring are included in the CORBA module as StringValue and WStringValue. November 20, 2018

Custom Marshalling A programmer can provide custom code to marshal and unmarshal valuetype instances. A valuetype that is declared custom in IDL implicitly inherits from the abstract valuetype CustomMarshal. The concrete valuetype must provide implementations of the marshal () and unmarshal () operations. Intended to facilitate the integration of legacy code. November 20, 2018