J. To es Æ J. A. O ega Æ M. To o
In e ac ions among dynamic se s o objec s
Abs ac In his pape , we p esen an ope a o o model
in e ac ions among objec s. Ou p oposal allows a
a iable numbe o pa icipan objec s in an in e ac ion,
and his numbe will be fixed du ing he execu ion o he
model. This p o ides a e y flexible in e ac ion model
based on synch onous in e ac ions among se e al
objec s. Ou in e ac ion model is based on e en s and
allows a mul iple-way communica ion among objec s.
Conc e e alues o a communica ion a e gene a ed
h ough cons ain s which a e imposed locally on each
pa icipan objec . The p oposed in e ac ion (and com-
munica ion) model is e y e sa ile and can be used as
an abs ac specifica ion mechanism.
Keywo ds Communica ion ÆE en ÆIn e ac ion
cons ain s ÆObjec o ien a ion ÆSpecifica ion Æ
Synch onisa ion
1 In oduc ion
Objec o ien a ion is based on he defini ion o a sys em
by means o en i ies (objec s) ela ed among hemsel es.
The p ope ies o a sys em a e exp essed h ough
mechanisms like classifica ion (which g oups objec s
in o classes), associa ion, gene alisa ion, specialisa ion
and agg ega ion. These mechanisms cap u e s a ic e-
la ionships among objec s, bu hey do no cap u e
dynamic ela ionships among hem. This ype o ea u e
is exp essed by means o in e ac ions ha desc ibe he
way in which se e al objec s can collabo a e in a
common ac ion.
In objec -o ien ed p og amming languages, hese
collabo a ions a e ca ied ou by means o me hods. In
objec -o ien ed specifica ion languages, a mo e abs ac
concep is used: he e en . An e en desc ibes an
impo an momen o he sys em ha cha ac e ises wo
s a es: he p e ious s a e o he e en and he s a e a e
he e en . Besides causing s a e changes, e en s a e also
good a coo dina ing objec s. This happens when wo o
mo e objec s coincide in he same e en .
The s udy o e en s has i s o igin in p ocess specifi-
ca ion languages [1–3], bu hei ideas a e pe ec ly
applicable o objec -o ien ed models. Objec -o ien ed
specifica ion languages usually use heclien /se e
model o speci y he in e ac ions among objec s.
In his pape , an al e na i e o he specifica ion o
in e ac ions among objec s is p esen ed. Ou p oposal
is based on an n-way communica ion mechanism. This
app oach appea s in he li e a u e in diffe en o ms:
endez ous mul iple-way in SR [4], n-a y endez ous in
LOTOS [3], ela ionships in TROLL [5, 6] andmul i-
pa y synch onous in e ac ions in IP [7], among o he s.
Ne e heless, all hese p oposals con empla e a fixed
numbe o objec s (p ocesses) in he in e ac ion. Ou
p oposal allows a a iable numbe o pa icipan objec s
in an in e ac ion and his numbe will be fixed du ing he
execu ion o he model. This p o ides a e y flexible
in e ac ion model, wi h synch onous in e ac ions among
se e al objec s.
The pape is o ganised as ollows. In Sec ion 2, he
main ideas o he in e ac ion among objec s and some
ypical in e ac ion ope a o s used o exp ess he con-
cu en beha iou o a sys em a e discussed. Sec ion 3
explains how communica ion ea u es associa ing con-
s ain s o e en s can be desc ibed. Sec ion 4 p esen s a
comple e applica ion example o ou in e ac ion model.
Finally, in Sec ion 5 he conclusions o his wo k a e
p esen ed.
2 In e ac ions
A sys em can be seen as a se o objec s in e ac ing wi h
one ano he concu en ly. When he sys em is ela i ely
J. To es (&)ÆJ. A. O ega ÆM. To o
Depa men o Languages and Compu e Sys ems,
Se ille Uni e si y, A da Reina Me cedes,
S/N Se illa CP 41012, Spain.
E-mail: [email p o ec ed]
complex, he objec app oach is e y use ul because i
allows mechanisms such as inhe i ance, associa ion and
agg ega ion (pe mi ing a sys em o be defined a se e al
le els o abs ac ion).
Each objec has a local s a e, on which local con-
s ain s can be imposed. In specifica ion languages, he
in e ac ion among objec s is usually based on e en s.
E en s also allow communica ing pa ame e s among he
diffe en objec s implied.
An example is he dining philosophe s’ p oblem,
which is a ypical p oblem in concu en p og amming
[4]. To speci y his p oblem, he classes Philosophe and
Fo k will be defined. The objec s o he Philosophe
class will ha e a cyclical beha iou which consis s on
hinking and ea ing. Each philosophe has o ca ch he
o ks placed on his le and on his igh o ea . The
e en s a e akeFo k and eleaseFo k. These names
al eady gi e an idea o he in en ion o each one. The
co esponding class diag am (in UML no a ion [8, 9]) is
shown in Fig. 1.
An impo an ac o is he numbe o objec s which
pa icipa e in a communica ion. The communica ion is
usually 1:1, ollowing he clien -se e app oach, wi h
one-way pa ame e ans e . A mo e in e es ing ap-
p oach is wo-way (n-way in gene al) communica ion
among objec s.
In o de o model a sys em, a synch onous model is
p e e ed o an asynch onous one because he execu-
ion o a synch onous communica ion e en im-
media ely p o ides he pa icipa ing objec s wi h he
in o ma ion ha communica ion has aken place
[10, 11]. This acili a es he specifica ion o he de ec-
ion o deadlocks. Mo eo e , communica ion among
se e al objec s is easie in a synch onous model, while
an asynch onous model is mo e ocused on one- o-one
communica ions [2, 3]. I he modifica ion o he objec
s a e is ca ied ou in an a omic way when i pa ici-
pa es in an e en , hen synch onous in e ac ions can
also be used o model ansac ions. Thus, each objec
in ol ed in an in e ac ion changes i s s a e in an a omic
way. This is conside ed as a change o he sys em s a e
in an a omic way.
The e a e many ope a o s o exp essing he con-
cu en beha iou o a sys em. The mos popula ones
ha e been defined adi ionally o p ocess algeb a [1–3].
LOTOS, o example, which is a language qui e ich in
his sense, has h ee ope a o s o exp ess he pa allelism
o p ocesses: pu e in e lea ed, ull synch onisa ion and
explici synch onisa ion.
I A and B a e wo p ocesses, pu e in e lea ed A
||| B deno es hei independen composi ion. In o he
wo ds, bo h p ocesses do no synch onise in any
e en .
Full synch onisa ion A || B is a new p ocess ha
deno es a pa allel composi ion in which A and B mus
synch onise in all hei e en s. The e o e, we ha e a ull
synch onisa ion a he p ocess le el (A and B ha e o
pa icipa e, as well as hei subp ocesses) and a he
e en le el ( hey ha e o synch onise in all e en s). Since
an en i e subsys em has o e ol e a he same ime, i
some o he pa s canno e ol e his blocks he es o
he subsys em.
Explici synch onisa ion A |[g
1
,...,g
n
]| is a new
p ocess in which A and B mus synch onise in each e en
occu ing h ough he ga es (communica ion channels)
g
1
,...,g
n
. Then, we ha e a comple e synch onisa ion a
he p ocess le el and a pa ial synch onisa ion a he
e en le el ( hey do no ha e o synch onise in all
e en s). This ope a o allows a mo e flexible in e ac ion
among p ocesses han he ope a o ||. Howe e , he
p e ious p oblem con inues o a ise.
These ope a o s desc ibe he in e ac ion o se e al
p ocesses (o classes) h ough a ce ain e en . A single
objec o all hose o he class can only pa icipa e o
each class. Speci ying hese si ua ions wi h he abo e
ope a o s may equi e specifica ions a a lowe le el,
which can be complex and difficul o unde s and. E en
wo se, hese specifica ions can eadily lead o ce ain
p oblems, such as deadlocks.
Fo example, i we sol e he dining philosophe s’
p oblem wi h his kind o in e ac ion, a philosophe
can only ca ch a o k a he same ime. The incon-
enience o his app oach is ha , since a philosophe
fi s has o ca ch a o k (ei he he le o he igh ),
and la e he o he one, a deadlock may ake place
( o example, whe e all philosophe s ca ch a o k).
This is usually sol ed by adding some synch onisa ion
mechanism like semapho es o moni o s [4], o by
adding new p ocesses o coo dina ion, which akes us
o a less clea specifica ion. Fo example, in Man
˜as
[14] a solu ion is p esen ed in LOTOS wi h h ee
p ocesses:
•use s, which ep esen s philosophe s. Each philoso-
phe fi s akes he le o k and la e he igh . Then,
i eleases hem in he same o de . The philosophe s’
beha iou is in e lea ed among hem.
•se ice, which ep esen s o ks. Each o k can be
caugh (ei he om he igh o om he le ) and
la e eleased.
•wa chdog, which moni o s he philosophe s’ beha-
iou , and o bids picking mo e han ou le o ks
simul aneously. The e o e, he e would no be dead-
locks.
The e a e wo disad an ages o his specifica ion: (1) a
new p ocess is added o a oid deadlocks, and (2) phi-
losophe s a e obliged o ake o ks in a ce ain o de
(fi s he le and hen he igh ).
Fig. 1 Class diag am o he philosophe s p oblem
3 Modelling in e ac ions among dynamic se s o objec s
The p oposed in e ac ion ope a o ca ies ou he syn-
ch onisa ion in an indi idual way o e en s. Howe e ,
he key diffe ence om o he app oaches is ha he
numbe o objec s o a class pa icipa ing in an in e -
ac ion is no limi ed. All objec s e i ying hei con-
s ain s pa icipa e in an e en , allowing in e ac ions
among a dynamic se o objec s.
The e a e many si ua ions whe e a dynamic se o
objec s mus in e ac in an a omic way:
•The coach o a eam summons all his uninju ed
playe s.
•A p o esso calls all hose s uden s who ailed.
•A bank cancels all he accoun s o one pa icula
cus ome .
Fo example, an easie specifica ion om he dining
philosophe s’ p oblem can be made. To a oid dead-
locks, he wo o ks ha co espond o a philosophe
a e assigned a he same ime, in he same in e ac ion
[15]. This should be eflec ed in he class diag am in
Fig. 1, changing he ca dinali y o he associa ion
uses om 0..2 o 0,2 (see Fig. 4). The specifica ion
o his p oblem will be s udied in mo e de ail in
Sec ion 4.
The main ad an age o his app oach is ha he e is
no need o add new p ocesses o ensu e he coo dina-
ion. Specifica ions a a highe abs ac ion le el can be
ob ained wi h i .
In ou model, objec s e ol e when hey synch onise
in e en s. In e ac ion cons ain s define he way in which
objec s o se e al classes synch onise in e en s.
Each objec has a local s a e, which can only be
modified o he pa icipa ion in e en s. Communica ion
has o happen synch onously. An e en will occu only i
each objec ha has o pa icipa e in his e en ag ees on
doing i . Fu he mo e, objec s mus each an ag eemen
abou he alues o he pa ame e s ha will commu-
nica e among hemsel es. Fo his, each one o hese
objec s es ablishes hei pa icipa ion cons ain s. This
allows us o model mo e complex in e ac ions han he
adi ional clien /se e app oach.
E en s a e desc ibed in ou model by means o
communica ion channels, which ha e he same names as
he e en s. All objec s o a class sha e he communica-
ion channels defined in his class. A channel is defined
wi h a name and he ypes o pa ame e s communica ed
wi h he e en s. In sho , he defini ion o a channel is
he defini ion o an e en s empla e.
3.1 Views o a channel
F om he poin o iew o in e class communica ion, i
can be said ha channels cons i u e he in e ace o
a class. Conc e e e en s in which objec s o a class
pa icipa e occu h ough channels. When a channel is
defined, i is gi en a name and i s pa ame e s a e en-
ume a ed.
This is he mos in e es ing ision o a channel om
he local poin o iew o classes. When mo e han one
objec mus synch onise in an e en h ough a channel,
no all o hem need o ha e he same ision o his
channel, bu he e en ha occu s will be unique. This
unique e en in which se e al objec s synch onise is
called a global e en . Local iews o e en s in he spe-
cifica ion o a class allow us o igno e he aspec s o
global e en s ha a e no ele an o his class. This ac
makes his class independen om he es o he sys em.
Mo eo e , objec s o a class can see diffe en global
e en s in he same way, and wi h he same effec s unde
he same condi ions. They may hen co espond o a
single local iew.
The s uc u e o a global channel is ex ac ed om he
diffe en iews ha classes ha e o ha e en (local
iews). These local iews o channels may ha e diffe en
names, and e en he numbe o pa ame e s may be
diffe en in each class. All his is unified by means o
in e ac ion cons ain s among classes. Thus, each class
sees wha in e es s hem om a global channel.
The local beha iou o objec s o he class cli will be
desc ibed wi h he no a ion {p e
i
}cni {pos
i
}. This in-
dica es ha objec s o he class which e i y he condi-
ion p e
i
, e alua ed on hei cu en s a e, will pa icipa e
in he e en cn
i
. I he e en occu s, he s a e o pa i-
cipan objec s will become he one desc ibed in pos
i
.
The no a ion ob.a will be used o e e o he a ibu e a
o an objec wi h iden ifica ion ob. The no a ion ob.exp
will also be used o deno e he exp ession exp e alua ed
on he s a e o he objec ob. The alue o an a ibu e
a e he occu ence o an e en is ep esen ed by adding
a quo a ion ma k (’) o a ibu es.
Fo example, in a sys em o au oma ic banking he e
a e a lo o in e ac ions, such as opening an accoun ,
deposi ing money and wi hd awing money. As he
p oblem is qui e ex ensi e, only he close accoun e en
will be s udied.
The simplified class diag am wi h h ee classes is
shown in Fig. 2. Cus ome class ep esen s clien s o
some bank. I has wo associa ions o indica e ha a
clien can ha e mul iple accoun s and se e al ca ds.
Accoun class ep esen s clien s’ accoun s. An accoun
can ha e se e al owne s and can be accessible by di -
e en ca ds. This class has an a ibu e o deno e he
Fig. 2 Pa ial class diag am o he banking p oblem
balance. Ca d class ep esen s clien s’ c edi ca ds. Each
c edi ca d is pe sonal. I can only belong o one clien
and i is associa ed wi h one accoun .
The associa ion oles a e no shown in Fig. 2. Like
ole names o an associa ion, he class names ha a e in
he co esponding end o ha associa ion ( o ins ance,
he se o associa ed c edi ca ds o an accoun a is
deno ed by he ole a.ca d) will be used.
The beha iou o he classes Cus ome , Accoun and
Ca d o he close accoun e en is desc ibed by he
ollowing ules:
1. {a [c.accoun }
Cus ome (c).closeAccoun (a)
{a [
/c.accoun ’}
2. {a.balance = 0}
Accoun (a).close
3. {c d.accoun = a}
Ca d(c d).in alida e(a)
The fi s ule means ha a cus ome can close an ac-
coun i he accoun is his. A e closing an accoun , i is
no ound among he cus ome ’s accoun s. The second
ule allows closing an accoun i i s balance is 0. Finally,
he hi d ule specifies ha a c edi ca d is in alida ed
( he objec is des oyed) when he accoun passed by
pa ame e s coincides wi h he associa ed accoun .
3.2 Speci ying in e ac ion cons ain s
In e ac ion cons ain s a e specified as ollows:
In e ac ion cons ain s
cng(pa ): cl
1
(id
1
).cn
1
(pa
1
)[ ng
1
]=...=
cl
n
(id
n
).cn
n
(pa
n
)[ ng
n
];
...
end;
whe e
•cl
i
is he name o he classes whose objec s a e going
o pa icipa e in he in e ac ion;
•id
i
is he iden ifica ion o he objec o he class cl
i
ha
mus pa icipa e in he e en . I is only defined when
a single objec o cl
i
is going o pa icipa e and i s
iden ifica ion is known. In ano he case, i he e en
occu s, all objec s ulfilling hei cons ain s will
pa icipa e;
•cn
i
is he name o he local channel in he class cl
i
, and
pa
i
i s pa ame e s (one a iable o each pa ame e );
• ng
i
indica es he ca dinali y o numbe o objec s o
he class cl
i
ha mus pa icipa e h ough he channel
cn
i
. The ange no a ion min..max will be used, whe e
min indica es he minimum numbe o objec s and
max indica es he maximum numbe o objec s which
mus pa icipa e in he in e ac ion. To indica e ha
he e is no a maximum limi , max will be an as e isk
(*). The no a ion num will also be used o indica e he
exac numbe o objec s. When ng
i
is no defined, i
deno es he implici ange 1..*;
•cng is he name o he global channel whose pa a-
me e s a e pa . These pa ame e s a e ob ained om
he local iews.
The g aphical no a ion o an in e ac ion among objec s
o wo classes is shown in Fig. 3. In e ac ions among
mo e classes a e ob ained by gene alising his case.
An e en can only occu i each class pa icipa ing in
he in e ac ion has he minimum numbe o objec s
indica ed in he co esponding ange. In he o he case,
he e en will no be able o happen.
Fo example, he specifica ion o in e ac ion con-
s ain s o close an accoun is as ollows:
In e ac ion cons ain s
close(c,a): Cus ome (c).closeAccoun (a) =
Accoun (a).close = Ca d.in alida e(a);
...
end;
This in e ac ion specifies ha a cus ome , he accoun
indica ed by he cus ome and all associa ed c edi ca ds
o he accoun should in e ac .
3.3 Examples o in e ac ions
Le us conside wo in e ac ing classes cl
1
and cl
2
h ough he local channels cn
1
and cn
2
. Le us conside
he pa ame e s pa
1
and pa
2
o hose channels. Some
kinds o basic in e ac ions ha can be specified a e as
ollows:
•An objec o cl
1
in e ac s wi h an objec o cl
2
.Bo h
objec s ulfil hei cons ain s and hey ag ee also in
he alues o he pa ame e s pa
1
pa
2
. The e a e
wo possibili ies o speci y his:
– Pa icipa ing objec s o each class can be anyone
ulfilling hei local cons ain s and hey may be
known by he o he s pa icipa ing. This case is
specified as ollows:
cn(pa ): cl
1
(id
1
).cn
1
(pa
1
)=cl
2
(id
2
).cn
2
(pa
2
);
– Pa icipa ing objec s o each class can be anyone
ulfilling hei local cons ain s and hey a e un-
known by he o he s pa icipa ing. This case is
specified as ollows:
cn(pa ): cl
1
.cn
1
(pa
1
)[1] = cl
2
.cn
2
(pa
2
)[1];
•All objec s o cl
1
ulfilling hei cons ain s in e ac
wi h all objec s o cl
2
ha also ulfil hei cons ain s.
This case is specified as ollows:
cn(pa ): cl
1
.cn
1
(pa
1
)=cl
2
.cn
2
(pa
2
);
Fig. 3 G aphical ep esen a ion o an in e ac ion be ween wo classes
He e, all objec s o cl
1
mus ha e he same alues o
he pa ame e s pa
1
. All objec s o cl
2
mus also ha e
he same alues o pa
2
. Fu he mo e, all objec s mus
ag ee on he alues o he pa ame e s pa
1
pa
2
.
•A numbe o objec s o cl
1
ulfilling hei cons ain s
in e ac wi h all objec s o cl
2
ulfilling hei con-
s ain s. This case is specified as ollows:
cn(pa ): cl
1
(id
1
).cn
1
(pa
1
)[ ng
1
]=
cl
2
(id
2
).cn
2
(pa
2
);
I o cl
1
he e a e mo e eady objec s o pa icipa e
han he ones defined in ng
1
, hen he maximum
numbe possible o hem will be a bi a ily chosen.
•Some objec s o a class in e ac wi h o he objec s o
he same class. Fo example, le us conside wo
channels cn
a
ycn
b
o he class cl. The ollowing
in e ac ion es ablishes he communica ion be ween
wo objec s o cl h ough bo h channels:
cn(pa ): cl(id
a
).cn
a
(pa
a
) = cl(id
b
).cn
b
(pa
b
);
He e, we a e implici ly defining wo subclasses o
objec s om cl: (1) objec s ulfilling p econdi ions o
cn
a
and (2) objec s ulfilling p econdi ions o cn
b
.
This kind o communica ion is simila o an in e ac-
ion defined be ween wo diffe en classes.
•Any combina ion o p e ious cases. This can be
gene alized by making i so ha he numbe o classes
can o pa icipa e in an in e ac ion.
Fo example, he ollowing in e ac ion:
cn(a, b, c): cl
1
.cn
1
(a, b) = cl
2
.cn
2
(b)[2..4]
=cl
3
(c).cn
3
(a);
deno es ha one objec o he class cl
1
will pa icipa e
wi h as many objec s as possible, one objec o he
class cl
2
mus ha e be ween wo and ou objec s, and
one objec o he class cl
3
a single objec . Fu he mo e,
he global channel cn will ha e h ee pa ame e s:
•a comes om he channels cn
1
and cn
3
.This
pa ame e mus ake he same alue in he objec s
ha pa icipa e in he co esponding classes;
•b comes om he channels cn
1
and cn
2
. The
same hing mus be ulfilled as in he p e ious
case; and
•c comes om he iden ifica ion o an objec o
he class cl
3
.
The flexibili y o ou ope a o is simula ed in some o he
app oaches by means o he use o ansac ions o
g oups o ac ions ha a e all ca ied ou all o none o
which a e ca ied ou . Howe e , ansac ions, s ill being
a qui e po en mechanism, a e clea ly o a lowe le el.
Fo example, i is necessa y o de ail in e media e s a es
composing he ansac ion, o he o de in which i is
necessa y o ca y ou each ac ion. In he p oposed in-
e ac ion ope a o only he diffe en elemen s ha in-
e ene in an in e ac ion a e indica ed, wi hou gi ing
he conc e e de ails o how he ansac ion i sel is
ca ied ou . This belongs o a la e efinemen p ocess,
which will be ob ained s a ing om defined in e ac ions
[16].
3.4 Global beha iou o a sys em
In o de o define he global beha iou o a sys em, i
has o be conside ed wha condi ion mus be e ified so
ha a global e en can occu and wha effec s his will
ha e on he objec s pa icipa ing in his e en .
Le us suppose ha we ha e defined he ollowing
in e ac ion:
cng(pa ): cl
1
.cn
1
(pa
1
)[ ng
1
]=...=cl
n
.cn
n
(pa
n
)[ ng
n
];
whe e he classes cl
i
can pa icipa e wi h he local iews
cn
i
,Vi[{1..n}. We will deno e cl
i
he popula ion o
ex ension o he class cl
i
,andcl
i
.cn
i
he objec s o he
class cl
i
ha pa icipa e in an in e ac ion h ough he
channel cn
i
. This se is composed by all objec s e i ying
hei p econdi ions:
Vob [cli .ob.p ei )ob [cl
i
.cn
i
I he size o cl
i
.cn
i
is g ea e han he numbe o objec s
allowed o pa icipa e, hen he maximum numbe pos-
sible o objec s will be (a bi a ily) chosen.
The global beha iou o he sys em wi h ega d o
e en cng is he ollowing:
{p e}cng {pos }
whe e
p e
:
^
(i[{1..n})
((Vob [cl
i
.cn
i
.ob.p e
i
)^
(#cl
i
.cn
i
}[{ ng
i
}))
pos
:
^
(i[{1..n})
(Vob [cl
i
.cn
i
.ob.pos
i
)
The e o e, o allow he occu ence o a global e en , i
mus be ulfilled ha each objec pa icipa ing e ifies i s
cons ain s o each local iew. I mus also ha e he
numbe o objec s equi ed o pa icipa e. On he o he
hand, i he e en occu s, all pa icipan objec s in his
e en will modi y hei s a e (in a omic way) acco ding
o he local defini ion o he co esponding class.
Fo example, le us conside he au oma ic banking
sys em shown p e iously in Sec ion 3.1 wi h he ol-
lowing h ee ules
1. {a [c.accoun }
Cus ome (c).closeAccoun (a)
{a [
/c.accoun ’}
2. {a.balance = 0}
Accoun (a).close
3. {c d.accoun = a}
Ca d(c d).in alida e(a)
and he ollowing in e ac ion o close an accoun :
close(c,a): Cus ome (c).closeAccoun (a) =
Accoun (a).close = Ca d.in alida e(a);
The global e en close(c, a) will be defined as:
{(a [c.accoun ) ^(a.balance = 0) ^
(Vc d [Ca d.in alida e(a)} .c d.accoun = a )}
close(c, a)
{a [
/c.accoun ’}
i.e., i mus be ulfilled ha he accoun a belongs o he
cus ome c, ha his accoun has a balance equal o ze o
and ha all ca ds associa ed wi h his accoun will be
cancelled.
The e en s ha can occu in each ins an will be
ob ained. A global e en can occu in each ins an . I
he e is mo e han one e en enabled, he elec ion will be
non-de e minis ic. I no e en can occu , hen he sys em
is blocked (in he case o non- e mina ing sys ems).
4 Example: he dining philosophe s’ p oblem
The dining philosophe s’ p oblem will be specified using
ou in e ac ion ope a o , al eady desc ibed in Sec ion 2.
The defini i e class diag am is shown in Fig. 4.
Since he numbe o philosophe s is i ele an , i can
be supposed ha he e a e numPhil philosophe s (and,
he e o e, he same o ks), being numPhil 52. Also
a ibu es a e needed o deno e he cu en s a es o
philosophe s and o ks. Le s p be he a ibu e o he
philosophe s. I will be able o ake he alues { hinking,
ea ing}. Le s be he a ibu e o he o ks. I will be
able o ake he alues { ee, busy}.
Local e en s a e akeFo ks and eleaseFo ks o he
philosophe s, and isTaken and isReleased o he o ks.
The beha iou o he classes Philosophe and Fo k is
desc ibed by he ollowing ules:
1. {p.s p= hinking}
Philosophe (p). akeFo ks
{p.s p’=ea ing}
2. {(p.s p=ea ing)}
Philosophe (p). eleaseFo ks
{p.s p’= hinking}
3. {( =p. o kLe _ =p. o kRigh ) ^ .s = ee}
Fo k( ).isTaken(p)
{ .s ’=busy}
4. {( =p. o kLe _ =p. o kRigh ) ^ .s =busy}
Fo k( ).isReleased(p)
{ .s ’= ee}
The fi s ule es ablishes ha a philosophe mus be
hinking o ake his o ks. I he e en occu s, he phi-
losophe will pass o ea . The second ule defines ha a
philosophe p mus be ea ing in o de o elease his
o ks. I his e en occu s, he philosophe will pass o be
hinking. The hi d ule indica es when a philosophe
can ca ch he o k . This o k mus be ee and also
mus be a o k ha is on he le o on he igh o a
philosophe whose iden ifica ion is passed as a pa a-
me e . I he e en occu s, he o k will pass o be busy.
Simila ly, he ou h ule es ablishes ha a o k mus
be busy in o de o be eleased. When his e en occu s,
he o k will pass o be ee.
Two in e ac ions among objec s o he wo classes a e
needed:
1. When a philosophe akes a o k, i mus disappea
om he able (so ha ano he philosophe canno
ake i ). Also, o a oid p oblems o deadlocks, a
philosophe mus ake he wo o ks ha he needs a
he same ime.
2. When a philosophe eleases a o k, i mus be
a ailable on he able again. The philosophe mus
elease he wo o ks ha he has a he same ime.
The g aphical ep esen a ion o hese in e ac ions is
shown in Fig. 5. The specifica ion o he in e ac ion
cons ain s is as ollows:
In e ac ion cons ain s
ake(p): Philosophe (p). akeFo ks=
Fo k.isTaken(p)[2];
elease(p): Philosophe (p). eleaseFo ks=
Fo k.isReleased(p)[2];
end;
As can be seen, each global channel has a pa ame e . I
indica es he philosophe ha wan s o ake o o elease
his o ks.
Acco ding o defined in e ac ion cons ain s and lo-
cal cons ain s imposed on each class (and ollowing he
defini ions made in Sec ion 3.4), he global beha iou o
he sys em is defined as ollows:
{p e
} ake(p) {pos
}
{p e
} elease(p) {pos
}
whe e
p e
:(p.s p= hinking) ^(V [Fo k.isTaken .
( =p. o kLe _ =p. o kRigh ) ^
( .s p= ee)) ^(#Fo k.isTaken = 2)
pos
:(p.s p’=ea ing) ^
(V [Fo k.isTaken . .s ’=busy)
p e
:(p.s p=ea ing) ^(V [Fo k.isReleased .
( =p. o kLe _ =p. o kRigh ) ^
( .s p=busy)) ^(#Fo k.isReleased = 2)
Fig. 4 Defini i e class diag am o he philosophe s p oblem
Fig. 5 In e ac ion cons ain s be ween he classes Philosophe and
Fo k
pos :(p.s p’= hinking) ^
(V [Fo k.isReleased . .s ’= ee)
He e, p econdi ion p e
indica es ha he e en ake
could happen i he philosophe p is hinking and he has
wo ee o ks in his hands, he o ks a his le and a his
igh . Pos condi ion pos
indica es ha i he e en ake
occu s, hen he philosophe p will be ea ing and he
o ks ha he has in his hand will be busy. P econdi ion
p e
indica es ha he e en elease could occu i he
philosophe p is ea ing and he has wo busy o ks in his
hands, he o ks a his le and his igh . Pos condi ion
pos
indica es ha i he e en elease occu s, hen he
philosophe p will be hinking and he o ks ha he has
in his hand will be ee.
5 Conclusions and u u e wo k
A flexible model o in e ac ion among objec s in which
mul iple classes o objec s a e allowed o in e ac
h ough a same e en has been p esen ed in his pape .
E en s a e uni s o synch onisa ion and (n-way) com-
munica ion among objec s.
A specifica ion in ou model is made defining con-
s ain s locally imposed on objec s. The global ision o
a sys em is ob ained, defining he exis en in e ac ion
cons ain s among objec s. Fo each class, all objec s
sa is ying hei cons ain s will be able o pa icipa e in
an in e ac ion.
The imposi ion o global cons ain s on a sys em o
on a pa o i (subsys em) may be ca ied ou by means
o objec s keeping hese cons ain s locally. Fu he -
mo e, hese objec s mus in e ac in a synch onous way
wi h he es o he sys em.
This pape con ains wo illus a i e examples: he
dining philosophe s’ and he au oma ed banking p o-
blems. We ha e made a specifica ion o he sys ems by
means o ules ha define he possible ansi ions o
s a e o he objec s composing hese sys ems. To gi e a
global ision o each sys em, in e ac ion cons ain s
ha e been defined. Finally, we ha e desc ibed he con-
di ions ha ha e o be ulfilled in o de ha an e en o
he sys em can occu .
Ou in e ac ion mechanism has been implemen ed in
wo diffe en ways: fi s ly using he LOTOS language
[15] and secondly making an ex ension o he IP lan-
guage [7]. This ex ension allows a dynamic numbe o
p ocesses [17]. Ou u u e wo k is ocused on ob aining
implemen a ions in an au oma ic way by means o me-
chanisms o a lowe le el, as communica ion clien /se -
e and ansac ions, which in a anspa en way assu e
he same p ope ies as he o iginal specifica ion. We also
plan o de elop a me hodology ha allows us o
use in e ac ion cons ain s in a p ocess o so wa e
de elopmen .
Re e ences
1. Hoa e CAR (1985) Communica ing sequen ial p ocesses. P e-
n ice-Hall In e na ional Se ies in Compu e Science, Engle-
wood Cliffs, NJ
2. Milne R (1989) Communica ion and concu ency. P en ice-
Hall In e na ional Se ies in Compu e Science, Englewood
Cliffs, NJ
3. ISO (1989) In o ma ion p ocessing sys ems: open sys ems
in e connec ion. LOTOS: a o mal desc ip ion echnique
based on he empo al o de ing o obse a ional beha iou .
ISO 8807
4. And ews GR (1991) Concu en p og amming: p inciples and
p ac ice. Benjamin/Cummings, Redwood Ci y, CA
5. Jungclaus R, Ha mann T, Saake G (1993) Rela ionships be-
ween dynamic objec s. In: In o ma ion modelling knowledge
bases IV: concep s, me hods and sys ems. IOS P ess, Am-
s e dam pp 425–438
6. Jungclaus R, Saake G, Ha mann T, Se nadas C (1996)
TROLL – A language o objec -o ien ed specifica ion o in-
o ma ion sys em. ACM T ansac ions on In o ma ion Sys ems,
14(2): 175–211
7. F ancez N, Fo man IR (1996) In e ac ing p ocesses: a mul i-
pa y app oach o coo dina ed dis ibu ed p og amming.
Addison-Wesley, Reading, MA
8. Booch G, Jacobson I, Rumbaugh J (1999) The Unified Mod-
eling Language use guide. Addison-Wesley, Reading, MA
9. Rumbaugh J, Booch G, Jacobson I (1999) The Unified Mod-
eling Language e e ence manual. Addison-Wesley, Reading,
MA
10. Jonke s hbm (1999) Communica ion and synch onisa ion using
in e ac ion objec s. Lec u e No es in Compu e Science, Vol
1709, pp 1321–1331
11. Manna Z, Pnueli A (1992) The empo al logic o eac i e and
concu en sys ems: specifica ion. Sp inge , Be lin
12. Denke G, Ko
¨s e -Filipe J (1996) Towa ds a model o asyn-
ch onously communica ing objec s. In: P oceedings o he
second in e na ional Bal ic wo kshop on da abases and
in o ma ion sys ems, Tallinn, p 182–193
13. Eugs e A, Gue aoui R, S en ek J (2000) Dis ibu ed asyn-
ch onous collec ions: abs ac ions o publish/subsc ibe in e -
ac ion. Lec u e No es in Compu e Science, Vol 1850, pp 252–
270
14. Man
˜as JA (1989) Dining philosophe s: a cons ain o ien ed-
specifica ion. In: The o mal desc ip ion echniques LOTOS.
Else ie Science, Ams e dam
15. To es J Objec o ien ed specifica ions based on cons ain s.
PhD hesis, Depa men o Languages and Compu e Sys ems,
Uni e si y o Se ille, Decembe 1997
16. Sounda ajan N (2001) Refining in e ac ions in a dis ibu ed
sys em. Lec u e No es in Compu e Science, Vol 1871, pp 209–
220
17. Co chuelo R P o o yping dis ibu ed sys ems specifica ions
based on cons ain s. PhD hesis, Depa men o Languages
and Compu e Sys ems, Uni e si y o Se ille, Decembe 1999