TELKOM
NIKA Indonesia
n
Journal of
Electrical En
gineering
Vol.12, No.6, Jun
e
201
4, pp. 4521 ~ 4
5
2
7
DOI: 10.115
9
1
/telkomni
ka.
v
12i6.539
1
4521
Re
cei
v
ed
De
cem
ber 2
6
, 2013; Re
vi
sed
Febr
uary 23,
2014; Accept
ed March 9, 2
014
Object-Oriented Publish/Subscribe System
Biao Do
ng
Nanj
in
g Institute of Industr
y
T
e
chn
o
lo
g
y
No.1, Yangs
ha
n North Ro
ad, Qixi
a District, Nanj
in
g 21
002
3, Chin
a
e-mail: d
ong
b
@
niit.e
du.cn
A
b
st
r
a
ct
Existing
metho
dol
ogi
es b
a
se
d
on th
e r
equ
est/res
pons
e
mo
d
e
l for syste
m
s
o
ftw
are desi
gn,
roote
d
in
princ
i
pl
es of
obj
ect-orie
nted
des
ign,
le
ad to
tightly
-c
oup
le
d
inter
a
ctions,
a
nd
lack c
oor
din
a
tion
cap
a
citi
e
s
.
T
he pu
bl
ish/s
ubscri
be (P/S
) para
d
ig
m i
s
particu
larly
suitab
le for
loos
ely-co
up
l
ed co
mmunic
a
tio
n
envir
on
me
nt. A desi
g
n
of e
v
ent a
nd s
ubs
criptio
n
mo
del
s und
er
an
o
b
ject- or
ie
nted
envir
on
ment
w
a
s
motiv
a
ted by t
he id
ea of usi
ng P/S para
d
i
g
m for a
n
ob
j
e
ct-orie
n
ted e
n
viro
nment. T
he P/S servic
e is
comprised of two subsystem
-
c
ompile
r and executor. In each subsystem
, its form
, wor
k
ing pr
ocess, and
typical a
l
g
o
rith
ms ar
e an
aly
s
ed fro
m
the
poi
nt of
obj
e
c
t-oriente
d
an
d techn
o
lo
gy
of P/S parad
i
g
m
separ
ately. Ex
peri
m
e
n
t w
a
s simul
a
ted
in
the fol
l
ow
in
g
tw
o aspects: user
’
s
mod
e
l
and
mid
d
le
cod
e
generation, and show
s t
hat using the P/S serv
ice i
m
prov
es
the usab
ility of
P/S system
s.
Ke
y
w
ords
: object-oriented, p
ublis
h/subscr
ibe, compiler
subsystem
, exec
utor subsystem
Copy
right
©
2014 In
stitu
t
e o
f
Ad
van
ced
En
g
i
n
eerin
g and
Scien
ce. All
rig
h
t
s reser
ve
d
.
1. Introduc
tion
In the distri
b
u
ted environ
ment
of ente
r
pri
s
e inte
rn
a
l
netwo
rk
scale, the mid
d
leware
based on re
mote
p
r
o
c
ed
u
r
e call (RPC) is su
ccessful
[1], howeve
r
,
in the i
n
tern
et enviro
n
me
nt, it
has the follo
wing pro
b
lem
s
:
(1)
Comm
un
ication m
o
d
e
l. The RP
C-b
a
sed mi
ddle
w
are do
es not
sup
port the
partici
pant
s i
n
the
comm
unication
s co
mpletely de
couplin
g in
space, time a
nd control flow.
Mean
while, t
he commu
nication mo
del i
n
volved in
cli
ent se
rver i
n
tera
ction, i
s
o
ne to on
e mo
del,
isn't many to many model.
(2)
Rea
c
tivity to input,
exceptio
ns a
nd
internal/e
xternal chan
ges. Th
e RPC-b
a
sed
middle
w
a
r
e suppo
rts only
a predefin
e
d
seri
al and
linear p
r
o
c
e
s
sing p
a
th, does n
o
t sup
port
dynamic (non
linear, fe
edb
a
c
k proces
sin
g
)
, concurrent
pro
c
e
ssi
ng
p
a
th. At the
sa
me time, it o
n
l
y
reflect
s
the cl
ose
d
enviro
n
m
ent, lack of
ability to resp
ond to extern
al environ
me
nt.
As the appli
c
ation enviro
n
m
ent of the local,
clo
s
ed a
n
d
static state
to Internet, open and
dynamic, lo
osely-co
uple
d
and a
s
ynchrono
us
im
plementatio
n
capa
city in commu
nica
tion
para
d
igm i
s
a
n
inevitable trend [2]. The publi
s
h/sub
s
cribe pa
ra
dig
m
whi
c
h offers asyn
ch
ro
no
us,
multipoint co
mmuni
cation,
and su
ppo
rt the partici
pants of the
commu
nication co
mplete
ly
decouplin
g in time, space and co
ntro
l flow, c
an well meet th
e large
-
scal
e
, highly dynamic
Internet environment [3, 4].
In an obje
c
t-o
r
iented e
n
viro
nment[5], wa
ys to realize P/S service h
a
s thre
e kin
d
s
:
(1) Exp
a
n
s
io
n metho
d
. Progra
mme
rs
d
e
termin
e whe
r
e n
eed
s P/S se
rvice, a
nd
add the
approp
riate
monitori
ng an
d operation code he
re.
(2) Reco
nst
r
uction
metho
d
. Throug
h the recon
s
tru
c
tion
of the
origin
al p
r
og
ramming
langu
age, progra
mming l
angu
age
wa
s transfo
rme
d
into a kind
of prog
rammi
ng lang
uag
e that
sup
port
s
P/S servi
c
e.
(3) Red
e
si
gn of
P/S-based prog
ram
m
ing
langua
ge
s.
The first way
is the mo
st
simple, but the
syst
e
m
's
P/S s
e
r
v
ic
es
ar
e
re
la
tive
ly s
i
mple
a
nd
limited; the seco
nd ap
pro
a
ch i
s
a com
p
romi
se, P/
S servi
c
e fun
c
tion is limited
by the sou
r
ce
langu
age; the
third way is a compl
e
te solution, but due to the complexity of compile
r itself, the
worklo
ad for
addin
g
P/S service
will be
very heavy.
This
p
ape
r prop
oses a P/S
service model
in
an
obje
c
t-o
r
ient
ed environm
ent. P/S
servi
c
e im
ple
m
entation
ap
proa
ch
was
selecte
d
with
a simil
a
r m
e
thod to th
at o
f
the third
wa
y.
Evaluation Warning : The document was created with Spire.PDF for Python.
ISSN: 23
02-4
046
TELKOM
NI
KA
Vol. 12, No. 6, June 20
14: 4521 – 4
527
4522
We d
on’t de
sign a n
e
w o
b
j
e
ct-o
rie
n
ted
environ
ment
t
hat su
ppo
rt P/S serv
ice, b
u
t integrate P
/
S
servi
c
e into a
kno
w
n lan
g
u
age mod
e
l. This pa
per a
d
d
r
esse
s two i
s
sue
s
:
(1) Th
e esta
blishm
ent of event model
and
sub
s
cri
p
tion model i
n
an obje
c
t-oriente
d
environ
ment.
(2) T
he de
sig
n
and impl
e
m
entation of
compil
er a
n
d
executo
r
su
bsyste
m for
an obje
c
t-
oriente
d
environment that
suppo
rt P/S service.
2. Ev
ent Model and Sub
scription Mo
del
In an object
-
ori
ented en
vironme
n
t, communi
catio
n
s between
different ob
jects a
r
e
carrie
d out b
y
the event delivery. Wh
en an
obj
e
c
t
re
ceives an
event, a m
e
thod i
s
call
ed,
therefo
r
e, the
metho
d
call
s ca
n b
e
treat
ed a
s
ev
ents. P/S system'
s
eve
n
ts are
con
s
id
ere
d
a
s
value events,
a value even
t can be map
ped to one o
r
several m
e
th
od events.
Definition 1 method even
t.
Method
ev
ent
in
a
n
obj
ect-o
r
ie
nted
environ
ment i
s
defin
ed
as
follows
:
Cre
a
te Event <Event>
<EventCla
u
se>
<Event Clau
se>=[Before|A
fter] <Nam
e.Method
Nam
e
>
The Event i
s
a
st
ring
u
n
iquely i
denti
f
ying event,
the Before a
nd After
eve
n
ts a
r
e
prod
uced bef
ore a
nd after method exe
c
ution, t
he
Name is a
cla
ss o
r
obj
ect
name, an
d the
Method
Nam
e
is a method
name.
In
an obje
c
t-oriente
d
syst
em,
metho
d
event
s
are di
vided into
p
r
e-exe
c
ution
a
nd p
o
st
-
executio
n me
thod events,
and in
clude t
w
o ki
nd
s
of method even
ts: class met
hod event
s and
gene
ral meth
od
eve
n
ts. Class
meth
od events are
g
enerated bef
ore and
after
invoki
ng cla
s
s
method
s, su
ch as creating
an instan
ce,
deleti
ng an instan
ce. Similarly, general
method eve
n
ts
are ge
ne
rate
d before a
nd
after executin
g obje
c
t methods.
Definition 2
subscri
p
tion. Subscri
p
tion
i
n
an o
b
je
ct-o
riented
environment i
s
d
e
f
ined a
s
follows
:
Cre
a
te Sub <Subscri
p
tion-Name
>
On <Event-Trigger
>
Con
d
ition: <Condition
>
Ac
t: <
A
c
t
ion>
The Sub
s
crip
tion-Name i
s
a strin
g
uniq
u
e
ly
identifying a sub
s
criptio
n
, the Event-Trigg
er
is a li
st of
Method
even
ts, the Condi
tion is
a Bo
olean fu
nctio
n
, and th
e A
c
tion d
enote
s
a
pro
c
ed
ure de
fined by a
n
a
pplication p
r
o
g
ram. A
s
u
s
e
d
in thi
s
d
e
fin
i
tion, the
sub
s
cription
me
a
n
s
as follo
ws:
when a meth
od
event in an e
v
ent-trigg
er o
c
curs, the co
ndition is
eval
uated, and th
en
if the conditio
n
is true, a
c
tions a
r
e exe
c
uted.
3. Compiler Subs
y
s
tem
3.1. Object T
echnology
Figure 1 sh
o
w
s a
compil
er sub
s
ystem
f
o
r obje
c
t ori
e
nted P/S systems.
Figure 1. Co
mpiler
sub
s
ystem
Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM
NIKA
ISSN:
2302-4
046
Obje
ct-O
rient
ed Publish/Subs
cri
be Syst
em
(Biao Don
g
)
4523
The wo
rki
ng pro
c
e
s
s
of co
mpiler
sub
s
ystem
i
s
divided into
two
p
hases: th
e first ph
ase
is initializatio
n, the seco
n
d
will focu
s on com
p
iling.
Now the co
mpiler is
cap
able of handl
ing
obje
c
t.
The compiler
s
u
bs
ys
tem
c
o
mpletes
the following
works in the initiali
zation phase:
firstly,
the compile ti
me cl
ass lib
rary impo
rter l
oad
s cl
as
s li
b
r
ary to
provide su
ppo
rt for
obje
c
t-o
r
iente
d
P/S system
s
on e
s
tabli
s
hi
ng a
ba
si
c
co
mpiler time
cl
as
s lib
ra
ry
;
s
e
co
ndly
,
U
s
e
r
s
impo
rt
cu
st
om
cla
s
s
e
s int
o
t
he co
mpile t
i
me cla
s
s libr
a
ry
by
t
he co
mpile t
i
me cl
as
s libra
ry importer; finally, i
n
the obj
ect
co
mpiler interfa
c
e, the
comp
iler
sub
s
yste
m e
s
tabli
s
h t
he
cla
s
s type
inform
ation,
the
cla
ss
help
e
r instan
ce fo
r ea
ch im
po
rted
cla
ss, a
nd relation
s betwe
en a
cla
s
s type
and
corre
s
p
ondin
g
cla
ss h
e
lpe
r
instan
ce.
Definition
3 e
x
ternal p
r
o
c
e
dure. Externa
l
pr
o
c
ed
ures
are virtu
a
l p
r
oce
dures th
a
t
could
be anything
whe
n
co
mpil
ed, inclu
d
ing
cla
ss m
e
thod
s, attribute
s
, method
s an
d
events. External
pro
c
ed
ures a
r
e used to sto
r
e cla
s
s type informatio
n for the com
p
iler sub
s
ystem.
The
com
p
iler su
bsy
s
tem
compl
e
tes th
e follo
wing
works in th
e
compile
pha
se: wh
en
operation
s
o
n
obje
c
ts are
detected, th
e compil
er
checks cla
s
s type tabl
es whether cla
ss typ
e
informatio
n correspon
ding
to the obj
ect
s
exist
s
o
r
n
o
t. If the class type info
rm
ation exist
s
, the
compil
er find
s the
a
s
soci
ated
cla
s
s h
e
lper wh
ic
h
ac
ce
ss
es
t
h
e
co
mpile
t
i
me cl
as
s li
br
a
r
y
throug
h the
compil
e time
libra
ry impo
rter. Th
ere a
r
e two mai
n
asp
e
ct
s to th
e cl
ass h
e
lp
er:
helpin
g
the compil
er for
gene
rating p
u
sh in
stru
cti
ons a
nd filling in the import descriptio
n
s.
Acco
rdi
ng to
the calle
r'
s para
m
eter i
n
formatio
n
acq
u
ired from th
e cla
ss item
s of the comp
ile
time cla
s
s lib
rary, the
com
p
iler g
ene
rat
e
s p
u
sh in
struction
s
, creat
es o
r
find
s th
e numb
e
r
of the
calle
d extern
al procedu
re
s, and the
n
, fills in th
e
impo
rt de
scription
s
of the
external p
r
o
c
edu
res
import ta
ble. I
f
the cl
ass ty
pe info
rmatio
n do
esn't
exist, the com
p
ile
r p
r
ovide
s
fal
s
e
alarms. Af
ter
the above
works
are
com
p
leted, the
compile
r is
ca
pable
of processing
obje
c
t
s
, and
ha
s b
een
extended to the com
p
ile
r subsy
s
tem.
3.2. Object S
upportin
g
Env
i
ronment
The o
b
je
ct suppo
rting
en
vironme
n
t co
nsi
s
ts
of thre
e pa
rts de
scribing
an
app
roach to
dealin
g
with
obje
c
t. The
first
part
is cal
l
ed the
obj
ect com
p
iler int
e
rface,
whi
c
h
is
divided
in
to
three
se
ction
s
: the cla
s
s type tabl
e, the cla
ss
helpe
r, and the ext
e
rnal
pro
c
e
d
u
re imp
o
rt ta
ble.
The se
co
nd
part is called
the compile
time clas
s libra
ry import
e
r, whi
c
h prese
r
ves li
sts of
cla
s
s
e
s
impo
rt
ed i
n
t
o
t
h
e
compil
e t
i
me
cla
s
s lib
ra
ry. The l
a
st
part is called the compile ti
me
cla
ss lib
ra
ry, whi
c
h is
use
d
to spe
c
ify the compile ti
me cla
s
s sets an
d the co
mpile time cl
ass
item s
e
ts
.
Each
in
stan
ce of
a
cla
s
s type h
a
s its ow
n cla
s
s helpe
r.
Th
e cla
s
s
hel
per provide
s
sup
port fo
r th
e compile
r to
gen
erate
int
e
rme
d
iate
co
de at t
w
o
wa
ys. One
is to
invoke
metho
d
s
on a cla
s
s. This
se
con
d
way is to suppo
rt the
b
a
si
c ope
ratio
n
s of a cl
ass, su
ch a
s
cast,
assignm
ent, comp
ari
s
o
n
and
oth
e
r op
eration
s
. Wh
en the o
p
e
r
a
t
ions of
cla
s
s, incl
udin
g
the
callin
g cla
ss
method
s or the gene
ral m
e
thod
s, ac
ce
ssi
ng prope
rties, com
p
a
r
in
g object
s
, ca
sting
and a
s
signi
n
g
null, a
r
e h
a
ndled, the
co
mpiler
creat
e
s
o
r
find
s an
external p
r
o
c
edure to h
a
n
d
ling
this op
eratio
n. If it's first
time that the
appli
c
ation
call
s the
obj
ect'
s metho
d
s
, prope
rties and
method
s of class, the co
mpiler
will fill the app
ro
p
r
i
a
te pro
c
e
d
u
r
e identificatio
n into the
cl
ass
items; if not, the com
p
iler fi
nds the p
r
o
c
e
dure n
u
mbe
r
.
Method of class helpe
r are cla
ssified in
to
two cate
gori
e
s:
(1) Fi
ndin
g
m
e
thod, whi
c
h i
s
directly use
d
fo
r finding t
he cla
s
s item
corre
s
p
ondin
g
to the
cla
ss meth
od
in the compil
e time class li
bra
r
y accordi
ng to the cla
s
s method n
a
me.
(2)
Callin
g
method, whi
c
h i
s
directly
use
d
for
creating a
n
external p
r
o
c
e
dure th
e
appli
c
ation
ca
lls cla
s
s meth
ods.
Each externa
l
pro
c
edu
re
correspon
ds t
o
an im
po
rt d
e
cla
r
ation. T
he impo
rt de
claration
use
d
for the
cla
ss lib
ra
ry contai
ns all i
n
formatio
n n
eede
d for external fun
c
tion
regi
stere
d
to the
compil
er. Wh
en the comp
iler ge
nerate
s
interm
ediat
e cod
e
, the import de
cla
r
ation mu
st be
written to the
intermedi
ate
code
s. Wh
e
n
executo
r
in
stalls the ext
e
rnal p
r
o
c
e
d
ure, it has to
read
all informatio
n of external pro
c
ed
ure. An impor
t de
cl
aration i
s
a string co
ntaini
ng the followi
ng
stru
cture: cl
a
s
s nam
e+'|'+met
hod
nam
e+'|'
+
cc+pa
ra
meters, where cc i
s
a
cal
ling
conventi
on,
and the pa
ra
meters de
cid
ed by compil
e time class it
em is a stri
ng
con
s
istin
g
of 1 and 0.
Evaluation Warning : The document was created with Spire.PDF for Python.
ISSN: 23
02-4
046
TELKOM
NI
KA
Vol. 12, No. 6, June 20
14: 4521 – 4
527
4524
3.3. P/S Support fo
r the
Com
p
iler Subsy
s
tem
In order to p
r
ovide fo
r P/
S se
rvice
su
pport, th
e
co
mpiler sub
s
ystem
com
p
le
tes two
works. Fi
rst
of all, sub
s
cription
s a
r
e
tran
slat
ed
int
o
the foll
owi
ng p
r
o
c
ed
ure, and
then
the
pro
c
ed
ure are compil
ed in
to the interme
d
iate co
de
s.
Procedu
re <Subscri
p
tion
name
>
(<Tr
i
g
gerin
g event para
m
eter li
st>)
Begin
If <conditio
n
s> The
n
<a
ctio
ns>;
End.
Secon
d
, the asso
ciation b
e
twee
n event
and su
bscri
p
tion name is
establi
s
h
ed.
4. Executo
r Subs
y
s
tem
4.1. External
Procedure
Executio
n
Technology
Figure 2 sh
o
w
s a
n
executor su
bsy
s
te
m
for object o
r
i
ented P/S System
s.
Figure 2. Executor Su
bsy
s
tem
The
workin
g
pro
c
e
s
s of ex
ecuto
r
sub
s
y
s
tem i
s
divid
ed into two p
hases: the fi
rst pha
se
is initiali
zation, the
second
phase will
focus on exec
ution. Now the executor is capable
of
handli
ng exte
rnal p
r
o
c
ed
ures.
The exe
c
utor
sub
s
ystem
co
mpletes the f
o
llowin
g
works in the initiali
zation phase:
firstly,
the run time
cla
ss lib
ra
ry importe
r loa
d
s
the cl
asse
s to provide
suppo
rt for obj
ect ori
ented
P/S
system
s on
e
s
tabli
s
hin
g
ba
sic
run tim
e
class libra
ry
;
s
e
co
ndly
,
us
er
s impo
rt
c
u
st
om cla
s
se
s in
t
o
the run time
cla
ss lib
ra
ry by run time
cla
ss lib
ra
ry importe
r; final
ly, in the external
pro
c
e
d
u
re
executio
n interface, the e
x
ternal
proce
dure i
n
stalle
r sets u
p
t
he external p
r
o
c
edure re
co
rd
s for
each in
stalle
d external
proce
dur
e, an
d
rel
a
tions b
e
t
ween
the
e
x
ternal
pro
c
e
dure
s
and
th
e
corre
s
p
ondin
g
external p
r
o
c
ed
ure
re
cords.
The exe
c
uto
r
sub
s
ystem
complete
s the
following
wo
rks in the
executio
n pha
se: whe
n
the external
pro
c
ed
ure is
calle
d, the external
p
r
o
c
ed
ure exe
c
uto
r
che
c
ks
whet
her the external
pro
c
ed
ure re
cord co
rresp
ondin
g
to the external
p
r
ocedu
re exi
s
ts or n
o
t. If the external
pro
c
ed
ure re
cord exists,
the external pro
c
ed
ure
executor fi
nds the a
s
sociate
d
external
pro
c
ed
ure re
cord which a
c
cesse
s
run t
i
me cla
s
s lib
rary thro
ugh t
he ru
n time li
bra
r
y impo
rte
r
. If
the the
external p
r
o
c
ed
ure record
do
e
s
n't
exist,
th
e e
x
te
r
n
a
l
pr
oc
e
d
u
r
e e
x
ec
uto
r
pr
o
v
id
es
fa
ls
e
alarm
s
. After the above works a
r
e
com
p
leted, t
he e
x
ecutor i
s
ca
pable of p
r
o
c
essing exte
rn
al
pro
c
ed
ures, a
nd ha
s bee
n extended
to the executor subsy
s
tem.
4.2. External
Procedure
Supporting
En
v
i
ronment and Its For
mal Descrip
tion
Duri
ng the
executio
n ph
ase of an e
x
ternal
proce
dure, the
r
e
are
several gene
ral
prin
ciple
s
tha
t
should b
e
followe
d.
(1)
Calling conventions. The ca
lling conventions influence
two things: how parameters
are p
a
sse
d
to a functio
n
or p
r
ocedu
re
, how a
call
er'
s
sta
c
k is
clea
ned u
p
whe
n
the cal
l
er
retur
n
s.
Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM
NIKA
ISSN:
2302-4
046
Obje
ct-O
rient
ed Publish/Subs
cri
be Syst
em
(Biao Don
g
)
4525
(2) Metho
d
call. Method
s
are fu
nctio
n
s and
procedu
res that a
ppl
y only to o
b
j
e
cts of a
particula
r cla
ss
and it
s de
scend
ants. M
e
thod
s diffe
r
from ordina
ry
pro
c
ed
ures
and fun
c
tion
s in
that every m
e
thod h
a
s a
n
implicit pa
ra
meter
calle
d
Self, which
refers to th
e
obje
c
t that is the
subj
ect
of a
method
call.
Self is a
n
a
d
d
re
ss poi
nt
er.
Within
the i
m
pleme
n
tatio
n
of a
metho
d
, the
identifier Self referen
c
e
s
the obje
c
t in wh
ich the metho
d
is call
ed.
(3)
Retu
rning
results. The
r
e are two types of me
cha
n
i
sms fo
r retu
rning value
s
. The first
mech
ani
sm i
s
to put the
results in t
he ST(0
) re
gister
of the
float point
unit(FPU), which
corre
s
p
ond
s to the top of the FPU sta
ck.
Seco
n
d
ly, put the results in
the CPU re
gi
sters.
(4)
Con
s
tru
c
t
o
rs
and d
e
st
ructo
r
s. Con
s
tructo
rs a
nd
destructo
rs u
s
e the same
calling
conve
n
tion
s as othe
r
m
e
thod
s,
e
xcept
that a
n
a
ddit
i
onal B
oolea
n flag
pa
ram
e
ter i
s
pa
sse
d
to
indicate the
context of th
e con
s
tru
c
tor or
de
stru
cto
r
call. Th
e fl
ag p
a
ra
meter beh
aves a
s
if it
were de
cla
r
e
d
before all ot
her pa
ram
e
te
rs.
(5) Virtual
me
thods. A
virtu
a
l meth
od i
s
a meth
od th
a
t
is
boun
d at
runtime
in
ste
ad of
at
compil
e time. At runtime, the method in
the cla
ss'
s ru
ntime tables,
spe
c
ific
ally the virtual method
table(VMT
)
, a
r
e loo
k
e
d
up,
and the
met
hod for t
he a
c
tual
cla
ss i
s
calle
d. The a
c
tual
cla
ss mi
ght
be the
com
p
i
l
e time de
cla
r
ed
cla
s
s, or
it might
be a
derived
cla
ss-it doe
sn't m
a
tter be
ca
use a
VMT provide
s
the pointe
r
to the co
rre
ct method.
(6) Passin
g
para
m
eters.
Passi
ng
pa
ra
meters d
e
fin
e
a
numb
e
r
of different
a
s
pe
cts of
method invo
kation: whe
r
e
para
m
eters a
r
e lo
cated:
in
regi
sters or
on the
sta
c
k, in which ord
e
r
para
m
eters a
r
e pa
ssed:
ri
ght to left or left to right, who i
s
re
sp
onsi
b
le for
cl
eanin
g
up th
e
para
m
eters a
fterwa
r
d
s
, the caller o
r
the
calle
e.
Definition 4
external p
r
oce
dure sup
por
ting
environment. Th
e
external p
r
oce
dure
sup
portin
g
e
n
vironm
ent E
E
=<T
1
, T
2
, CS
run
,
S
t
ack,
T
other
>,
whe
r
e T
1
: the
external
p
r
o
c
ed
ure
record table,
T
2
: the cl
ass type tabl
e, CS
run
: the runtime lib
ra
ry; Sta
ck: the
data
stack
of the
executo
r
su
b
s
ystem; T
other
: the other tabl
es in the exe
c
utor
sub
s
yst
e
m.
Definition
5
e
x
ecution
vect
or. Th
e exte
rnal p
r
o
c
ed
ures
ca
n b
e
p
e
r
forme
d
, if a
n
d
only if
the
external pro
c
ed
ure su
pportin
g
e
n
vi
ronm
ent o
b
tains an
exe
c
ution ve
ctor
∂
=<
∂
1
,
∂
2
,
∂
3
>.
Whe
r
e:
∂
1
is
a s
u
bs
et of the s
e
t {EAX, E
C
X, EDX, Cu
rrStac
k
}, which is
ass
o
c
i
ated with the input
data,
∂
2
is a pro
c
ed
ure po
inter,
∂
3
is an
element of the set {AL, AX, EAX, EDX: EAX, ST(0)},
whic
h is
us
ed to s
a
ve the returning res
u
lts
.
Definition
6 t
r
an
sform.
Let
ExtPro
i
be
the
cu
rre
nt b
e
ing i
n
voked
extern
al p
r
o
c
ed
ure.
There are
six kind
s of tran
sforms d
e
fined
as follows:
(1)
∆
1
(EE, ExtPro
i
)=cc, wh
ere cc i
s
a cal
ling co
nventio
n of the ExtPr
o
i
.
(2)
∆
2
(EE, ExtPro
i
)=Fself, whe
r
e F
s
elf is a paramete
r
Self of the ExtPro
i
.
(3)
∆
3
(EE, ExtPro
i
)=n; whe
r
e n is returni
ng re
sults of t
he ExtPro
i
.
(4)
∆
4
(EE, ExtPro
i
)=P
L
ist, whi
c
h ma
ke
EE to meet th
e fourth pri
n
ci
ple.
(5)
∆
5
(EE, ExtPro
i
)=ptr, wh
ere ptr i
s
a ca
lling pointe
r
o
f
the ExtPro
i
.
(6)
∆
6
(EE, ExtProi)=Pa
r
Li
st, which ma
ke EE to meet
the sixth prin
ciple.
Theo
rem 1.
∆
i
(1
≤
i
≤
6)) is achieva
b
le.
Proof: EE=
<
T
1
, T
2
, CS
ru
n
,
St
ack,
T
other
>,
whe
r
e T
1
is th
e external p
r
o
c
ed
ure
re
cord table,
whi
c
h
ha
s a
n
extern
al p
r
o
c
ed
ure
imp
o
rt description
con
s
i
s
ting of a
st
ring
that contai
ns
cc.F
or
other tra
n
sfo
r
ms, we
can v
e
rify one by one.
Theo
rem 2: T
he executor subsy
s
tem ca
n perfo
rm external p
r
o
c
e
d
u
r
es.
Proof: By the tran
sform
s
∆
6
,
∆
4
,
∆
2
and
∆
1
, the exe
c
u
t
or sub
s
yste
m ca
n get
∂
1
. By the
trans
form
∆
5
,
∂
2
can b
e
obt
ained. By the transfo
rm
∆
3
,
n can be o
b
tained, an
d then acco
rdin
g to
the type of n, the exec
uto
r
sub
s
ystem
ca
n get
∂
3
. Thus
, By the trans
forms
∆
6
,
∆
5
,
∆
4
,
∆
3
,
∆
2
and
∆
1
,
the executor su
bsy
s
te
m
get
s<
∂
1
,
∂
2
,
∂
3
>. T
herefore, th
e exe
c
ut
or su
bsy
s
te
m
can pe
rform
external p
r
o
c
edures.
4.3. Structu
r
e and Proce
ss of th
e External Proced
ure Execu
tor
The follo
wing
con
c
lu
sio
n
s can
be m
a
d
e
from the
a
bove an
alysi
s
: First, the
external
pro
c
ed
ure executo
r
pe
rforms the tran
sf
orm
s
∆
1
,
∆
2
,
∆
3
,
∆
4
and
∆
5
, the order o
f
executing the
transfo
rm
s a
nd the
algo
rithms
co
rresp
ondin
g
to th
e
tran
sform
s
must b
e
spe
c
ifically d
e
si
g
ned
according to
the type of the extern
al p
r
ocedu
re
s. Seco
ndly, the external p
r
o
c
edure exe
c
ut
or
perfo
rms the
tran
sform
∆
6 to obtai
n
<
∂
1
,
∂
2
,
∂
3
>.
Finally, the
external
pro
c
ed
ure
exe
c
utor
perfo
rms the
external
procedure. Th
eref
ore, th
e ex
ternal p
r
o
c
ed
ure exe
c
ut
or h
a
s
a hi
erarchi
c
al
stru
cture, wh
ich is divide
d into three
parts
from
top to bottom, namely, the cla
s
sificat
i
on
Evaluation Warning : The document was created with Spire.PDF for Python.
ISSN: 23
02-4
046
TELKOM
NI
KA
Vol. 12, No. 6, June 20
14: 4521 – 4
527
4526
function
s, the pre
-
ha
ndli
ng and p
o
st
-han
dling fu
nction
s for t
he und
erlyin
g call, and
the
unde
rlying ca
ll function
s.
The wo
rk pro
c
e
s
ses of the
external
procedure executor are as follo
ws:
(1) A
c
cordi
n
g
to the external pro
c
e
d
u
r
e re
co
rd, the external pro
c
ed
ure exe
c
utor calls
the corre
s
p
o
n
d
ing cl
assification functio
n
.
(2) The cla
ssifi
cation
fu
nction
s
g
e
n
e
rate
the call parameters
acc
o
rding to the
cha
r
a
c
teri
stics of each typ
e
of the call functio
n
s.
(3) Acco
rdin
g
to the different calling con
v
entions, met
hod call
s an
d
paramete
r
-p
assing
mode
s, the
e
x
ternal
pro
c
e
dure
exe
c
uto
r
p
r
e
-
han
dle
s
the
call
pa
ra
meters, an
d
post-han
dle
s
the
results return
ed by the und
erlying call function
s.
4.4. P/S Sup
port fo
r the
Executor Su
bs
y
s
tem
The
pre
c
o
ndit
i
on fo
r p
r
ovidi
ng P/S
servi
c
es i
s
that the
obje
c
t-o
r
iente
d
sy
stem
mu
st have
a unified eve
n
t detection
mech
ani
sm. The timing of
the pre-exe
c
ution method
events' dete
c
tion
is before calli
ng the cla
ssif
i
cation fun
c
tions. The
n
, all of the required pa
ram
e
te
rs in
cludi
ng the
external p
r
o
c
ed
ure i
denti
f
ication, poin
t
ers
a
nd ext
e
rnal
pro
c
e
d
u
re p
a
ra
met
e
rs
have b
e
e
n
prod
uced, th
e executor
su
bsyste
m
calculate the
req
u
ired
sub
s
cri
p
tions
acco
rd
ing to the
type of
external procedure and th
e param
et
ers at the top o
f
stack. T
he
timing of the post-exe
c
uti
on
method eve
n
ts' d
e
tection i
s
at the end
of callin
g t
he
cl
assificatio
n
fu
nction
s a
nd b
e
fore
returnin
g
the call
er. T
hen, the exe
c
utor
su
bsy
s
tem ca
n get
the gen
erate
d
method
event's p
a
rame
ter
values a
c
cording to the stack of the exter
nal proce
dure exe
c
utor a
nd th
e type of th
e
cla
ssif
i
cat
i
on f
unct
i
on
s.
5. Simulation Experimen
t
By P/S mechanism, the
si
mulation exp
e
rime
nt
reali
z
es the foll
owi
ng fun
c
tion:
whe
n
the
appli
c
ation di
splay
s
a form
f, a
dialog bo
x titled
''Test'' are displaye
d on scre
en. The experi
m
ent
is discu
s
sed
as follo
ws:
(1)
Codi
ng to sho
w
a form f
.
v
a
r f:TForm;
begin f:=TF
orm.Cre
a
teNew(f,0);
f.Show;
while f.Visible do
Applicatio
n.ProcessM
essa
ges;
f.free;
end.
(2)
Defining an event.
Cre
a
te Ev
ent Cre
a
teFo
rm
After TForm.
C
re
ateN
ew
(A
own
e
r, Du
m
m
y
)
;
(
3
)
D
e
fin
i
ng
a s
u
bs
cr
ip
tio
n
.
Cre
a
te Sub ShowF
o
rm
On CreateF
orm
Con
d
ition: Aowne
r
=f;
Act: Begin
Messag
eBox(0,''Te
s
t'',''Fo
r
m f!'',0);
End.
The compile
r su
bsy
s
tem
gene
rate
s interme
d
iate
code
s for
the form f and the
sub
s
criptio
n
ShowF
o
rm,
and the
n
establi
s
h
e
s asso
ciation betwe
en
the
method event
Cre
a
teFo
rm
and the
subscri
p
tion
ShowF
o
rm.
After the executor
su
b
s
ystem p
e
rf
orm
s
CreateNew(f, 0), a c
l
ass
i
fic
a
tion func
t
i
on is
c
a
lle
d. Before the
function
retu
rns, the
eve
n
t
Cre
a
teFo
rm i
s
tri
gge
red.
The
eleme
n
ts o
n
th
e
top
of
the extern
al
p
r
o
c
edu
re
executo
r
'
s
stack
stand
s fo
r th
e a
c
tual valu
e that the
executo
r
sub
s
y
s
tem
want to
use. The
n
t
he inte
rmedi
ate
cod
e
s
corre
s
pondi
ng to su
bscriptio
n
Sh
owFo
rm a
r
e
execute
d
.
Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM
NIKA
ISSN:
2302-4
046
Obje
ct-O
rient
ed Publish/Subs
cri
be Syst
em
(Biao Don
g
)
4527
6. Conclusio
n
In this pa
pe
r, we p
r
o
p
o
s
e
a co
mpile
r su
bsyste
m and
an exe
c
utor subsy
s
tem for
obje
c
t-
oriente
d
P/S system
s. Event model a
n
d
sub
s
cr
iptio
n
model a
r
e d
e
fined in a
n
obje
c
t-o
r
iente
d
environment.
We illu
strat
e
s a conclusion
through simulati
on. T
he result shows that the two
sub
s
ystem
s
can ea
sily be constructe
d,
and improve the usa
b
ilit
y of
P/S systems.
Ackn
o
w
l
e
dg
ements
This wo
rk
wa
s spon
so
re
d by
Qing Lan Proje
c
t 201
2(Jian
gsu Provi
n
ce,
Chin
a)
a
nd op
en
fund p
r
oje
c
t o
f
Jiang
su
pro
v
incial
re
sea
r
ch a
nd
devel
opment
ce
nte
r
of intellig
ent
sen
s
o
r
n
e
twork
engin
eeri
ng tech
nolo
g
y, China(ZK11
-02
-
01, re
se
ar
ch
on publi
s
h in
large
-
scal
e e
v
ent system).
Referen
ces
[1]
Birman, Ken
n
e
t
h P. Guide to Reli
ab
le Distri
b
uted
S
y
stems. Lon
do
n: Spring
er
Lon
do
n. 201
2: 185-2
47.
[2]
Ka
ye, D
o
u
g
. L
oose
l
y co
up
led
:
the miss
ing
p
i
eces
of
W
e
b
services.
Cal
i
forni
a
: RDS
Strategi
es
LL
C
.
200
3.
[3]
F
o
tiou, N
i
kos,
Dirk T
r
ossen,
George
C P
o
l
yzos. Illustrati
ng
a
pub
lish
su
b
scribe inter
net architectur
e
.
T
e
leco
mmunic
a
tion Syste
m
s
.
2012; 5
1
(4): 2
33-2
45.
[4]
Che
n
H, Kim M, Lei H, et al. Elastic a
nd scal
abl
e p
ublis
h/subscr
ib
e se
rvice. U.S. patent No.
20,13
0,00
7,13
1.
[5]
Parkins
on, Matthe
w
, Gavin Bi
erman. Ali
a
sin
g
in
Object-Ori
ented Pro
g
ram
m
ing.
T
y
pe
s, An
a
l
y
s
i
s
and
Verificati
on. Be
rlin: Spri
nger B
e
rlin H
e
i
del
ber
g. 2013: 3
66-4
06.
Evaluation Warning : The document was created with Spire.PDF for Python.