计算机科学 ›› 2020, Vol. 47 ›› Issue (3): 19-24.doi: 10.11896/jsjkx.190100046

所属专题: 智能软件工程

• 智能软件工程 • 上一篇    下一篇

设计模式组合操作优化研究

纪程宇,朱雪峰   

  1. (中国石油大学(北京)石油数据挖掘北京市重点实验室 北京102249)
    (中国石油大学(北京)信息科学与工程学院 北京102249)
  • 收稿日期:2019-01-07 出版日期:2020-03-15 发布日期:2020-03-30
  • 通讯作者: 朱雪峰(xuefeng.zhu@cup.edu.cn)
  • 基金资助:
    国家自然科学基金(60496324);中国石油大学科研基金(KYJJ2012-05-17)

Study on Optimization of Design Pattern Combination Operation

JI Cheng-yu,ZHU Xue-feng   

  1. (Beijing Key Laboratory of Petroleum Data Mining, China University of Petroleum, Beijing 102249, China)
    (School of Information Science and Engineering, China University of Petroleum, Beijing 102249, China)
  • Received:2019-01-07 Online:2020-03-15 Published:2020-03-30
  • About author:JI Cheng-yu,master,is not member of China Computer Federation (CCF).Her main research interests include pattern combination and verification and so on. ZHU Xue-feng,Ph.D,master supervisor,is not member of China Computer Federation (CCF).His main research interests include software engineering and so on.
  • Supported by:
    This work was supported by the National Natural Science Foundation (60496324) and China University of Petroleum Research Fund (KYJJ2012-05-17).

摘要: 作为软件设计经验的总结,恰当使用设计模式能够有效提高软件系统的可复用性,确保最终所得软件产品的质量。但在实际应用中,人们很少使用单一的设计模式,通常需要根据实际的应用场景进行多个模式的组合,这可能会导致所得结果不确定,严重影响软件产品的质量。虽然现有的模式组合形式化方法能够有效地表达模式组合后的结果,但是组合方法逻辑复杂并包含大量的冗余操作,设计人员很难熟练使用。针对上述模式组合过程中存在的问题,文中对多模式之间的组合关系进行了深入探讨,从设计模式的形式化描述出发,结合Z语言的特点对现有的模式组合形式化方法进行了深入研究,并对现有的模式组合操作符进行了初步优化;在现有操作符集合的基础上提出了基于模式的约束、叠加和扩展操作符,通过操作符定义了模式组合的精确语义,并采用代数推理过程验证了优化后的方法可以有效地替代现有的模式组合形式化方法,且能够解决现有模式组合形式化方法中操作符冗余、数量过多导致的效率低等问题。最后,通过模式组合案例的研究,验证了所提方法的有效性。

关键词: 操作优化, 等式推理, 模式组合, 设计模式, 形式化方法

Abstract: As a summary of software design experience,proper use of design patterns can effectively improve the reusability of software systems and ensure the quality of the final software products.However,in practical applications,people rarely use a single design pattern,and usually software designers need to use experience to combine multiple patterns according to the actual application scenarios,which may lead to uncertainty results and seriously affect the quality of software products.Although the exi-sting formal method of pattern combination can effectively express the result of pattern combination,the combination method has complex logic and contains a large number of redundant operations,which is difficult for designers to be familiar with and adopt.Aiming at the problems existing in the above pattern combination process,this paper deeply discussed the combination relationship between multiple patterns.Starting from the formal representation of design patterns,combined with the characteristics of Z language,this paper studied the existing formal methods of pattern combination in depth,and optimized the existing pattern combination operators.Based on the existing set of operators,the constraint,superposition and extension operators are proposed,the exact semantics of pattern composition are defined by the operators,and the algebraic reasoning process is used to verify that the optimized method can effectively replace the existing formal method of pattern combination,it can overcome the problems of redundant operators and low efficiency caused by too many operators in the existing formal methods of pattern combination.Finally,the effectiveness of the proposed method is verified by a case study of pattern combination.

Key words: Combination of patterns, Design patterns, Equality reasoning, Formal method, Operation optimization

中图分类号: 

  • TP311.5
[1] GAMMA E,HELM R,JOHNSON R,et al.Design Patterns:Ele- ments of Reusable Object Oriented Software [M].Addison-Wesley,1995.
[2] HOU D,HOOVER H J.Using SCL to specify and check design intent in source code [J].IEEE Transactions on Software Engineering,2006,32(6):404-423.
[3] SHI N,OLSSON R A.Reverse Engineering of Design Patterns from Java Source Code[C]∥IEEE/ACM International Conference on Automated Software Engineering.IEEE,2007:123-134.
[4] KIM D K,LU L.Inference of Design Pattern Instances in UML models via Logic Programming[C]∥IEEE International Conference on Engineering of Complex Computer Systems.IEEE,2006:47-56.
[5] DONG J,ALENCAR P S C,COWAN D D.A behavioral analysis and verification approach to pattern-based design composition [J].Software and Systems Modeling,2004,3(4):262-272.
[6] DONG J,PENG T,ZHAO Y.Automated verification of security pattern compositions [J].Information and Software Technology,2010,52(3):274-295.
[7] DONG J,PENG T,ZHAO Y.On Instantiation and Integration Commutability of Design Pattern [J].The Computer Journal,2011,54(1):164-184.
[8] TAIBI T,NGO D C L.Formal Specification of Design Patterns- A Balanced Approach[C]∥Acs/ieee International Conference on Computer Systems & Applications.IEEE,2003:14-18.
[9] TAIBI T.Formalising design patterns composition [J].IEE Proceedings-Software,2006,153(3):127-136.
[10]TAIBI T,NGO D C L.Formal specification of design pattern combination using BPSL [J].Information and Software Technology,2003,45(3):157-170.
[11] BAYLEY I,ZHU H.Specifying behavioural features of design patterns[C]∥IEEE International Computer Software & Applications Conference.Oxford Brookes University,2008:203-210.
[12] BAYLEY I,ZHU H.A formal language of pattern composition[C]∥Proceedings of The 2nd International Conferences on Pervasive Patterns and Applications.Portugal,2010:1-6.
[13] ZHU H.An institution theory of formal meta-modelling in graphically extended BNF [J].Frontiers of Computer Science,2012,6(1):40-56.
[14] ZHU H,BAYLEY I.An algebra of design patterns [J].ACM Transactions on Software Engineering and Methodology,2013,22(3):1-35.
[15] ZHU H,BAYLEY I.Laws of pattern composition[C]∥International Conference on Formal Engineering Methods & Software Engineering.Springer-Verlag,2010:630-645.
[16] ZHU H,BAYLEY I.On the Composability of Design Patterns [J].IEEE Transactions on Software Engineering,2015,41(11):1138-1152.
[17] BENNETT M,BACLAWSKI K,BENNETT M.Ontology de- sign patterns and semantic abstractions in ontology integration [J].Applied Ontology,2017,12(3/4):341-349.
[18] LUCIA A D,DEUFEMIA V,GRAVINO C,et al.Detecting the Behavior of Design Patterns through Model Checking and Dynamic Analysis [J].Acm Transactions on Software Engineering &Methodology,2018,26(4):1-41.
[19] CACHO N,CLAUDIO S,FIGUEIREDO E,et al.Blending design patterns with aspects:A quantitative study [J].Journal of Systems and Software,2014,98(23):117-139.
[20] HUSSAIN S,KEUNG J,KHAN A A.Software design patterns classification and selection using text categorization approach [J].Applied Soft Computing,2017,58(6):225-244.
[21]DWIVEDI A K,TIRKEY A,RATH S K.Software design pattern mining using classification-based techniques [J].Frontiers of Computer Science,2018,12(1):1-15.
[1] 张英杰, 朱雪峰.
模式驱动的软件架构设计研究综述
Review of Pattern Driven Software Architecture Design
计算机科学, 2018, 45(11A): 48-52.
[2] 陈平,梁启明,孙伟.
面向系统能力的形式化分析和测试方法
System Capability-oriented Approach for Formalized Software Requirements Analysing and Testing
计算机科学, 2017, 44(Z6): 534-538. https://doi.org/10.11896/j.issn.1002-137X.2017.6A.119
[3] 郭艳燕,张楠,童向荣.
UML顺序图形式化语义的研究综述
Survey on Formal Semantics of UML Sequence Diagram
计算机科学, 2017, 44(2): 17-30. https://doi.org/10.11896/j.issn.1002-137X.2017.02.002
[4] 张弛,黄志球,丁泽文.
支持抽象解释的静态分析方法的形式化体系研究
Research on Static Analysis Formalism Supporting Abstract Interpretation
计算机科学, 2017, 44(12): 126-130. https://doi.org/10.11896/j.issn.1002-137X.2017.12.025
[5] 李响,李彤,谢仲文,何云,成蕾,韩煦.
一种面向SaaS多租户的多层模型
Multi-layer Model for SaaS Multi-tenancy
计算机科学, 2017, 44(11): 56-63. https://doi.org/10.11896/j.issn.1002-137X.2017.11.009
[6] 马媛媛,陈喆,汪晨,费稼轩,黄秀丽.
电力智能单元传输规约安全性分析模型研究
Security Analysis Model of Power Intelligent Unit Transmission Protocols
计算机科学, 2016, 43(Z11): 329-337. https://doi.org/10.11896/j.issn.1002-137X.2016.11A.077
[7] 陈光颖,黄志球,陈哲,阚双龙.
面向DO-333的襟缝翼控制单元安全性分析
Safety Analysis of Slat and Flap Control Unit for DO-333
计算机科学, 2016, 43(5): 150-156. https://doi.org/10.11896/j.issn.1002-137X.2016.05.028
[8] 吕兴利,施智平,李晓娟,关 永,叶世伟,张 杰.
连续傅里叶变换基础理论的高阶逻辑形式化
Higher-order Logic Formalization of Basic Theory of Continuous Fourier Transform
计算机科学, 2015, 42(4): 31-36. https://doi.org/10.11896/j.issn.1002-137X.2015.04.004
[9] 古辉,张炜星,金鹏,顾杰杰.
基于关联度和特征约束的软件设计模式识别方法
Method of Software Design Patterns Identification Based on Correlation and Feature Constraints
计算机科学, 2015, 42(2): 173-176. https://doi.org/10.11896/j.issn.1002-137X.2015.02.037
[10] 张硕,贺飞.
运行时验证技术的研究进展
Research Advances in Runtime Verification
计算机科学, 2014, 41(Z11): 359-363.
[11] 许涵斌,张学林,郑晓梅,张天,李宣东.
一种基于结构查询的UML设计模式识别方法
UML Design Pattern Recognition Method Based on Structured Query
计算机科学, 2014, 41(11): 50-55. https://doi.org/10.11896/j.issn.1002-137X.2014.11.011
[12] 古辉,张炜星.
基于XML Schema技术的设计模式定义方法
Method of Design Patterns Definition Based on XML Schema Technology
计算机科学, 2014, 41(1): 254-257.
[13] 郭艳燕,刘惊雷.
UML状态机模型元素的RSL形式化定义
Formalization for Model Element of UML Statechart in RSL
计算机科学, 2013, 40(5): 177-183.
[14] 朱梅霞,武继刚.
MARTE顺序图到TTS4SD的转换
Approach to Transforming MARTS Sequence Diagram to TTS4SD Models
计算机科学, 2013, 40(1): 175-178.
[15] 刘攀峰,邱听夕,陈祥献,黄 海,段会龙.
基于UML的列车自动防护系统需求建模研究
UMI. Based Software Requirement Modeling for Automatic Train Protection
计算机科学, 2012, 39(Z6): 478-481.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!