Ӧо
APPLICATION RESEARCH OF COMPUTERS
2000 Vol.17 No.3 P.48-51




ʿɸģ
Ȩ
ժҪһԪģ֮ͣصķԣBNF̻ģͣԭ
ؼʣ ģ ԭ
l
ΪöѡԪֱϽϵԤư壬ͬԤưģơȻĸһǱ仯ġͨϵͳģ͡ϵṹװĶࡢģ顢(Դ롢Ŀ룬ȵ)ĵ(˵ĵ֤ȵ)ԼԳݡģ֣䡢ֳģ顢ϵͳʽ֣г롢΢ϵṹϵṹϵͳģͣ;֣ϵͳ֧Ź򹹼÷֣кںйҺйģʽ/ǼܹͰ׺йͷ֣д͵Ĺ͵Ĺ͵ĹĹṹ֣ԭӹϹӦõķΧ֣רùĹͨùʱ״̬֣ж̬;̬
ʹ׼ͼ򵥻µǴѡ񹹼ͨװͿʵ֡ʡܹϵͳ仯ֲı仯Ϊ޸Ĵ㡣
ǣװԤư򵥣Ҫ޷ӣϳʵĿӦϵͳҪĻơ׵壬໥֮ĹϵӦʵܹЧʾ⡢޸ĺ͸һ棬ʵķࡢĿ洢ͼؼԵã֯͹ĻͺġˣͨԵоһƣԴٽá
漰ģ͡ݡ
2ģ
ģǷԵĻĳ󣬼What to describeģͿ̻ЩӰɸأ涨빹֮ĽӿںͽơĿǰжģͳ֣Ե3CģͺREBOOTģ͡
3Cһָģ͡ɸݡɡ(Concept)ĳڲԣͨӿ̻Ĺܣ(Content)ֱӿɸõ壬ʵָ̻Ĺܣ(Context)Եĸͨʽ(໥֮ӿںϵ)(ݵԣ͡õĲ)ʵֻ(һʵʱϵĵùϵ)ⲿԡ
REBOOTǻһַͼģ͡ӸǶȣ(FacetĲĶȵ)̻ԡͻ͵Ԫ(FunctionObjectMedium/Agent)̻ṩĲԼĹϵ(O-O)ĹԪ(AbstractionOperationsOperatesOnDependencies)̻ṩĲԼĹϵ3CģͺREBOOTģ෽ǵͬġ
3CĸӦREBOOTķ棻OperatesOnDependenciesһ£ⲿ(һĹϵ)ԡģҲв֮ͬ3Cģ͵̻ԣʺʽԣREBOOTģֻոķܽṹеʺڷʽķ⣬REBOOTģûжӦ3Cģеݵķ档
3CREBOOTͨģ͡Ϊṩһģ塣ûиضӦеضԣʺӦ
3CREBOOTͬͨо󡢸ԿܣһԪģͣûԡԡԡϵԺʹ
<comp_basis, comp_taxonomy, comp_cooperate, comp_link, comp_situation>
ơؼ롢ܡߡʱ䡢汾šȨʹƵʡԸĿ洢ʹйصԣ㡢ģࡢʹ÷ʽӦ÷ΧϳйصԣӡͷͲϵԿ̻֮ϵιϵѹϵ̳йϵùϵιϵǶʽƷ֮ĹϵĵϸĵĹϵģĹϵȣҪΪӺֵܹϵѹϵָƥĹϵ˵һһͺ͸ȫƥ䣬ʽ߿Խкϳɡ̳йϵָϵм̳ԡùϵָͬһĿͬƶϵĹΪ˷ڼʱйϳɡָƷλúִлλָƣִл˵ִʱҪĳƻ
ģָĳ󡣸ģͣԲͬĹģ塣ͬģ൱ڲͬĹࡣɲͬĹ࣬Բ幹ʾͬͬιϢģǽɸĻΪ˴Ŀģ幹ĳֹ빹⡣˵һģ͡ע⣺ɸ֯͹Ǽ򵥵⣬漰ϳɵ⣻ЧԼܵĳַģ͡
ͨģûܹӸȥ˽ҪͿ̻ĳһҪģͽ䡣ͨģ;廯ԽԼģ͡ݴģͿԿӦĹԺͲԣֹ֧ĸֶ
3
ݣԵƻָģͣHow to describeָĳֱʾĳΪˣ˶ʽͷʽ
Խصʽ
ʽʽĹ˵˵ָĳʵϸڡʽĶԡģԣϵͳʽ˵Ϊϵͳԭ͵Ŀٿ춨͵ʽд˵ʽϵͶι˵
˵S=(TFA)ɸĺ˼ͨTͺFܣTԪΪFк/A˺ĹܡһЩͿɼһЩɼԴ˵ɽ䣺ӲӽӿԿԴӲͬĳκͲͬĽǶ
ʽϵǴӶǶ
ι˵ÿ߲˵ԵͲ˵ʩһЩԼڴֱʵĹ˵̳иĹ˵ˮƽʵĹ˵Լ̳ƿܵĹ˵ƿܵĹ˵̳ģ͵Ĺ˵ַṩͬεĹ˵ڴá
ʽı˹ܷϢѧȡ
ıһݽṹڵʾ߱ʾڵĹϵûıͨƶ蹹
˹ܷû֪ʶıʾЧرﹹĹϵܹûֹϵõͿܡһͼʾ󣬻ʾĹϵнϺõıʾ̽һν߼ǿ֪֪ʶʾƣͨùзࡣһݽṹۺֵͨĿ֪ʶһܶӦһֹ۱ʾֵͣʾĹ
õĿϢѧзʾ͹ؼʱʾʾ޸ⰴ࣬γɲνṹṹνṹ⣬޸ĺ䣻ṹ޸ġ䣬Ź󣬹ļάԽԽѡؼʱʾʹøԣöṩĲݴζ﷨ɣ﷨ͬϹڸϡؼʱʾֱۡݡǿûڹߵ֯ͼЧûĸԸ÷ȷжԣԶһʶ塢ͬ壬ΪӦôʻгͬʺĸϵƥ͹ļ
Ӱɸùɡ޸ġѡʱҪ¼⣺ϵͳĽṹҪĲ͡һԡԡɱԡĿɼԣԼԵӰ졣һ棬ûǱʾԺ̽ʾָĳʾ˶Ϣ̽˱ʾ
ǲôͳĿϢ͹ؼʷϵķʽĿǣǽϷ෽öٷ֯ˣĳֹͬ()Ӧ֯һ𣬱ڲѯʹãָһࡣڲͬ׼£öٸеĹϢࡣ
4
ĹߣWith what to describeԶģͼͿ̻ģ͵Ļ֮ϣһϸķʽΪṩȫ׼ȷϢǴ70ģ黥ԡ80ĹԺ90ϵṹԷչġӰĹLILCDLCIDERResolve
⻥LILΪϵͳƵĹԣִ֧븴ú;鸴áĴֱϳ(ͬμ)ˮƽϳ(ͬһι޸ĺ)
CDLǻڶṹ(Object-structured paradigm)Ĺԡ˼ǽںУͨӿڵ﷨ṩṹΪϢʹ߲عڲϸڡ֣ӿں͹塣ӿԼĹϵ-Adaʵֽӿڲֵ˼롣CDLƼԣͨ佫CDLתΪʵԡ
CIDERԵص㣬һĹԣ̳Сʵɽӿںͱɡӿڶ巽ʽʽʽġResolveûڷѧģͱﹹʽ˵͡ǰͺʵ֡ģͺͱʾĶӦϵ
ResolveѧģĽӿ󡢽ӿһܵʵּĹϵʺڿɸùơǣResolve޷óѧģļ̳йϵˣһһͻ¶ܶ㡣
⣬CORBA IDLDCOM ODLIDLȽӿڶ()Զܹ̻ӿڵ﷨Ҿ߱ߵ֧֡ȻеĽӿڿ̻ӿ͹໥֮临ӵĽЭ鷽ȴȱһ֧֡
5ģ
2԰ԡԡԡϵԺʹͨģûܹӸȥ˽
5.1
﷨ϣǲBNFʾ£
<component>::=<comp_basis> 
<comp_taxonomy>
<comp_cooperate>
<comp_link>ϵ
<comp_situation)
<comp_basis>::=<comp_name>
<comp_key>ؼ
<comp_function>
<comp_maker>
<act_time>ʱ
<comp_version>汾
<comp_copyrights>Ȩ
<use_frequency)ʹƵ
<comp_name)::=<identifier>
<identifier>::=letter{letter|digital|'_'}*
<comp_key>::=integer
<comp_function>::=string
<comp_maker>::=string
<act_time>::=<create_time><modify_time>
<create_time>::=datetime
<modify_time>::=datetime
<comp_version>::=integer
<comp_copyrights>::=commercial|freeware|public_domain|shareware
<use_frequency>::=integer
<comp_taxonomy>::=<comp_level)
<comp_size>ģ
<comp_usage>ʹ÷ʽ
<comp_scope>Ӧ÷Χ
<comp_category)
<comp_level>::=requirment|specification|architecture|design|source|executable
<comp_size>::=statement|block|module|task|command|system
<comp_usage>::=black_box|gray_box|skelten|white_box
<comp_scope>::=dedicated|domain_oriented|general_purpose
<comp_category>::=system_software|application_software
<system_software>::=language_processor|utility|operating_systems
<application_software>::=financial|database|desktop_accessory 
|word_processing|communication|desktop_publishing 
|entertainment|educational|development|graphics
|spreadsheets|integrated
<comp_cooperate>::={<connector>{<plug> | <socket>}*}*
<connector>::=<identifier>
<plug>::=!<param_declaration>
<param_declaration>::=<param_type><data_type>
<param_type>::=val_param|var_param
<data_type>::=<simple_type> | <compund_type> | <pointer>
<simple_type>::=integer|boolean|char|real|datetime
<compound_type>::=string|subrange|array|record|enumeratedtype|set|union
<pointer>::= '*' <data_type>
<socket>::=?<param_declaration>
<comp_link>::=<hierarchy_r>ιϵ
[<friend_r>]ѹϵ
[<inherit_r>]̳йϵ
[<reference_r>]ùϵ
<hierarchy_r>::=<child>[<brother>]
<child>::=<comp_key>
<brother>::=<comp_key>
<friend_r>::=[<input_friend>][<output_friend>]
<input_friend>::=<first_friend><next_friend>
<output_friend>::=<first_friend><next_friend>
<first_friend>::=<comp_key>
<next_friend>::=<comp_key>
<inherit_r>::={<supercomp>;}*
<supercomp>::=<comp_key>
<reference_r>::={<ref_comp>;}*
<ref_comp>::=<comp_key>
<comp_situation>::=<comp_artifacts>Ʒ
<comp_location>
<run_environment>ִл
<comp_artifacts>::=processing|data|object|object_oriented|document|figure
<comp_location>::=<lib_name>
<lib_name>::=<identifier>
<run_environment>::=<operating_systems><programming_env>
<operating_systems>::=dos|win31|win95|winnt|unix|aix|...
<programming_env>::=delphi|c|pascal|vc|bc|vb|pb|...
5.2ԭ
Ĳģͣɡɾȣ漰Ķ̬ԣĳЩӿڽһЩ̬ԣ
Create (ʽ)
ɼΪʵ̡ʵĹ⡣Ʒǲģκһ׶εĲƷʵжʽ
˵ͺͱĹϵһɷʽ
ʵǶʵ壬C++ʵĹϵɵĶʵݺͲʵĳʼ״̬ͬ
滻Ԥڹпк궨Ԥ壬к滻Ԥɹ
ļҲһļͨɹ߽ļתΪInformix-4GLУͨĻ˵ļȻĻɹյĻ
ɹߣкйͨӦɹɹ磬UnixеLexYaccɹʽɳɹߡ
Delete(࣬ؼ)
ɾĳʵɾ⡣ÿһ(һģ)жһؼ֮ӦɾȿֱͨĹؼɣҲ()Ĺɡ
Search(࣬Լ)
ģУйصԣ繹ơؼȡԹĺϳҲżĹּ̡ͬһݿλڿУƥ⣬Ҫвϡϳйصԣģӡ
6
ڽĸ֮󣬽еģ͡ԣһµģͣʹԪ<comp_basiscomp_ taxonomycomp_cooperatecomp_linkcomp_situation)BNF̻Ԫģ͵ԣԹĲԭҲ˼򵥵ۡ
Ҹܼ
Ȩ(ѧѧԺ 人 430074)
(ѧѧԺ 人 430074)
ο
1 T. Biggerstaff & C. Richter, Reusability Framework, Assessment and Directions, IEEE Software, Vol.4, No.2, Mar. 1987
2 T. C. Jones, Reusability in Programming: A Survey of the State of the Art, IEEE Trans. on Software Engineering, Vol. SE-10, No.5, September l984
3 ҿ, Ȩ. ü뷽. С΢ͼϵͳ, 19981911ڵ2431ҳ
4 Ӣ. : ģ͡. ѧ, 1997241
5  , Ȩ. ڸõģ. Ӧо, 1998
6 R. Prieto-Diaz, Status Report: Software Reusability, IEEE Software, May l993
7 R. Prieto-Diaz P. Freeman, Classifying Software for Reusability, IEEE Software, Vol.4, No.1, 1987
8 Ҹ, µ,  , ־. Զ. 廪ѧ, ѧ, 1996
9 Ȩ. ߷. С΢ͼϵͳ, 1999
10 Ȩ. ÷뼼. 人ѧ, 1998
ոڣ199977
