CORBA IDL version 2.3.1 - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

CORBA IDL version 2.3.1

Description:

Used to specify the capabilities of distributed objects (CORBA ... typedef fixed 5,2 numb; const numb FNumber = 0123.450d; 12. Template Types cont. sequence ... – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 35
Provided by: wolfgang95
Category:
Tags: corba | idl | numb | version

less

Transcript and Presenter's Notes

Title: CORBA IDL version 2.3.1


1
CORBA IDLversion 2.3.1
2
What is IDL?
  • The Interface Definition Language
  • Used to specify the capabilities of distributed
    objects (CORBA interfaces)
  • map to different programming languages for
    implementation, eg
  • C
  • Java
  • COBOL
  • Smalltalk
  • etc

3
Interface Example
interface Account attribute double
Balance void Deposit(in double amount)
4
What's in an interface?
  • type declarations
  • constant declarations
  • exception declarations
  • attribute declarations
  • operation declarations
  • nothing (sometimesmore later in course)

5
Types
  • Basic
  • Template
  • Complex Declarators
  • Constructed

6
Basic Types
  • Integer
  • Floating Point
  • Char
  • Other

7
Integer Types
  • short (16 bits)
  • unsigned short
  • long (32 bits)
  • unsigned long
  • long long (64 bits)
  • unsigned long long
  • NOT int!

8
Float Types
  • float
  • double
  • long double

9
Char Types
  • char (8 bit)
  • wchar
  • encodes wide characters from any character set
  • but size is implementation dependent

10
Other Types
  • boolean
  • octet
  • 8 bit quantity
  • not converted when passed over the wire
  • any
  • represents any IDL type
  • allows for dynamic typing

11
Template Types
  • string
  • wstring
  • string of wchar instead of just char
  • fixed
  • typedef fixedlt5,2gt numb
  • const numb FNumber 0123.450d

12
Template Types cont.
  • sequence
  • one-dimensional
  • variable sized
  • bounded or unbounded
  • typedef sequenceltAccount,10gt AccountList
  • typedef sequenceltTransactiongt TransactionHistory

13
Complex Declarators
  • Array
  • can be multi-dimensional
  • fixed sized
  • typedef Account AccountList10
  • typedef short Matrix1010

14
Constructed Types
  • Enumerated Type
  • Structure
  • Union

15
Enumerated Type
enum CustomerType INDIVIDUAL, BUSINESS,
OTHER
16
Structure
union CustomerInfo... typedef sequenceltAccountgt
AccountList struct CustomerRecord
CustomerInfo info AccountList accounts
17
Union
union CustomerInfo switch(CustomerType) case
INDIVIDUAL struct indiv_s string
surname string first_name
indiv_info case BUSINESS struct
business_s long ABN string
business_name business_info default
string name
18
Constants and Literals
19
Constants and Literals
20
Literals
21
Operator Precedence
22
Operations
interface Account // ... oneway void
deposit(in double amount) void
withdrawal(inout double amount) double
getBalance() void getCustomerRecord(out
CustomerRecord cr)
23
User Exceptions
exception InsufficientFund exception
NotPermitted string reason interface
Account // ... void withdrawal(inout double
amount) raises(InsufficientFund,
NotPermitted) // ...
24
System Exceptions
enum completion_status COMPLETED_YES,
COMPLETED_NO, COMPLETED_MAYBE define
SYSEX(NAME) exception NAME \
unsigned long minor \
completion_status completed\ SYSEX(BA
D_PARAM) SYSEX(NO_PERMISSION) .... IDL
defines 29 system exceptions.
25
Inheritance
interface Account void deposit(in double
amount) void withdrawal(inout double
amount) raises(EInsufficientFund,
ENotPermitted) // ... interface
TermDepositAccount Account long
withdrawal() long getExpiryDate()

26
Names and Scopes
  • Modules
  • Interfaces
  • Structures
  • Unions
  • Exceptions
  • Operation Definitions

27
Names and Scopes
module Bank interface Bank ...
//error interface TermDepositAccount Account
... interface Customer struct
CustomerInfo ... CustomerInfo getInfo(in
AcCount acc) interface cuStomer ...
//error module ATM boolean
verifyPIN( in BankCustomerCustomerInfo
ci, in string pin)

28
Passing Objects By Value
  • valuetype
  • Different from
  • interface reference to remote object
  • struct no operations nor inheritance

29
Value Type
enum CustomerType ... union CustomerInfo
switch (CustomerType) ... typedef
sequenceltAccountgt AccountList valuetype
CustomerRecord private CustomerInfo
info public AccountList accounts readonly
attribute string ReportName readonly attribute
string SearchName Account MergeAccounts(in
AccountList accts)
30
Abstract Value Type
typedef sequenceltAccountgt AccountList abstract
valuetype CustomerRecord readonly attribute
string ReportName readonly attribute string
SearchName Account MergeAccounts(in AccountList
accts)
31
Single Inheritance
typedef sequenceltAccountgt AccountList valuetype
IndividualRecord CustomerRecord private
string surname private string first_name
32
Preprocessing
  • Based on ANSI C preprocessing
  • include source file inclusion
  • define macro substitution
  • ifdef, endif conditional compilation
  • pragma used to include RepositoryIds, and for
    non-critical implementation-dependent directives

33
Features Omitted
  • Native Types
  • DynAny type
  • Abstract Interfaces
  • Boxed Value Types
  • Context parameter of Operations

34
Further Information
  • Object Management Group. 1999. The Common Object
    Request Broker Architecture and Specification.
    Revision 2.3.1., Chapter 3 ftp//www.omg.org/pub/d
    ocs/formal/99-10-07.pdf
  • Henning, M., and S. Vinoski. 1999. Advanced CORBA
    Programming with C. Addison-Wesley.
  • Jon Siegel. 2000. CORBA 3 Fundamentals and
    Programming, 2nd Edition. OMG Press, John Wiley
    Sons.
Write a Comment
User Comments (0)
About PowerShow.com