ѧ
JOURNAL OF SOFTWARE
2000Vol.11No.3P.410-415



XYZ/Eʽϵṹ
Ʒʷֲ
ժҪʱ߼XYZ/Eֳ̻ϵṹ.ڿ̻֮ǰ,ͨоӷʽĹϵ˷֮Ĺϵ,Ȼͨضӷʽϲϵṹʽ.
ؼʡϵṹ,,ʽ,XYZ/E.
ͼšTP311
Formalizing Architectural Styles with XYZ/E
JIAO Wen-pinSHI Zhong-zhi
(Institute of Computing Technology The Chinese Academy of Sciences Beijing100080)
AbstractIn this paper,a temporal logic language XYZ/E is used to formalize several common architectural styles.Before the styles described,the relationship among them is analyzed based on the relationships among components and connectors,and then the complete formal descriptions of the architectural styles are derived from the compositions of specific components and connectors.
Key wordsSoftware architecture,style,formalization,XYZ/E.
ϵͳģĲ,ϵͳĽǶǧ,ϵͳҲͺѴɹʶ.,ʽķ̻ϵͳȷϵͳʵں,ҲƺʹϵͳйԱ׼ȷ˽ϵͳ.
ϵṹһϵϵͳĽṹ֯ģʽ1,Ƕһƽṹϵͳĳ.ϵṹȶӷʽĸ,ֹ涨ǵϹƣ2.оϵṹ񲻽ڸ׼ȷذվضϵͳĸ,ԱԱϵͳṹϾɹʶ,ϵͳĿԣܰԱ˽ⲻͬϵṹͬ,Ϊʹúϲͬṩָ.ĽXYZ/E3ݶԼֳϵṹʽ.
XYZ/Eһʱ߼Ϊʽ,ṩһʽ淶ϵͳֶ.XYZ/EУгԪ(䡢)Ǻʽʽ,⣬ͬһаʽ

(1)

(2)
LBΪſƱ,yzΪı,Oֱ͡ʾʱ߼еġһΡ͡ա,RQֱΪǰúͺö.ʽ(1)ʾ㷨пִеһ(״̬ת)ʽ(2)Ϊһι̵õĹ淶.
ɼXYZ/EʺڽϵͲ㷨,ڽϸߵĳ϶Գй淶.ΪǶǺʽʽ,XYZ/E淶ֳӷʽϵṹͬʱ,ֱӼ֤淶һԺȷ.
һϵṹضӷʽ϶ɵһϵͳĳ,ˣXYZ/Eʽ֮ǰ,ǽE-Rͼӷʽ֮Ĺϵ,ڴ˻Ͻһ֮Ĺϵ.ȻЩϵӼ򵽷,𲽶Խԭʼӷʽӷʽ.ͨضӷʽϵṹʽ.
1 ع
ϵṹΪǽṩһ׼ϵṹʵ弰Ƶ˵.Դϵṹ2,Ǿͼʽķȷ̻ϵṹ.
ף4,Zʾ(Z notation)ַ̻(pipe-filterevent-system).ȶϵṹĳ﷨,ϸ˷ģ,ֶϵṹľ﷨,ͨӳ﷨ӳ亯ṩ˷ľ庬.
ף5,ͨһ鹫򽫷һ.óģʽģʽ֮ӳͷӳ֤ģʽ֮ȷ.ڸϵ3ֲͬʽ.
֮,ڶϵṹԶһ̶ṩĳʽϵṹضֶΣ1.Щձв֮:(1) оϵṹʱǴͬһǶȳ,еĴӹܵĽǶ,еĴݷֲĽǶ,еĴǴֵĽǶ.ģ˷֮Ľ,໥֮ڽ,ҼӴͳһʽַ̻Ѷ.(2) ڿַ̻ʱ,һֻ涨˸ԪӦܵ,ͨӷʽ֮γɵϵͳʲôû.
2 Ĺϵ
ڿ̻ʱ,ǳϣӼ򵽷֮,Ҳϣڴ˹гѶϢ.ˣXYZ/Eʽ֮ǰ,һ·֮Ĺϵ.Ĺϵӷʽ֮Ĺϵֵ.
2.1Ĺϵ
ף1,г˺ܶೣ,Computation㹦ܣMemoryݴ洢ManagerControllerLinkӣDataݽṹ.ʵ,ʵϵͼ(E-Rͼ)Խ֮ĹϵʾΪͼ1.ͼи˾ʾĹϵ֮,²Ϊԭʼ,ϲԱȽϸ߼.

Fig.1The entity-relationship deagram of common components
ͼ1ʵϵͼ
2.2ӷʽĹϵ
ף1,г˺ܶೣӷʽ,Procedure-Call̵ãData-FlowImplicit-TriggeringʽMessage-PassingϢݣShared-Dataݣ.ӷʽʵ,E-RͼԽ֮ĹϵʾΪͼ2.
2.3Ĺ(ɷ)
ӷʽĲͬ,Թɺܶвͬϵṹ.磺
.Concurrent ProcessesComputationͨMessage-Passingʽ϶ɣ
.Pipe-FilterComputationͨProcedure-Callʽ϶ɣ
.Client/ServerComputation,ManagerͨProcedure-Callʽ϶ɣ
.Event-BasedControllerӦ¼Ķ(Manager)ͨImplicit-Triggeringʽ϶ɣ
.Object-OrientationManagerͨMessage-Passingʽ϶.
Կ,ϵṹĹϵǼ򵥵Ĳιϵ,ڿ̻ʱ,õһ㲻ʽ淶,Щȹɸ÷ӷʽԭʼӷʽĹ淶.
3 XYZ/Eʽϵṹ
3.1XYZ/E
ǰʾϵͼ,ʱ,մӵͼ߼Ĵ.ϸ߼ʱͿֱõͼϢ.
.Data(structure)
Type StructName==Record(FieldList)ݣ
StructNameΪݽṹ,ṹ巽ʽPascalеRecord.
.Computation
XYZ/E,Computationǹ/̻,䶨Ϊ
Proc ProcName(Parameters)==Statements where (Constraint),
ProcNameΪ/(ں,Ҫ巵ֵ),StatementsΪʵָù̵,ʽʽ(1)ʽ(2).
.Manager
XYZ/E,ManagerӦĶ󱻶һ,䶨Ϊ
OOPROG ObjName==DataStructureComputations where (Constraint)
ObjNameΪ.
.Controller
ȻXYZ/EûֱӶControllerĶӦɷ,XYZ/EеĽܹͨͨ(channel)ȡ״̬Ϣ,ܸõ״̬ӦĽ.Controller൱XYZ/Eеѡ䣺

3.2XYZ/Eӷʽ
XYZ/E,̵úͽͨӷʽ,ӷʽڴ˻չ.
.Procedure-Call
XYZ/Eй̵õĻʽΪ(豻õĹΪCallee)

Ϊ

P,QֱΪCalleeǰúͺö.
.Message-Passing
ӷʽͨ(channel)Ϣ߼(sender/receiver),ӷ ͽߵͨΪc,Sender/ReceiverXYZ/Eɶ£

ôMessage-PassingԶSenderReceiver̵ϣ
Message-Passing==Sender;Receiverݣ
ʽΪPQ(u/w)Q(u/w)ʾQuɳֶw棬

.Data-Flow
ӷʽE-Rͼ(ͼ2ʾ)ѾָɴݵĻ(buffer)Լ򻺳ͻȡݵĲin/out.XYZ/E,in/outԷֱΪ(DataFlowȽȳĶзʽʵ)

ôData-FlowԶinout̵ϣ
DataFlow==in;out.
.Implicit-Triggering
XYZ/Eһ߼,еĸֳɷֶԱʾ߼ʽ,,¼(event)XYZ/EʵҲһʽʽ.赱¼Eʱ,Ĺ̻ΪRe-actor,ʽXYZ/EΪ

ʽΪ

3.3ʽϵṹ
ͨضӷʽͿԵõϵṹʽ.ǽͼֳĹ淶ʽп̻.
.Concurrent Processes
ϵͳPn(P1,P2,...,Pn)϶,Pi==RiPiQi,ϵͳΪ
P==P1,P2,...,Pn,
ʽΪ

.Event-Based
ϵͳSдڿʶ¼E1,E2,...,En,Щ¼ĶObj1,O bj2,...,Objm.¼(controller)XYZ/EʾΪ

ĶӦӦ¼Ľ̿ԶΪ

ϵͳɶΪ
S==Controller,Obj1,Obj2,...,Objn.
.Pipe-Filter
Ϊ,˷Filter(F1,F2)ͨData-FlowPipe(P1)Ӷ.,FilterΪMain/Subroutine,Input,Data-Process,Output3ӹ.Pipe-Filterͼ3ʾ.

Fig.3A pipe-filter style
ͼ3Pipe-Filterʾͼ
 

,Pipe-FilterԶΪ
Pipe-Filter==F1;F2.
.Client/Server
Client/ServerClient,Server,,


Client,ServerӷʽΪMessage-Passing(MP),ɶ

ôClient/ServerɶΪ
CS==Client;Server.
4 
ף1,4,5õʽԲͬ,ڹ淶ϵṹʱ,ȵ̻˼ֳӷʽ.,ֻضӷʽܵõµķ,ڶʱֱѶõĹ淶˵.Ϊĸֹ淶˵,ʵϵͼ(E-Rͼ)˼ֳӷʽĹϵ,ڴ˻Ϸϵṹ֮Ĺϵ.Ƿ,ӷʽɵϵṹ֮䲢Ǽ򵥵ƽйϵ,Ҳǲιϵ,ǳָӵ״ϵ.,ҪеĹ淶Ϣ,ֻܴӷʽ.
ݷĹϵ,ǲȡչ򵥷γɸӷĲ,ʱ߼XYZ/E̻˼ֳϵṹ.
ʽϵṹʱ,ڽӷʽľ̬,Ҫ˵ضӷʽɵķ񵽵ʲô,һʽӵ,ò.
оõ863߿ƼĿ(No.863-306-ZT02-01-3).߽Ʒ,1969,ʿ,ҪоΪ,̼.ʷֲ,1941,оԱ,ʿʦҪоΪ˹, .
ͨѶϵ:Ʒ, 100080,йѧԺ㼼оܼѧ
ߵλ:Ʒ(йѧԺ㼼о100080)
ʷֲ(йѧԺ㼼о100080)
ο
1Shaw M,Garlan D.Software architecture:perspectives on an emerging discipline.New Jersey:Prentice Hall,Inc.,1996
2Garlan D,Shaw M.An introduction to software architecture.In:Ambriola V,Tortora G eds,Advances in Software Engineering and Knowledge Engineering.Singapore:World Scientific Publishing Company,1993.139
3Tang Zhi-song.A temporal logic language for system implementation.In:Nigel H R eds.Systems Implementation 2000.Berlin:Chapman & Hall,1998
4Abowd G,Allen R,Garlan D.Using style to understand descriptions of software architecture.Software Engineering Notes,1993,118(3):920
5Moriconi M,Qian X.Correctness and composition of software architectures.ACM SIGSOFT Software Engineering Notes,1994,19(5):164174
1998-05-21յԭ,1999-04-07յ޸ĸ
