CB
SE
, © P
rof.
Uw
e A
ßman
n 1
11b)
Cla
ssic
al C
ompo
nent
Sys
tem
s –
CO
RB
A
Pro
f. D
r. U
we
Aßm
ann
Flor
ian
Hei
denr
eich
Te
chni
sche
Uni
vers
ität D
resd
en
Inst
itut f
ür S
oftw
are-
und
M
ultim
edia
tech
nik
http
://st
.inf.t
u-dr
esde
n.de
11
-0.2
, Mai
4, 2
011
1.
Bas
ic m
echa
nism
s fo
r m
odul
arity
, exc
hang
abili
ty,
adap
tatio
n, tr
ansp
aren
cy
2.
Com
posi
tion
tech
niqu
e (c
onne
ctio
ns)
1.
Dyn
amic
Cal
l 2.
Trad
ed C
all
3.
Eva
luat
ion
acco
rdin
g to
our
cr
iteria
list
4.
CO
RB
A S
ervi
ces
5.
CO
RB
A Fa
cilit
ies
Pro
f. U
. Aßm
ann,
CB
SE
2
Obl
igat
ory
Rea
ding
►
ISC
, 3.1
-3.3
►
Szy
pers
ki 2
nd e
ditio
n, C
hap
13
►
http
://ja
va.s
un.c
om/ja
vase
/6/d
ocs/
tech
note
s/gu
ides
/idl/
►
http
://ja
va.s
un.c
om/d
evel
oper
/tech
nica
lArti
cles
/rele
ases
/cor
ba/
Pro
f. U
. Aßm
ann,
CB
SE
3
Lite
ratu
re
►
R. O
rfali,
D. H
arke
y: C
lient
/Ser
ver p
rogr
amm
ing
with
Jav
a an
d C
orba
. Wile
y&S
ons.
eas
y to
read
. ►
R. O
rfali,
D. H
arke
y, J
. Edw
ards
: Ins
tant
Cor
ba. A
ddis
on-W
esle
y.
►
CO
RB
A. C
omm
unic
atio
ns o
f the
AC
M, O
ct. 1
998.
All
artic
les.
O
verv
iew
on
CO
RB
A 3
.0.
►
CO
RB
A 3
.1 s
peci
ficat
ion:
http
://w
ww
.om
g.or
g/sp
ec/C
OR
BA
/3.1
/ ►
Jens
-Pet
er R
edlic
h, C
OR
BA
2.0
/ P
rakt
isch
e E
infü
hrun
g fü
r C++
und
Ja
va. V
erla
g: A
ddis
on-W
esle
y, 1
996.
ISB
N: 3
-827
3-10
60-1
Pro
f. U
. Aßm
ann,
CB
SE
4
The
CO
RB
A V
isio
n
One
Rep
osito
ry to
regi
ster
them
all,
One
Rep
osito
ry to
find
them
, O
ne R
epos
itory
to s
tart
them
all,
and
with
IIO
P b
ind
them
In
the
land
of C
OR
BA
whe
re th
e ob
ject
s lie
.
(J. S
iege
l, af
ter J
.J.R
. Tol
kien
)
CB
SE
, © P
rof.
Uw
e A
ßman
n 5
11b.
1 B
asic
Mec
hani
sms
Pro
f. U
. Aßm
ann,
CB
SE
6
CO
RB
A
►
Com
mon
Obj
ect R
eque
st B
roke
r Arc
hite
ctur
e®
►
Foun
ding
yea
r of t
he O
MG
(obj
ect m
anag
emen
t gro
up) 1
989
►
Goa
l: pl
ug-a
nd-p
lay
com
pone
nts
ever
ywhe
re
►
Cor
ba 1
.1 1
991
(IDL,
OR
B, B
OA
) ►
OD
MG
-93
(Sta
ndar
d fo
r OO
-dat
abas
es)
►
Cor
ba 2
.0 1
995,
late
r 2.2
and
2.4
►
Cor
ba 3
.0 1
999
Pro
f. U
. Aßm
ann,
CB
SE
7
Ingr
edie
nts
of C
OR
BA
►
Com
pone
nt M
odel
■
Com
pone
nts
are
clas
ses
and
obje
cts,
i.e.
, sim
ilar t
o ob
ject
-orie
nted
sof
twar
e .
In C
OR
BA
3.0
, the
CC
M h
as a
dditi
onal
ly b
een
intro
duce
d
■ C
ompo
nent
s ha
ve m
ore
com
pone
nt s
ecre
ts
. La
ngua
ge in
tero
pera
bilit
y by
uni
form
inte
rface
des
crip
tion
. Lo
catio
n tra
nspa
renc
y .
Nam
e tra
nspa
renc
y .
Tran
spar
ent n
etw
ork
prot
ocol
s ■
Sta
ndar
diza
tion
. C
OR
BA
Ser
vice
s .
CO
RB
A F
acili
ties
n
Hor
izon
tal v
s. v
ertic
al
►
Com
posi
tion
Tech
niqu
es
■ A
dapt
atio
n by
stu
bs a
nd s
kele
tons
■
CO
RB
A M
OF
for m
etam
odel
ling
Pro
f. U
. Aßm
ann,
CB
SE
8
OM
A (O
bjec
t Man
agem
ent A
rchi
tect
ure)
►
A s
oftw
are
bus,
bas
ed o
n th
e M
edia
tor (
Bro
ker)
des
ign
patte
rn
■ C
oupl
ed b
y de
cora
tor-
conn
ecto
rs
Obj
ect R
eque
st B
roke
r
Obj
ect S
ervi
ces
App
licat
ion
Inte
rface
s D
omai
n In
terfa
ces
Com
mon
Fa
cilit
ies
Pro
f. U
. Aßm
ann,
CB
SE
9
Cor
ba’s
Hyd
roce
phal
us
►
Cor
ba is
larg
e ■
Obj
ect R
eque
st B
roke
r – 2
000
page
s of
spe
cific
atio
n ■
Obj
ect S
ervi
ces
– 30
0 pa
ges
■ C
omm
on F
acili
ties
– 15
0 pa
ges
►
Tech
nica
l rea
sons
■
Cle
an d
etai
led
solu
tion
■ S
omet
imes
ove
rkill
►
Soc
iolo
gic
reas
ons
■ O
MG
is la
rge
(ove
r 800
par
tner
s) a
nd h
eter
ogen
ic
■ S
tand
ard
cove
rs a
wid
e ra
ge
►
Ling
uist
ic re
ason
s ■
Tons
of u
nint
uitiv
e 3-
capi
tals
-nam
es (O
MG
, OR
B, I
DL,
…)
Pro
f. U
. Aßm
ann,
CB
SE
10
The
Top
Cla
ss C
OR
BA
::Obj
ect
CO
RB
A::O
bjec
t
get_
impl
emen
tatio
n ge
t_in
terf
ace
is_n
il is
_a
crea
te_r
eque
st
dupl
icat
e re
leas
e ...
.
►
The
clas
s C
OR
BA
::Obj
ect
defin
es a
com
pone
nt m
odel
■
The
clas
s m
ust b
e in
herit
ed to
al
l obj
ects
in th
e ap
plic
atio
n ►
CO
RB
A su
ppor
ts re
flect
ion
and
intro
spec
tion:
■
get_
inte
rface
del
iver
s a
refe
renc
e to
the
entry
in th
e in
terfa
ce re
posi
tory
■
get_
impl
emen
tatio
n a
refe
renc
e to
the
impl
emen
tatio
n ►
Ref
lect
ion
wor
ks b
y th
e in
terfa
ce re
posi
tory
(li
st_i
nitia
l_re
fere
nces
from
the
CO
RB
A::O
RB
inte
rface
).
Pro
f. U
. Aßm
ann,
CB
SE
11
Prob
lem
: Mul
tiple
Inhe
ritan
ce o
f CO
RB
A
Obj
ect
►
CO
RB
A::O
bjec
t inc
lude
s co
de in
to a
cla
ss
►
Man
y la
ngua
ges
only
offe
r onl
y si
ngle
inhe
ritan
ce
■ A
pplic
atio
n su
per c
lass
mus
t be
a de
lega
tee
■ C
ould
be
solv
ed b
y m
ixin
inhe
ritan
ce (m
ixin
laye
rs)
CO
RB
A::O
bjec
t
App
licat
ionC
lass
th
at n
eeds
co
nnec
tion
App
licat
ionC
lass
S
uper
Cla
ss
CO
RB
A::O
bjec
t
App
licat
ionC
lass
th
at n
eeds
co
nnec
tion
App
licat
ionC
lass
S
uper
Cla
ss
CB
SE
, © P
rof.
Uw
e A
ßman
n 12
11b.
2 C
ompo
sitio
n Te
chni
que
of
CO
RB
A
(Bas
ic C
OR
BA
Con
nect
ions
)
Pro
f. U
. Aßm
ann,
CB
SE
13
Bas
ic C
onne
ctio
ns in
CO
RB
A
►
CO
RB
A c
ompo
ses
com
pone
nts
with
con
nect
ions
■
Sta
tic m
etho
d ca
ll w
ith s
tatic
stu
bs a
nd s
kele
tons
.
Loca
l or r
emot
e ■
Pol
ymor
phic
cal
l .
Loca
l or r
emot
e ■
Eve
nt tr
ansm
issi
on
■ C
allb
ack
(sim
plifi
ed O
bser
ver p
atte
rn)
■ D
ynam
ic in
voca
tion
(DII,
requ
est b
roki
ng)
. S
earc
hing
ser
vice
s dy
nam
ical
ly in
the
web
(loc
atio
n tra
nspa
renc
y of
a s
ervi
ce)
■ Tr
adin
g .
Find
ser
vice
s in
a y
ello
w p
ages
ser
vice
, bas
ed o
n pr
oper
ties
Pro
f. U
. Aßm
ann,
CB
SE
14
Stat
ic C
OR
BA
Cal
l
►
Adv
anta
ge: m
etho
ds o
f the
par
ticip
ants
are
sta
tical
ly k
now
n
■ In
dire
ct c
all b
y st
ub a
nd s
kele
tons
, with
out i
nvol
vem
ent o
f an
OR
B
■ S
uppo
rts d
istri
butio
n (e
xcha
nge
of lo
cal c
all i
n on
e ad
dres
s sp
ace
to re
mot
e ca
ll is
ve
ry e
asy)
.
Inhe
rit fr
om C
OR
BA
cla
ss
. W
rite
an ID
L sp
ec
■ N
o se
arch
for s
ervi
ce o
bjec
ts, r
athe
r fas
t ■
Bet
ter t
ype
chec
k, s
ince
the
com
pile
r kno
ws
the
invo
lved
type
s
►
The
call
goes
thro
ugh
the
serv
er o
bjec
t ada
pter
(ser
ver d
ecor
ator
) ■
Bas
ic (s
erve
r) o
bjec
t ada
pter
(BO
A)
■ P
orta
ble
(ser
ver)
obj
ect a
dapt
er (P
OA
) ■
This
hid
es th
e w
heth
er th
e se
rver
is tr
ansi
ent o
r per
sist
ent
Pro
f. U
. Aßm
ann,
CB
SE
15
Bas
ic O
bjec
t Ada
pter
BO
A
►
The
BO
A h
ides
■
Life
tim
e of
the
serv
er o
bjec
t (a
ctiv
atio
n: s
tart,
sto
p)
■ P
ersi
sten
cy
►
The
BO
A is
impl
emen
ted
in
ever
y O
RB
, for
min
imal
ser
vice
pr
ovis
ion
►
The
BO
A m
aint
ains
an
impl
emen
tatio
n re
posi
tory
(c
ompo
nent
regi
stry
) ►
It su
ppor
ts n
on-o
bjec
t-orie
nted
co
de
►
The
BO
A is
a re
al a
dapt
er (n
o de
cora
tor)
CO
RB
A::B
OA
crea
te
get_
id
disp
ose
set_
exce
ptio
n im
pl_i
s_re
ady
obj_
is_r
eady
ch
ange
_im
plem
enta
tion
deac
tivat
e_im
pl
deac
tivat
e_ob
j
Pro
f. U
. Aßm
ann,
CB
SE
16
Serv
er S
ite
Bas
ic O
bjec
t Ada
pter
B
OA
IDL
Ske
leto
n
Net
wor
k
Ser
ver /
Obj
ect I
mpl
emen
tatio
n
deac
tivat
e_ob
j de
activ
ate_
impl
im
pl_i
s_re
ady
obje
ct_i
s_re
ady
upca
lls cr
eate
get_
id
Pro
f. U
. Aßm
ann,
CB
SE
17
Obj
ect A
ctiv
atio
n on
the
Serv
er th
roug
h a
BO
A
Serv
er
obje
ct1
obje
ct2
CO
RB
A::B
OA
crea
te
get_
id
obj_
is_r
eady
obj_
is_r
eady
im
pl_i
s_re
ady
deac
tivat
e_ob
j
deac
tivat
e_ob
j
deac
tivat
e_im
pl
Pro
f. U
. Aßm
ann,
CB
SE
18
Port
able
Obj
ect A
dapt
er P
OA
►
The
PO
A is
a e
volu
tion
of th
e B
OA
in C
OR
BA
3.0
■ O
ne p
er s
erve
r, se
rvin
g m
any
obje
cts
■ N
este
d P
OA
s po
ssib
le, w
ith n
este
d na
me
spac
es
►
Use
r pol
icie
s fo
r obj
ect
man
agem
ent
■ U
ser-
writ
ten
inst
ance
man
ager
s fo
r m
anag
emen
t of o
bjec
t ins
tanc
es
CO
RB
A::P
OA
crea
te_P
OA
find_
POA
crea
te_r
efer
ence
di
spos
e se
t_ex
cept
ion
impl
_is_
read
y ob
j_is
_rea
dy
chan
ge_i
mpl
emen
tatio
n ac
tivat
e_ob
ject
de
activ
ate_
obje
ct
Pro
f. U
. Aßm
ann,
CB
SE
19
Obj
ect A
dapt
ers
Supp
ort D
iffer
ent S
erve
r Life
-Ti
me
Mod
els
►
Com
mon
ser
ver p
roce
ss (s
hare
d se
rver
) ■
Sev
eral
obj
ects
resi
de in
one
pro
cess
on
the
serv
er; t
he B
OA
initi
aliz
es th
em a
s th
read
s w
ith c
omm
on a
ddre
ss s
pace
(com
mon
apa
rtmen
t)
. de
activ
ate_
impl
, im
pl_i
s_re
ady,
obj
_is_
read
y ar
e m
appe
d di
rect
ly to
thre
ad
func
tions
►
Sepa
rate
ser
ver p
roce
ss (u
nsha
red
serv
er)
■ Fo
r eve
ry o
bjec
t an
own
proc
ess
►
Serv
er-p
er-r
eque
st (s
essi
on s
erve
r)
■ E
very
requ
est g
ener
ates
a n
ew p
roce
ss
■ S
imila
r to
Ses
sion
EJB
►
Pers
iste
nt s
erve
r ■
Ano
ther
app
licat
ion
stor
es th
e ob
ject
s (e
.g.,
a da
ta b
ase)
.
■ Th
e B
OA
pas
ses
on th
e qu
erie
s
■ S
imila
r to
Ent
ity B
ean
Pro
f. U
. Aßm
ann,
CB
SE
20
Cal
lbac
k C
onne
ctor
s w
ith th
e C
allb
ack
Serv
ice
►
The
Cal
lbac
k pa
ttern
is a
sim
plifi
ed O
bser
ver p
atte
rn
■ R
egis
tratio
n an
d no
tific
atio
n, b
ut n
ot s
tatu
s up
date
►
Cal
lbac
k fu
nctio
n re
gist
ratio
n ■
Reg
iste
r a p
roce
dure
var
iabl
e, a
clo
sure
(pro
cedu
re v
aria
ble
with
arg
umen
ts),
or a
re
fere
nce
to a
n ob
ject
at t
he s
ubje
ct, t
he s
erve
r
►
Cal
lbac
k w
orks
for a
ll la
ngua
ges,
not
onl
y ob
ject
-orie
nted
one
s
Clie
nt
Ser
ver
(sub
ject
) C
lient
2
regi
ster
Cal
lbac
k()
riseE
vent
()
callC
allb
ack(
)
retu
rn()
sign
al()
Pro
f. U
. Aßm
ann,
CB
SE
21
Even
t Con
nect
ions
►
Mos
t fle
xibl
e w
ay o
f com
mun
icat
ion
(als
o ca
lled
mes
sage
s)
■ A
sync
hron
ous
com
mun
icat
ion
■ W
orks
for e
very
CO
RB
A la
ngua
ge
►
Rec
eive
r mod
els
■ U
nica
st: o
ne re
ceiv
er
■ M
ultic
ast:
man
y re
ceiv
ers
■ D
ynam
ical
ly v
aryi
ng re
ceiv
ers
►
Push
mod
el: P
ushC
onsu
mer
/Pus
hSup
plie
r: ob
ject
del
iver
s ev
ent w
ith p
ush,
ev
ent i
s sh
ippe
d au
tom
atic
ally
►
Pull
mod
el: P
ullS
uppl
ier/P
ullC
onsu
mer
: ob
ject
wai
ts fo
r eve
nt w
ith p
ull
■ S
ynch
rono
us o
r asy
nchr
onou
s ■
Unt
yped
gen
eric
eve
nts,
or t
yped
by
IDL
►
Even
t cha
nnel
s as
inte
rmed
iate
buf
fers
■
Cha
nnel
s bu
ffer,
filte
r, an
d m
ap o
f pul
l to
push
■
Adv
anta
ge:
. A
sync
hron
ous
Wor
king
in th
e W
eb (w
ith II
OP
and
dyn
amic
Cal
l) .
Atta
chm
ent o
f leg
acy
syst
ems
inte
rest
ing
for u
ser i
nter
face
s, n
etw
ork
com
putin
g et
c.
■ D
isad
vant
age:
Ver
y ge
nera
l int
erfa
ce
CB
SE
, © P
rof.
Uw
e A
ßman
n 22
11b.
2.1
Dyn
amic
Cal
l Con
nect
or
(Req
uest
Bro
king
)
Pro
f. U
. Aßm
ann,
CB
SE
23
Dyn
amic
Cal
l Con
nect
or (R
eque
st B
roki
ng)
►
CO
RB
A d
ynam
ic c
all i
s a
sym
bolic
cal
l, i.e
., a
refle
ctiv
e ca
ll w
ith a
sy
mbo
lic n
ame
and
argu
men
ts
■ W
ithou
t kno
win
g th
at th
e se
rvic
e ex
ists
■
Ser
vice
s ca
n be
dyn
amic
ally
exc
hang
ed,
brou
ght i
nto
the
play
a p
oste
riori
■
With
out r
ecom
pila
tion
of c
lient
s, n
or re
gene
ratio
n of
stu
bs
■ B
indi
ng o
f nam
es to
adr
esse
s is
dyn
amic
►
Req
uire
s de
scrip
tions
of s
eman
tics
of s
ervi
ce c
ompo
nent
s ■
For i
dent
ifica
tion
of s
ervi
ces
. M
etad
ata
(des
crip
tive
data
): ca
talo
gues
of c
ompo
nent
s (in
terfa
ce re
posi
tory
, im
plem
enta
tion
repo
sito
ry)
. P
rope
rty s
ervi
ce (l
ater
)
►
and
a m
edia
tor,
that
look
s fo
r ser
vice
s: th
e O
RB
Pro
f. U
. Aßm
ann,
CB
SE
24
Obj
ect R
eque
st B
roke
r (O
RB
)
►
For a
dyn
amic
cal
l, th
e O
RB
mus
t be
invo
lved
►
The
OR
B is
a m
edia
tor (
desi
gn
patte
rn) b
etw
een
clie
nt a
nd s
erve
r ►
Hid
es th
e th
e en
viro
nmen
t fro
m c
lient
s ►
Can
talk
to o
ther
OR
Bs,
als
o on
the
web
CO
RB
A::O
RB
init
obje
ct_t
o_st
ring
strin
g_to
_obj
ect
BO
A_i
nit
list_
initi
al_s
ervi
ces
reso
lve_
initi
al_r
efer
ence
s ge
t_de
faul
t_co
ntex
t cr
eate
_env
ironm
ent
....
Pro
f. U
. Aßm
ann,
CB
SE
25
OR
B A
ctiv
atio
n
Clie
nt ob
ject
CO
RB
A O
RB
OR
B_i
nit
BO
A_i
nit
list_
initi
al_s
ervi
ces
reso
lve_
initi
al_r
efer
ence
s
Del
iver
s se
rvic
e na
mes
(as
st
rings
) D
eliv
ers
obje
ct re
fere
nces
to
ser
ver o
bjec
ts fr
om s
ervi
ce
nam
es
Initi
aliz
es th
e se
rver
BO
A
Initi
aliz
es th
e m
edia
tor
Pro
f. U
. Aßm
ann,
CB
SE
26
Req
uest
ing
a Se
rvic
e vi
a th
e O
RB
►
Ref
lect
ive
calls
■
Bui
ldin
g a
call
obje
ct (R
eque
st)
■ A
ddin
g ar
gum
ents
■
Invo
king
■
Pol
ling,
read
ing
CO
RB
A::O
RB
// dy
nam
ic c
all
crea
te_l
ist
crea
te_o
pera
tion_
list
add_
item
ad
d_va
lue
invo
ke
poll_
resp
onse
se
nd
get_
resp
onse
de
lete
...
.
Pro
f. U
. Aßm
ann,
CB
SE
27
Prot
ocol
of D
ynam
ic C
all (
DII)
<<<<
<
Serv
er ob
ject
Nam
ing
Con
text
get_
inte
rface
reso
lve
crea
te_l
ist
Clie
nt ob
ject
Ope
ratio
nDef
OR
B
add_
valu
e
add_
item
_req
uest in
voke
dele
te Fr
ee
Req
uest
argu
men
ts
Pro
f. U
. Aßm
ann,
CB
SE
28
Exam
ple
Dyn
amic
Cal
l in
C++
// W
ow
, a c
om
ple
x p
roto
co
l!!
CO
RB
A::
OR
B_p
tr o
rb;
ma
in(i
nt
arg
c, c
ha
r* a
rgv[
]) {
o
rb=
CO
RB
A::
OR
B_i
nit
(arg
c,a
rgv,
OR
BID
);
// a
lte
rnat
ive
de
scri
pti
on
of
serv
ice
C
osN
am
ing
::N
am
ing
Co
nte
xt_p
tr n
am
ing
=
Co
sNa
min
g::
Na
min
gC
on
text
::_n
arr
ow
(
::
reso
lve
_in
itia
l_re
fere
nc
es
(“N
am
eS
erv
ice
”));
C
OR
BA
::O
bje
ct_
ptr
ob
j;
try
{
ob
j= n
am
ing
->re
solv
e(m
k_n
am
e("
dii_
smp
l"))
; }
cat
ch (
CO
RB
A::
Exc
ep
tio
n)
{
ce
rr <
< "
no
t re
gis
tere
d"
<<
en
dl;
exi
t(1
); }
//
co
nst
ruc
t a
rgu
me
nts
C
OR
BA
::A
ny
val1
; va
l1 <
<=
(C
OR
BA
::S
ho
rt)
12
3;
CO
RB
A::
An
y va
l2;
val2
<<
= (
CO
RB
A::
Sh
ort
) 0
; C
OR
BA
::A
ny
val3
; va
l3 <
<=
(C
OR
BA
::S
ho
rt)
45
6;
// M
ake
re
qu
est
(sh
ort
form
) C
OR
BA
::R
eq
ue
st_p
tr r
q=
ob
j->
_re
qu
est
("o
p")
; //
Cre
ate
arg
um
en
t lis
t r
q->
arg
um
en
ts()
= o
rb->
cre
ate
_lis
t();
r
q->
arg
um
en
ts()
->a
dd
_va
lue
("a
rg1
",va
l1,C
OR
BA
::A
RG
_IN
);
rq
->a
rgu
me
nts
()->
ad
d_v
alu
e("
arg
2",
val2
,CO
RB
A::
AR
G_O
UT
);
rq
->a
rgu
me
nts
()->
ad
d_v
alu
e("
arg
3",
val3
,CO
RB
A::
AR
G_I
NO
UT
);
// S
tart
re
qu
est
(sy
nch
ron
ou
sly)
c
ou
t <
< "
sta
rt r
eq
ue
st"
<<
en
dl;
r
q->
invo
ke()
;
/
/ an
aly
ze r
esu
lt
CO
RB
A::
Sh
ort
rsl
t ;
if
(*(r
q->
resu
lt()
->va
lue
())
>>
= r
slt)
{
// A
na
lyze
th
e o
ut/
ino
ut-
pra
me
ters
(a
rg1
ha
s in
de
x 0
)
C
OR
BA
::S
ho
rt _
arg
2, _
arg
3;
*(rq
->a
rgu
me
nts
()->
ite
m(1
)->
valu
e()
) >
>=
_a
rg2
;
*(
rq->
arg
um
en
ts()
->it
em
(2)-
>va
lue
())
>>
= _
arg
3;
co
ut
<<
" a
rg2
= "
<
< _
arg
2 <
< "
arg
3=
" <
< _
arg
3
<
< "
re
turn
= "
<<
rsl
t <
< e
nd
l; }
e
lse
{
co
ut
<<
“re
sult
ha
s u
ne
xpe
cte
d t
ype
" <
< e
nd
l; }
}
Pro
f. U
. Aßm
ann,
CB
SE
29
DII
Invo
catio
n in
Jav
a (1
)
// Client.java
// Building Distributed Object Applications with CORBA
// Infowave (Thailand) Co., Ltd.
// http://www.waveman.com
// Jan 1998
public class Client {
public static void main(String[] args) {
if (args.length != 2) {
System.out.println("Usage: vbj Client <carrier-name> <aircraft-name>");
return;
}
String carrierName = args[0];
String aircraftName = args[1];
org.omg.CORBA.Object carrier = null;
org.omg.CORBA.Object aircraft = null;
org.omg.CORBA.ORB orb = null;
try {
orb = org.omg.CORBA.ORB.init(args, null);
}
catch (org.omg.CORBA.systemsxception se) {
System.err.println("ORB init failure " + se);
System.exit(1);
}
Pro
f. U
. Aßm
ann,
CB
SE
30
{ // scope
try {
carrier = orb.bind("IDL:Ship/AircraftCarrier:1.0",
carrierName, null, null);
} catch (org.omg.CORBA.systemsxception se) {
System.err.println("ORB init failure " + se);
System.exit(1);
}
org.omg.CORBA.Request request = carrier._request("launch");
request.add_in_arg().insert_string(aircraftName);
request.set_return_type(orb.get_priwithive_tc(
org.omg.CORBA.TCKind.tk_objref));
request.invoke();
aircraft = request.result().value().extract_Object();
}
{ // scope
org.omg.CORBA.Request request = aircraft._request("codeNumber");
request.set_return_type(orb.get_priwithive_tc(
org.omg.CORBA.TCKind.tk_string));
request.invoke();
String designation = request.result().value().extract_string();
System.out.println("Aircraft " + designation + " is coming your way");
}
DII
Invo
catio
n in
Jav
a (2
)
Pro
f. U
. Aßm
ann,
CB
SE
31
// Building Distributed Object Applications with CORBA
// Infowave (Thailand) Co., Ltd.
// http://www.waveman.com
// Jan 1998
public class Server {
public static void main(String[] args) {
org.omg.CORBA.ORB orb = null;
try {
orb = org.omg.CORBA.ORB.init(args, null);
} catch (org.omg.CORBA.systemsxception se) {
System.err.println("ORB init failure " + se);
System.exit(1);
}
org.omg.CORBA.BOA boa = null;
try {
boa = orb.BOA_init();
} catch (org.omg.CORBA.systemsxception se) {
System.err.println("BOA init failure " + se);
System.exit(1);
}
Ship.AircraftCarrier carrier =
new AircraftCarrierImpl("Nimitz");
try {
boa.obj_is_ready(carrier);
} catch (org.omg.CORBA.systemsxception se) {
System.err.println(
"Object Ready failure " + se);
System.exit(1);
}
System.out.println(
carrier + " ready for launch !!!");
try {
boa.impl_is_ready();
} catch (org.omg.CORBA.systemsxception se) {
System.err.println(
"Impl Ready failure " + se);
System.exit(1);
}
}
}
Serv
er Im
plem
enta
tion
Pro
f. U
. Aßm
ann,
CB
SE
32
Exam
ple:
Tim
e Se
rver
in J
ava
►
On
one
mac
hine
; 2 a
ddre
ss s
pace
s (p
roce
sses
) ►
Cal
l pro
vide
s cu
rren
t tim
e ►
Con
tain
s ■
IDL
■ S
erve
r .
Sta
rts O
RB
.
Initi
aliz
es S
ervi
ce
. G
ives
IOR
to th
e ou
tput
■ C
lient
.
Take
s IO
R
. C
alls
ser
vice
// TestTimeServer.idl
module TestTimeServer{
interface ObjTimeServer{
string getTime();
};
};
Pro
f. U
. Aßm
ann,
CB
SE
33
Serv
ice
Com
pone
nt
// TestTimeServerImpl.java – Server Skeleton
import CORBA.*;
class ObjTestTimeServerImpl extends
TestTimeServer.ObjTimeServer_Skeleton { // generated from IDL
// Variables
// Constructor
// Method (Service) Implementation
public String getTime() throws CORBA.SystemException {
return “Time: “ + currentTime;
}
};
Pro
f. U
. Aßm
ann,
CB
SE
34
Serv
er Im
plem
enta
tion
// TimeServer_Server.java
import CORBA.*;
public class TimeServer_Server{
public static void main(String[] argv){
try {
CORBA.ORB orb = CORBA.ORB.init();
…
ObjTestTimeServerImpl obj =
new ObjTestTimeServerImpl(…);
…
System.out.println(orb.object_to_string(obj));
}
catch (CORBA.SystemException e){
System.err.println(e);
}
}
};
Pro
f. U
. Aßm
ann,
CB
SE
35
Clie
nt Im
plem
enta
tion
(Sim
pler
Pro
toco
l)
// TimeServer_Client.java
import CORBA.*;
public class TimeServer_Client{
public static void main(String[] argv){
try {
CORBA.ORB orb= CORBA.ORB.init();
…
CORBA.object obj = orb.string_to_object(argv[0]);
…
TestTimeServer.ObjTimeServer timeServer =
TestTimeServerImpl.ObjTimeServer_var.narrow(obj);
…
System.out.println(timeServer.getTime());
}
catch (CORBA.SystemException e){
System.err.println(e);
}
}
};
Pro
f. U
. Aßm
ann,
CB
SE
36
Exec
utio
n
// starting server
C:\> java TimeServer_Server
IOR:00000000000122342435 …
// starting client
C:\> java TimeServer_Client IOR:00000000000122342435 …
Time: 14:35:44
Pro
f. U
. Aßm
ann,
CB
SE
37
OR
Bs
►
Java
-bas
ed
■ IB
M W
ebS
pher
e ■
ION
A O
rbix
: In
Java
, O
RB
lets
pos
sibl
e ■
BE
A W
ebLo
gic
■ V
isib
roke
r (in
Net
scap
e)
■ V
oyag
er (O
bjec
tSpa
ce) (
with
M
obile
Age
nts)
■
free:
Jac
OR
B, I
LU, J
orba
, D
ynaO
RB
►
C-b
ased
■
AC
E O
RB
TA
O, U
nive
rsity
W
ashi
ngto
n (w
ith tr
ader
)
■ Li
nux
OR
BIT
(gno
me)
■ Li
nux
MIC
O
►
Pyth
on-b
ased
■
fnor
b
►
http
://w
ww
.om
g.or
g
CB
SE
, © P
rof.
Uw
e A
ßman
n 38
11b.
2.2
Trad
er-B
ased
Cal
l
The
foun
datio
n of
ser
vice
-orie
nted
arc
hite
ctur
e (S
OA
)
Pro
f. U
. Aßm
ann,
CB
SE
39
Bey
ond
Dyn
amic
Cal
l: Se
rvic
e C
all w
ith th
e Tr
ader
Ser
vice
►
A s
ervi
ce c
all i
s a
call,
not
bas
ed o
n na
min
g bu
t on
sem
antic
at
tribu
tes,
pub
lishe
d pr
oper
ties
■
Req
uire
s a
yello
w p
age
dire
ctor
y of
ser
vice
s
►
Ser
vice
-orie
nted
arc
hite
ctur
es (S
OA
), re
quire
s m
atch
mak
ing
of
serv
ices
■
The
OR
B re
solv
es o
pera
tions
stil
l bas
ed o
n na
min
g (w
ith th
e na
me
serv
ice)
. The
tra
der,
how
ever
, res
olve
s se
rvic
es w
ithou
t nam
es, o
nly
base
d on
pro
perti
es a
nd
polic
ies
►
The
trade
r get
s of
fers
from
ser
vers
, con
tain
ing
new
ser
vice
s
Trad
er
Clie
nt S
ervi
ce
Med
iato
r pat
tern
, m
edia
tor l
ets
clie
nts
look
up s
ervi
ces
Inte
ract
Impo
rt fu
nctio
nalit
y E
xpor
t fu
nctio
nalit
y
Pro
f. U
. Aßm
ann,
CB
SE
40
Serv
ice
Offe
rs fo
r Tra
der
►
Ser
vice
offe
r (IO
R w
ith p
rope
rties
(met
adat
a))
■ P
rope
rties
des
crib
e se
rvic
es
■ A
re u
sed
by tr
ader
s to
mat
ch s
ervi
ces
to q
uerie
s ■
not f
acet
-bas
ed, o
ne-d
imen
sion
al
►
Dyn
amic
pro
perty
■
A p
rope
rty c
an b
e qu
erie
d dy
nam
ical
ly b
y th
e tra
der o
f ser
vice
■
The
serv
ice-
obje
ct c
an d
eter
min
e th
e va
lue
of a
dyn
amic
pro
perty
ane
w
►
Mat
chin
g w
ith th
e st
anda
rd c
onst
rain
t lan
guag
e ■
Boo
lean
exp
ress
ions
abo
ut p
rope
rties
■
Num
eric
and
stri
ng c
ompa
rison
s
Pro
f. U
. Aßm
ann,
CB
SE
41
Trad
ers
Prov
ide
Serv
ice
Hop
ping
►
If a
trade
r doe
sn’t
find
a se
rvic
e, it
ca
lls n
eigh
bor t
rade
rs
■ D
esig
n pa
ttern
Cha
in o
f R
espo
nsib
ility
►
Gra
ph o
f tra
ders
■
Link
s to
nei
ghbo
rs v
ia
Trad
erLi
nk
■ Tr
ader
Link
filte
rs
quer
ies
and
m
anip
ulat
e vi
a po
licie
s
trade
r 1
trade
r 1
trade
r 4
trade
r 3
trade
r 2
Pol
icie
s, th
at
chan
ge th
e va
lues
of
the
prop
ertie
s du
ring
pass
ing
on
Flow
of t
he
prop
ertie
s of
th
e se
rvic
e qu
ery
Offe
rs w
ith
the
trade
r
Pro
f. U
. Aßm
ann,
CB
SE
42
Mod
ifica
tion
of Q
uerie
s
►
Pol
icie
s pa
ram
eter
ize
the
beha
viou
r of t
he tr
ader
s an
d th
e Tr
ader
Link
s
■ Fi
lters
, i.e
., va
lues
, mod
ifyin
g th
e qu
erie
s:
■ m
ax_s
earc
h_ca
rd: m
axim
um c
ardi
nalit
y fo
r the
ong
oing
sea
rche
s
■ m
ax_m
atch
_car
d: m
axim
um c
ardi
nalit
y fo
r mat
chin
gs
■ m
ax_h
op_c
ount
: car
dina
lity
sear
ch d
epth
in th
e gr
aph
po
ssib
le
off
ers
po
ssib
le
off
ers
po
ssib
le
off
ers
po
ssib
le
off
ers
fou
nd
off
ers
inve
stig
ated
o
ffer
s
ca
rdin
alit
ies
for
sea
rch
c
ard
ina
litie
s
for
mat
chin
g
Ca
rdin
alit
ies
fo
r re
turn
off
ers
Pro
f. U
. Aßm
ann,
CB
SE
43
Inte
rfac
es T
radi
ng S
ervi
ce
►
Bas
ic in
terfa
ces
■ Lo
okup
(que
ry)
■ R
egis
ter (
for e
xpor
t, re
tract
, im
port
of s
ervi
ces)
■ A
dmin
(inf
o ab
out s
ervi
ces)
■ Li
nk (c
onst
ruct
ion
of t
rade
r gra
ph)
►
How
doe
s a
look
up q
uery
look
like
? ■
Lookup.Query(in ServicetypeName, in Constraint,
in PolicySeq, in SpecifiedProperties,
in howTo, out OfferSequence, offerIterator)
►
Unf
ortu
nate
ly, n
o fa
cete
d m
atch
mak
ing
poss
ible
!
Pro
f. U
. Aßm
ann,
CB
SE
44
CO
RB
A T
rade
r Typ
es
Lo
oku
p
sim
ple
trade
r
Lo
oku
p
stan
dalo
ne
trade
r
Lo
oku
p R
eg
iste
r R
eg
iste
r A
dm
in
soc
ial t
rad
er
(lin
ked
tra
de
r)
Lo
oku
p Re
gis
ter
Ad
min
Lin
k
sub
stit
ute
t
rad
er
(pro
xy t
rad
er)
Lo
oku
p Re
gis
ter
Ad
min
pro
xy
full-
serv
ice
tra
de
r
Lo
oku
p Re
gis
ter
Ad
min
Lin
k p
roxy
quer
y tra
der
Pro
f. U
. Aßm
ann,
CB
SE
45
Cor
ba 3
.0
►
Pro
vide
s th
e w
ell-d
efin
ed p
acka
ging
for p
rodu
cing
com
pone
nts
■ C
OR
BA
Com
pone
nt M
odel
(CC
M):
sim
ilar t
o E
JB
►
Mes
sage
Ser
vice
MO
M: O
bjec
ts h
ave
asyn
chro
nous
buf
fere
d m
essa
ge q
ueue
s
►
Lang
uage
map
ping
s av
oid
IDL
►
Gen
erat
ing
IDL
from
lang
uage
spe
cific
type
def
initi
ons
►
C++
2ID
L, J
ava2
IDL,
…
►
XM
L in
tegr
atio
n (S
OA
P m
essa
ges)
►
Scr
iptin
g (C
OR
BA
scr
ipt),
a c
ompo
sitio
n la
ngua
ge
CB
SE
, © P
rof.
Uw
e A
ßman
n 46
11b.
3 Ev
alua
tion
of C
OR
BA
as c
ompo
sitio
n sy
stem
Pro
f. U
. Aßm
ann,
CB
SE
47
Com
pone
nt M
odel
►
Mec
hani
sms
for s
ecre
ts a
nd tr
ansp
aren
cy: v
ery
good
■
Inte
rface
and
Impl
emen
tatio
n re
posi
tory
■
Com
pone
nt la
ngua
ge h
idde
n (in
tero
pera
bilit
y)
■ Li
fe-ti
me
of s
ervi
ce h
idde
n ■
Iden
tity
of s
ervi
ces
hidd
en
■ Lo
catio
n hi
dden
►
No
para
met
eriz
atio
n ►
Sta
ndar
diza
tion:
qui
te g
ood!
■
Ser
vice
s, a
pplic
atio
n se
rvic
es a
re a
vaila
ble
■ O
n th
e ot
her h
and,
som
e st
anda
rds
are
FAT
■ Te
chni
cal v
s. a
pplic
atio
n sp
ecifi
c vs
bus
ines
s co
mpo
nent
s:
■ ..
but f
or b
usin
ess
obje
cts,
the
stan
dard
s m
ust b
e ex
tend
ed (v
ertic
al fa
cilit
ies)
(th
ats´
s w
here
the
mon
ey is
)
Pro
f. U
. Aßm
ann,
CB
SE
48
Com
posi
tion
Tech
niqu
e
►
Mec
hani
sms
for c
onne
ctio
n ■
Mec
hani
sms
for a
dapt
atio
n .
Stu
bs, s
kele
tons
, ser
ver a
dapt
ers
■ M
echa
nism
s fo
r glu
eing
: mar
shal
ling
base
d on
IDL
►
Mec
hani
sms
for a
spec
t sep
arat
ion
■ M
ultip
le in
terfa
ces
per o
bjec
t .
Faca
de c
lass
es/o
bjec
ts (d
esig
n pa
ttern
faca
de)
►
Not
hing
for e
xten
sion
s ►
Mec
hani
sms
for m
eta-
mod
elin
g ■
Inte
rface
Rep
osito
ries
with
type
cod
es
■ Im
plem
enta
tion
repo
sito
ries
■ D
ynam
ic c
all a
nd tr
aded
cal
l are
refle
ctiv
e an
d in
trosp
ectiv
e
►
Sca
labi
lity
■ C
onne
ctio
ns c
anno
t eas
ily b
e ex
chan
ged
(exc
ept s
tatic
loca
l and
rem
ote
call)
Pro
f. U
. Aßm
ann,
CB
SE
49
Com
posi
tion
Lang
uage
►
Wea
k: C
OR
BA
scr
iptin
g pr
ovid
es th
e a
faci
lity
to w
rite
glue
cod
e, b
ut
only
bla
ck-b
ox c
ompo
sitio
n
Pro
f. U
. Aßm
ann,
CB
SE
50
CO
RB
A
Sca
labi
lity
Ada
ptat
ion
Met
acom
posi
tion
Asp
ect S
epar
atio
n
Ext
ensi
bilit
y S
oftw
are
proc
ess
Con
nect
ion
Pro
duct
qua
lity
CB
SE
, © P
rof.
Uw
e A
ßman
n 51
11b.
4 C
orba
Ser
vice
s
(opt
iona
l mat
eria
l)
Pro
f. U
. Aßm
ann,
CB
SE
52
Lite
ratu
re
►
OM
G. C
OR
BA
ser
vice
s: C
omm
on O
bjec
t Ser
vice
Spe
cific
atio
ns.
http
://w
ww
.om
g.or
g.
►
OM
G: C
OR
BA
faci
litie
s: C
omm
on O
bjec
t Fac
ilitie
s S
peci
ficat
ions
.
Pro
f. U
. Aßm
ann,
CB
SE
53
Ove
rvie
w o
n C
orba
Ser
vice
s
►
Ser
vice
s pr
ovid
e fu
nctio
nalit
y a
prog
ram
min
g la
ngua
ge m
ight
not
pr
ovid
e (e
.g, C
obol
, For
tran)
►
16+
stan
dard
ized
ser
vice
inte
rface
s (i.
e., a
libr
ary)
■
Sta
ndar
dize
d, b
ut s
tatu
s of
impl
emen
tatio
n di
ffere
nt d
epen
ding
on
prod
ucer
►
Obj
ect s
ervi
ces
■ D
eal w
ith fe
atur
es a
nd m
anag
emen
t of o
bjec
ts
►
Col
labo
ratio
n se
rvic
es
■ D
eal w
ith c
olla
bora
tion,
i.e.
, obj
ect c
onte
xts
►
Bus
ines
s se
rvic
es
■ D
eal w
ith b
usin
ess
appl
icat
ions
►
The
serv
ices
ser
ve fo
r crit
erio
n M
-3, s
tand
ardi
zatio
n. T
hey
are
very
im
porta
nt to
incr
ease
reus
e.
■ R
emem
ber,
they
are
ava
ilabl
e fo
r eve
ry la
ngua
ge, a
nd o
n di
strib
uted
sys
tem
s!
Pro
f. U
. Aßm
ann,
CB
SE
54
Obj
ect S
ervi
ces:
Rat
her S
impl
e
►
Nam
e se
rvic
e (d
irect
ory
serv
ice)
■
Rec
ords
ser
ver o
bjec
ts in
a s
impl
e tre
e-lik
e na
me
spac
e ■
(Is a
sim
ple
com
pone
nt s
yste
m it
self)
►
Life
cycl
e se
rvic
e (a
lloca
tion
serv
ice)
■
Not
aut
omat
ic; s
eman
tics
of d
eallo
catio
n un
defin
ed
►
Pro
perty
ser
vice
(fea
ture
ser
vice
for o
bjec
ts)
►
Per
sist
ency
ser
vice
(sto
ring
obje
cts
in d
ata
base
s)
►
Rel
atio
nshi
p se
rvic
e to
bui
ld in
tero
pera
ble
rela
tions
and
gra
phs
■ S
uppo
rt of
sta
ndar
d re
latio
ns re
fere
nce,
con
tain
men
t ■
Div
ided
in s
tand
ard
role
s co
ntai
ns, c
onta
ined
In, r
efer
ence
s, re
fere
nced
►
Con
tain
er s
ervi
ce (c
olle
ctio
n se
rvic
e)
Pro
f. U
. Aßm
ann,
CB
SE
55
Col
labo
ratio
n Se
rvic
es
►
Com
mun
icat
ion
serv
ices
■
Res
embl
e co
nnec
tors
in a
rchi
tect
ure
syst
ems,
but
can
not b
e ex
chan
ged
to e
ach
othe
r
■ E
vent
ser
vice
. pu
sh m
odel
: the
com
pone
nts
push
eve
nts
into
the
even
t cha
nnel
. pu
ll m
odel
: the
com
pone
nts
wai
t at t
he c
hann
el a
nd e
mpt
y it
■ C
allb
ack
serv
ice
►
Par
alle
lism
■
Con
curr
eny
serv
ice:
lock
s
■ O
bjec
t tra
nsac
tion
serv
ice,
OTS
: Fla
t tra
nsac
tions
on
obje
ct g
raph
s
. N
este
d tra
nsac
tions
?
Pro
f. U
. Aßm
ann,
CB
SE
56
Bus
ines
s Se
rvic
es
►
Trad
er s
ervi
ce
■ Y
ello
w P
ages
, loc
aliz
atio
n of
ser
vice
s
►
Que
ry s
ervi
ce
■ S
earc
h fo
r obj
ects
with
attr
ibut
es a
nd th
e O
QL,
SQ
L (O
DM
G-9
3)
►
Lice
nsin
g se
rvic
e ■
For a
pplic
atio
n pr
ovid
ers
(app
licat
ion
serv
ers)
■ Li
cens
e m
anag
ers
►
Sec
urity
ser
vice
■
Use
of S
SL
and
othe
r bas
ic s
ervi
ces
Pro
f. U
. Aßm
ann,
CB
SE
57
Dep
ende
ncie
s B
etw
een
the
Serv
ices
Nam
es
Life
-tim
e
Rel
atio
ns
Per
sist
ency
M
arsh
allin
g
Con
curr
ency
Tran
sact
ions
Que
ry
Trad
er
Pro
perti
es
Sec
urity
Eve
nts
Lice
nses
Col
lect
ions
C
allb
ack
Pro
f. U
. Aßm
ann,
CB
SE
58
Obj
ect S
ervi
ces:
Nam
es
►
Bin
ding
of
a na
me
asso
ciat
es a
nam
e to
an
obje
ct in
a n
ame
spac
e (d
irect
ory,
sco
pe, n
amin
g co
ntex
t) ■
A n
ame
spac
e is
an
asso
ciat
ive
arra
y w
ith a
set
of b
indi
ngs
of n
ames
to v
alue
s ■
Nam
espa
ces
are
recu
rsiv
e, i.
e., t
hey
can
refe
renc
e ea
ch o
ther
and
bui
ld n
ame
grap
hs
■ O
ther
s: A
ctiv
e D
irect
ory,
LD
AP
►
The
repr
esen
tatio
n of
a n
ame
is b
ased
on
abst
ract
syn
tax,
not
on
the
conc
rete
syn
tax
of a
ope
ratin
g sy
stem
or U
RL.
■
A n
ame
cons
ists
of a
tupl
e (Id
entif
ier,
Kin
d).
■ Th
e id
entif
ier i
s th
e re
al n
ame,
the
Kin
d te
lls h
ow th
e na
me
is re
pres
ente
d (e
.g.,
c_so
urce
, obj
ect_
code
, exe
cuta
ble,
pos
tscr
ipt,.
.).
■ Fo
r cre
atio
n of
nam
es th
ere
is a
libr
ary
(des
ign
patte
rn A
bstra
ct F
acto
ry).
Pro
f. U
. Aßm
ann,
CB
SE
59
Nam
e Se
rvic
e C
osN
amin
g
bind
(in N
ame
n, in
Obj
ect o
bj) /
/ ass
ocia
te a
nam
e re
bind
(in N
ame
n, in
Obj
ect o
bj)
bind
_con
text
re
bind
_con
text
m
k_na
me(
Stri
ng s
) O
bjec
t res
olve
un
bind
(in N
ame
n) /
/ dis
asso
ciat
e a
nam
e N
amin
gCon
text
new
_con
text
; N
amin
gCon
text
bin
d_ne
w_c
onte
xt(in
Nam
e n)
vo
id d
estro
y vo
id li
st(..
)
_nar
row
()
Cos
Nam
ing:
:Nam
ingC
onte
xt
Pro
f. U
. Aßm
ann,
CB
SE
60
Nam
e Se
rvic
e
void bind(in Name n, in Object obj)
raises(NotFound, Cannotproceed, InvalidName, AlreadyBoand);
void rebind(in Name n, in Object obj)
raises(NotFound, Cannotproceed, InvalidName );
void bind_context(in Name n, in NamingContext nc)
raises(NotFound, Cannotproceed, InvalidName, AlreadyBoand );
void rebind_context(in Name n, in NamingContext nc)
raises( NotFound, Cannotproceed, InvalidName );
Name mk_name(String s);
Object resolve(in Name n)
raises( NotFound, Cannotproceed, InvalidName );
void unbind(in Name n)
raises( NotFound, Cannotproceed, InvalidName );
NamingContext new_context();
NamingContext bind_new_context(in Name n)
raises( NotFound, AlreadyBoand, Cannotproceed, InvalidName );
void destroy()
raises( NotEmpty );
void list(in unsigned long how_many,
out BindingLis bl, out Bindingeserator bi );
Pro
f. U
. Aßm
ann,
CB
SE
61
Nam
e Se
rvic
e in
IDL
module CosNaming{
struct NameComponent {
string id;
string kind;
};
typedef sequence <NameComponent> Name;
enum BindingType { nobject, ncontext };
struct Binding {
Name binding_name;
BindingType binding_type;
};
typedef sequence <Binding> BindingList;
interface BindingIterator;
interface NamingContext {
enum NotFoundReason { missing_node,
not_context, not_object };
exception NotFound {
NotFoundReason why;
Name rest_of_name;
};
}
exception Cannotproceed {
NamingContext cxt;
Name rest_of_name;
};
exception InvalidName {};
exception AlreadyBoand {};
exception NotEmpty {};
// methods see previous slide
};
interface BindingIterator {
boolean next_one(out Binding b);
boolean next_n(in unsigned long
how_many,
out BindingLis bl);
void destroy();
};
…
Pro
f. U
. Aßm
ann,
CB
SE
62
Bin
din
g (a
sso
cia
tio
n)
Se
arc
h/c
reat
e n
am
e s
pa
ce
Use
of N
ames
Sys
tem
de
pe
nd
en
t n
am
e Co
rba
-Na
me
ob
jec
t
Se
arc
h O
bje
ct
na
me
sp
ac
e
Cre
ate
Na
me
ob
jec
t
Pro
f. U
. Aßm
ann,
CB
SE
63
Nam
e Se
rvic
e: E
xam
ple
// From: Redlich
import java.io.*;
import java.awt.*;
import IE.Iona.Orbix2.CORBA.SystemException; // OrbixWeb
import CosNaming.NamingContext; // name service/context
import CosNaming.NamingContext.*; // name service/Exceptions
import Calc5.calc.complex; // Typ 'complex' from Calc5
class MyNaming extends CosNaming {
...
}
public class client extends Frame {
private Calc5.calc.Ref calc;
private TextField inR, inI;
private Button setB, addB, multB,
divB, quitB, zeroB;
public static void main(String argv[])
{
CosNaming.NamingContext.Ref cxt;
Calc5.calc_factory.Ref cf;
Frame f;
try {
cxt= NamingContext._narrow( MyNaming.
resolve_initial_references(MyNaming.NameService));
cf = Calc5.calc_factory._narrow(
cxt.resolve(MyNaming.mk_name("calcfac")));
f = new client(cf.create_new_calc());
f.pack();
f.show();
}
catch (Exception ex) {
System.out.println("Calc-5/Init:" + ex.toString());
}
}
Pro
f. U
. Aßm
ann,
CB
SE
64
Obj
ect S
ervi
ces:
Per
sist
ency
►
Def
initi
on o
f a P
ersi
sten
t Obj
ect I
dent
ifier
(PID
) ■
refe
renc
es th
e va
lue
of C
OR
BA
-obj
ects
(in
cont
rast
to a
CO
RB
A-o
bjec
t)
►
Inte
rface
■
conn
ect,
disc
onne
ct, s
tore
, res
tore
, del
ete
►
Atta
chm
ent t
o da
ta b
ases
pos
sibl
e (a
lso
OD
MG
com
patib
le)
Pro
f. U
. Aßm
ann,
CB
SE
65
Obj
ect S
ervi
ces:
Pro
pert
y Se
rvic
e
►
Man
agem
ent o
f lis
ts o
f fea
ture
s (p
rope
rties
) for
obj
ects
■
Pro
perti
es a
re s
tring
s
■ D
ynam
ical
ly e
xten
sibl
e
►
Con
cept
wel
l-kno
wn
as
■ LI
SP
pro
perty
list
s, a
ssoc
iativ
e ar
rays
, Jav
a pr
oper
ty c
lass
es
►
Itera
tors
for p
rope
rties
►
Inte
rface
: ■
defin
e_pr
oper
ty, d
efin
e_pr
oper
ties,
get
_pro
perty
_val
ue, g
et_p
rope
rties
, de
lete
_pro
perty
,
Pro
f. U
. Aßm
ann,
CB
SE
66
Col
labo
ratio
n Se
rvic
es: T
rans
actio
ns
►
Wha
t a d
ream
: the
Web
as
data
bas
e w
ith n
este
d tra
nsac
tions
. S
cena
rios:
■
Acc
ount
s as
Web
-obj
ects
. Tra
nsfe
rs a
s Tr
ansa
ctio
n on
the
obje
cts
of s
ever
al
bank
s
■ P
aral
lel w
orki
ng o
n w
eb s
ites:
how
to m
ake
cons
iste
nt?
►
Sta
ndar
d 2-
phas
e co
mm
it pr
otoc
ol:
■ be
gin_
ta, r
ollb
ack,
com
mit
►
Nes
ted
trans
actio
ns
■ be
gin_
subt
rans
actio
n, ro
llbac
k_su
btra
nsac
tion,
com
mit_
subt
rans
actio
n
CB
SE
, © P
rof.
Uw
e A
ßman
n 67
11b.
5 C
OR
BA
Fac
ilitie
s
(Sta
ndar
ds fo
r App
licat
ion
Dom
ains
)
App
licat
ion
dom
ain
spec
ific
inte
rface
s
Pro
f. U
. Aßm
ann,
CB
SE
68
Hor
izon
tal F
acili
ties
►
Use
r int
erfa
ces
■ P
rintin
g, S
crip
ting
■ C
ompo
und
docu
men
ts: s
ince
199
6 O
penD
oc is
acc
epte
d as
sta
ndar
d fo
rmat
. S
ourc
e C
ode
has
been
rele
ased
of I
BM
►
Info
rmat
ion
man
agem
ent
■ M
etad
ata(
met
a ob
ject
faci
lity,
MO
F)
■ To
ol in
terc
hang
e: a
text
- and
stre
am b
ased
exc
hang
efor
mat
for U
ML
(XM
I)
■ C
omm
on W
areh
ouse
Mod
el (C
WM
): M
OF-
base
d m
etas
chem
a fo
r dat
abas
e ap
plic
atio
ns
Pro
f. U
. Aßm
ann,
CB
SE
69
Vert
ical
Fac
ilitie
s (D
omai
n-Sp
ecifi
c Fa
cilit
ies)
Th
e D
omai
n te
chno
logy
com
mitt
ee (D
TC) c
reat
es d
omai
n ta
sk fo
rces
DTF
for a
ap
plic
atio
n do
mai
n
►
Bus
ines
s ob
ject
s ►
Fina
nce/
insu
ranc
e ■
Cur
renc
y fa
cilit
y
►
Ele
ctro
nic
com
mer
ce
►
Man
ufac
turin
g ■
Pro
duct
dat
a m
anag
emen
t ena
bler
s P
DM
►
Med
icin
e (h
ealth
care
Cor
baM
ed)
■ Le
xico
n Q
uery
Ser
vice
■ P
erso
n Id
entif
ier S
ervi
ce P
IDS
►
Tele
com
mun
icat
ions
■
Aud
io/v
isua
l stre
am c
ontro
l obj
ect
■ N
otifi
catio
n se
rvic
e
►
Tran
spor
tatio
n
Pro
f. U
. Aßm
ann,
CB
SE
70
CO
RB
A F
acili
ties
and
UM
L Pr
ofile
s
►
Sin
ce 2
000,
the
OM
G d
escr
ibes
dom
ain-
spec
ific
voca
bula
ries
with
U
ML
prof
iles
■ P
roba
bly,
all
CO
RB
A fa
cilit
ies
will
end
up
in U
ML
prof
iles
►
A U
ML
Pro
file
is a
UM
L di
alec
t of a
app
licat
ion
spec
ific
dom
ain
■ W
ith n
ew s
tere
otyp
es a
nd ta
gged
val
ues
■ C
orre
spon
ds to
an
exte
nsio
n of
the
UM
L m
etam
odel
■
Cor
resp
onds
to a
dom
ain
spec
ific
lang
uage
with
ow
n vo
cabu
lary
■
Eve
ry e
ntry
in p
rofil
e is
a te
rm
►
Exa
mpl
e U
ML
Pro
files
: ■
ED
OC
Ent
erpr
ise
Dis
tribu
ted
Obj
ects
Com
putin
g ■
Mid
dlew
are
prof
iles:
Cor
ba, .
NE
T, E
JB
■ E
mbe
dded
and
real
tim
e sy
stem
s:
. M
AR
TE p
rofil
e on
sch
edul
abili
ty, p
erfo
rman
ce, t
ime
. R
aven
scar
Pro
file
.
HID
OO
RS
Pro
file
on re
al-ti
me
mod
ellin
g w
ww
.hid
oors
.org
CB
SE
, © P
rof.
Uw
e A
ßman
n 71
11b.
6. C
OR
BA
and
the
Web
Pro
f. U
. Aßm
ann,
CB
SE
72
Cor
ba a
nd th
e W
eb
►
HTM
L so
lves
man
y of
the
CO
RB
A p
robl
ems
►
HTT
P o
nly
for d
ata
trans
port
■ H
TTP
can
not c
all m
etho
ds, e
xcep
t by
CG
I-Gat
eway
-func
tiona
lity
(com
mon
ga
tew
ay in
terfa
ce)
■ B
ehin
d th
e C
GI-i
nter
face
is a
gen
eral
s pr
ogra
m, c
omm
unic
atin
g w
ith H
TTP
with
un
type
d en
viro
nmen
t var
iabl
es (
HA
CK
!)
■ ht
tp-S
erve
r are
sim
ple
OR
Bs,
pag
es a
re o
bjec
ts
■ Th
e U
RI/U
RL-
nam
e sc
hem
a ca
n be
inte
grat
ed in
to C
OR
BA
►
IIOP
bec
omes
a s
tand
ard
inte
rnet
pro
toco
l ■
Sta
ndar
d po
rts, U
RL-
map
ping
s an
d S
tand
ard-
prox
ies
for F
irew
alls
are
ava
ilabl
e
►
CO
RB
A is
an
exte
nsio
n of
HTT
P o
f dat
a to
cod
e
Pro
f. U
. Aßm
ann,
CB
SE
73
CO
RB
A a
nd J
ava
►
Java
is a
n id
eal p
artn
er fo
r Cor
ba :
■ B
ytec
ode
is m
obile
, i.e
.,
. A
pple
ts:
mov
e ca
lcul
atio
ns to
clie
nts
(thin
/thic
k cl
ient
pro
blem
) .
can
be u
sed
for m
igra
tion
of o
bjec
ts, O
RB
s an
d ag
ents
■
Sin
ce 1
999
dire
ct C
orba
sup
port
in J
DK
1.2
.
IDL2
Java
map
ping
, ID
L co
mpi
ler,
Java
2ID
L co
mpi
ler,
nam
e se
rvic
e, O
RB
■
Cor
ba s
uppo
rts fo
r Jav
a a
dist
ribut
ed in
tero
pera
ble
infra
stru
ctur
e
►
Java
imita
tes
func
tiona
lity
of C
orba
■
Bas
ic s
ervi
ces:
Rem
ote
Met
hod
Invo
catio
n R
MI,
Java
Nat
ive
code
Inte
rface
JN
I ■
Ser
vice
s: s
eria
lizat
ion,
eve
nts
■ A
pplic
atio
n sp
ecifi
c se
rvic
es (f
acili
ties)
: ref
lect
ion,
pro
perti
es o
f Jav
aBea
ns
Pro
f. U
. Aßm
ann,
CB
SE
74
Cor
ba a
nd th
e W
eb (O
rble
ts)
►
OR
Bs
can
be w
ritte
n as
byt
ecod
e ap
plet
s if
they
are
writ
ten
in J
ava
(OR
Ble
t) ►
Cou
plin
g of
HTT
P a
nd II
OP
: Dow
nloa
d of
an
OR
Ble
ts w
ith H
TTP
: Ta
lk to
thi
s O
RB
, to
get c
onta
ct to
ser
ver
►
Sta
ndar
d w
eb s
ervi
ces
(see
late
r) a
re s
low
er th
an C
OR
BA
/OR
Ble
ts,
beca
use
they
incu
r int
erpr
etat
ion
over
head
OR
B
Htt
p s
erv
er
OR
B S
erv
er
We
b-C
lien
t W
eb
se
rve
r 1
) Fe
tch
pa
ge
2)
fetc
h O
RB
let
Bu
sin
ess
ob
jec
ts
3)
co
mm
un
icat
e w
ith
IIO
P
dat
a b
ase
s
Lo
tus
No
tes
Pro
f. U
. Aßm
ann,
CB
SE
75
Wha
t Hav
e W
e Le
arne
d
►
CO
RB
A is
big
, but
uni
vers
al:
■ Th
e C
orba
-inte
rface
s ar
e ve
ry fl
exib
le, w
ork
and
can
be u
sed
in p
ract
ice
■ ..
but a
lso
com
plex
and
fat,
may
be
too
flexi
ble
■ If
you
have
to c
onne
ct to
lega
cy s
yste
ms,
CO
RB
A w
orks
►
Cor
ba h
as th
e ad
vant
age
of a
n op
en s
tand
ard
►
To in
crea
se re
use
and
inte
rope
rabi
lity
in p
ract
ice,
one
has
to le
arn
man
y st
anda
rds
►
Trad
ing
and
dyna
mic
cal
l are
futu
re a
dvan
ced
com
mun
icat
ion
mec
hani
sms
►
CO
RB
A w
as p
roba
bly
only
the
first
ste
p, b
ut w
eb s
ervi
ces
mig
ht b
e ta
king
ove
r
Pro
f. U
. Aßm
ann,
CB
SE
76
The
End
Top Related