A formalism to describe design patterns based on role concepts

Design patterns are typically defined imprecisely using natural language descriptions with graphical annotations. It is also common to describe patterns using a concrete design example with implementation details. Several approaches have been proposed to describe design patterns abstractly based on role concepts. However, the notion of role differs in each approach. The behavioral aspects of patterns are not addressed in the role-based approaches. This paper presents a rigorous approach to describe design patterns based on role concepts. Adopting metamodeling and formalism, our work defines an innovative framework where generic pattern concepts based on roles are precisely defined as a formal role metamodel using Object-Z. Individual patterns are specified using these generic role concepts in terms of pattern role models. Temporal behaviors of patterns are also specified using Object-Z and integrated in the pattern role models. Patterns described this way are abstract, separating pattern realization information from the pattern description. They are also precise providing a rigorous foundation for reasoning about pattern properties. This paper also formalizes the properties that must be captured in a class model when a design pattern is deployed. These properties are defined generically in terms of role bindings from a pattern role model to a class model. They provide a precise basis for checking the validity of pattern utilisation in designs. Our work is supported by tools. We have developed an initial role metamodel using an existing modeling framework, Eclipse Modeling Framework (EMF) and have transformed the metamodel to Object-Z using model transformation techniques. Complex constraints are added to the transformed Object-Z model. More importantly, we implement the role metamodel. Using this implementation, pattern authors can develop an initial pattern role model in the same modeling framework and convert the initial model to Object-Z using our transformation rules. The transformed Object-Z model is then enhanced with behavioral features of the pattern. This tool support significantly improves the practicability of applying formalism to design patterns.

[1]  Jean-Marc Jézéquel,et al.  Precise Modeling of Design Patterns , 2000, UML.

[2]  S. J. Goldsack,et al.  Formalising design patterns , 1996, FME 1996.

[3]  Daniel Pak-Kong Lun,et al.  Precise modeling of design patterns in UML , 2004, Proceedings. 26th International Conference on Software Engineering.

[4]  Soon-Kyeong Kim,et al.  A metamodel-based approach to integrate object-oriented graphical and formal specification techniques , 2002 .

[5]  Toufik Taibi,et al.  Formalising design patterns composition , 2006, IEE Proc. Softw..

[6]  Jörn Guy Süß,et al.  MDA-Based re-engineering with object-z , 2006, MoDELS'06.

[7]  Roger Duke,et al.  Formal Object Oriented Specification Using Object-Z , 2000 .

[8]  David A. Carrington,et al.  An MDA Approach Towards Integrating Formal and Informal Modeling Languages , 2005, FM.

[9]  Rolf Adams,et al.  Representing Design Patterns and Frameworks in UML - Towards a Comprehensive Approach , 2002, J. Object Technol..

[10]  Tommi Mikkonen,et al.  Formalizing design patterns , 1998, Proceedings of the 20th International Conference on Software Engineering.

[11]  Peter F. Linington,et al.  Tool support for development using patterns , 2001, Proceedings Fifth IEEE International Enterprise Distributed Object Computing Conference.

[12]  Amnon H. Eden,et al.  LePUS - A Declarative Pattern Specification Language , 2007 .

[13]  Tom Mens,et al.  A declarative evolution framework for object-oriented design patterns , 2001, Proceedings IEEE International Conference on Software Maintenance. ICSM 2001.

[14]  Amnon H. Eden,et al.  Towards a Mathematical Foundation for Design Patterns , 1999 .

[15]  Amnon H. Eden,et al.  A Formal Language for Design Patterns , 2007 .

[16]  Neelam Soundarajan,et al.  Responsibilities and rewards: specifying design patterns , 2004, Proceedings. 26th International Conference on Software Engineering.

[17]  Stuart Kent,et al.  Precise Visual Specification of Design Patterns , 1998, ECOOP.

[18]  Robert B. France,et al.  A UML-based pattern specification technique , 2004, IEEE Transactions on Software Engineering.

[19]  Carlos José Pereira de Lucena,et al.  Extending UML to Improve the Representation of Design Patterns , 2000 .

[20]  David Chek Ling Ngo,et al.  Formal Specification of Design Patterns - A Balanced Approach , 2003, J. Object Technol..

[21]  John Grundy,et al.  Design pattern modelling and instantiation using DPML , 2002 .

[22]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[23]  Andres Flores,et al.  A Formal Model of Object-Oriented Design and GoF Design Patterns , 2001, FME.

[24]  Ian Bayley,et al.  Formalising Design Patterns in Predicate Logic , 2007, Fifth IEEE International Conference on Software Engineering and Formal Methods (SEFM 2007).

[25]  Lionel C. Briand,et al.  A metamodeling approach to pattern specification , 2006, MoDELS'06.

[26]  Petra Malik,et al.  CZT: A Framework for Z Tools , 2005, ZB.

[27]  Zhang Kang,et al.  Visualizing Design Patterns in Their Applications and Compositions , 2007 .

[28]  Dirk Riehle Describing and Composing Patterns Using Role Diagrams , 1996 .