计算机科学 ›› 2020, Vol. 47 ›› Issue (3): 19-24.doi: 10.11896/jsjkx.190100046
所属专题: 智能软件工程
纪程宇,朱雪峰
JI Cheng-yu,ZHU Xue-feng
摘要: 作为软件设计经验的总结,恰当使用设计模式能够有效提高软件系统的可复用性,确保最终所得软件产品的质量。但在实际应用中,人们很少使用单一的设计模式,通常需要根据实际的应用场景进行多个模式的组合,这可能会导致所得结果不确定,严重影响软件产品的质量。虽然现有的模式组合形式化方法能够有效地表达模式组合后的结果,但是组合方法逻辑复杂并包含大量的冗余操作,设计人员很难熟练使用。针对上述模式组合过程中存在的问题,文中对多模式之间的组合关系进行了深入探讨,从设计模式的形式化描述出发,结合Z语言的特点对现有的模式组合形式化方法进行了深入研究,并对现有的模式组合操作符进行了初步优化;在现有操作符集合的基础上提出了基于模式的约束、叠加和扩展操作符,通过操作符定义了模式组合的精确语义,并采用代数推理过程验证了优化后的方法可以有效地替代现有的模式组合形式化方法,且能够解决现有模式组合形式化方法中操作符冗余、数量过多导致的效率低等问题。最后,通过模式组合案例的研究,验证了所提方法的有效性。
中图分类号:
[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. |
|