A formalism to describe design patterns based on role concepts
Authors:
Open Access
- 1 October 2009
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Formal Aspects of Computing
- Vol. 21 (5) , 397-420
Abstract
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.Keywords
This publication has 16 references indexed in Scilit:
- Formalising design patterns compositionIEE Proceedings - Software, 2006
- A Metamodeling Approach to Pattern Specification2006
- MDA-Based Re-engineering with Object-Z2006
- CZT: A Framework for Z ToolsLecture Notes in Computer Science, 2005
- An MDA Approach Towards Integrating Formal and Informal Modeling LanguagesLecture Notes in Computer Science, 2005
- A UML-based pattern specification techniqueIEEE Transactions on Software Engineering, 2004
- Representing Design Patterns and Frameworks in UML - Towards a Comprehensive Approach.The Journal of Object Technology, 2002
- A Formal Model of Object-Oriented Design and GoF Design Patterns2001
- Precise Modeling of Design Patterns2000
- Precise visual specification of design patterns1998