Case Study: OMG/CORBA
Case Study: OMG/CORBA
Outline
1
Who is the OMG?
Goal of CORBA
2
Object Management Architecture
CORBAservices
■ Objects
■ Types
■ Modules
■ Attributes
■ Operations
■ Requests
■ Exceptions
■ Subtypes
3
OMG Interface Definition Language
Running Example
Organization
#name:string
Club uses
-noOfMembers:int 1 1..* Trainer
-location:Address -name:string
works for
+transfer(p:Player) +train()
1 1..*
has s
o a che
c 1..*
* Player
Team
plays in -name:string
-name:string
1 11..16 -Number:int
+bookGoalies()
+book()
© Wolfgang Emmerich, 1998/99
8
4
CORBA Object Model: Objects
Object type
interface Organization {
readonly attribute string name;
};
Constructed type
struct Address {
string street;
string postcode;
Atomic types string city;
};
5
CORBA Object Model: Attributes
Clients cannot
change value Attribute type
Attribute name
interface Team {
changeable readonly attribute string name;
attribute sequence<Trainer> coached_by;
attribute Club belongs_to;
attribute sequence<Player> players;
...
};
Constructed attribute type
Parameter kind
interface Team {
Parameter list
Return type ...
void bookGoalies(in Date d);
Oneway oneway void print();
Synchronization
};
Parameter type
Operation name Parameter name
used in requests
© Wolfgang Emmerich, 1998/99
12
6
CORBA Object Model: Requests
Operations declare
© Wolfgang Emmerich, 1998/99 exceptions they raise 14
7
CORBA Object Model: Subtypes
Implicit supertype:
Object
Inherited by Club
interface Organization {
readonly attribute string name;
}; Supertype
interface Club : Organization {
exception NotInClub{};
readonly attribute short noOfMembers;
readonly attribute Address location;
attribute sequence<Team> teams;
attribute sequence<Trainer> trainers;
void transfer(in Player p) raises NotInClub;
};
© Wolfgang Emmerich, 1998/99
15
Implementation Object
Dynamic Client ORB
Skeletons Adapter
Invocation Stubs Interface
ORB Core
8
Generation of Stubs/Skeletons
Team.idl
Client.cc Server.cc
IDL-Compiler
Teamcl.hh Teamsv.hh
Teamcl.cc Teamsv.cc
included in
generates
Client Server
reads
© Wolfgang Emmerich, 1998/99
17
9
Abstract POA Model
Server
ORB POA
?
Client
© Wolfgang Emmerich, 1998/99
19
10