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.
Similar content being viewed by others
References
Bayley I, Zhu H (2007) Formalising design patterns in predicate logic. In: Proceedings of the 5th IEEE international conference on software engineering and formal methods, pp 25–36
Budinsky F, Steinberg D, Merks E, Eliersick R, Grose TJ (2003) The Eclipse Modeling Framework. Addison Wesley, Reading, MA, USA
Dong J, Yang S, Zhang K (2007) Visualizing Design Patterns in Their Applications and Compositions. IEEE Trans Softw Eng 33(7): 433–453
Duke R, Rose G (2002) Formal Object-Oriented Specification Using Object-Z. Macmillan, NY, USA
Maged E, Briand1 L, Labiche1 Y (2006) A metamodeling approach to pattern specification. In: Proc. MoDELS2006, LNCS 4199, pp 484–498
Eclipse UML: http://www.eclipsedownload.com/index.html/
Eden A, Gil J, Hirshfeld Y, Yehudai A (1999) Towards a mathematical foundation for design patterns, technical report 1999-004. Department of Information Technology, Uppsala University
Eden A, Gil J, Yehudai A (1996) A formal language for design patterns. In: The 3rd Annual Conference on the Pattern Languages of Programs—PloP, 1996. http://www.cs.concordia.ca/~faculty/eden/precise_and_formal/
Eden A, Hirshfeld Y, Yehudai A (1998) LePUS—a declarative pattern specification language. Technical report 326/98, Department of Computer Science, Tel Aviv University. http://www.math.tau.ac.il/~eden/bibliography.html#lepus
France R, Kim D-K, Sudipto G, Song E (2004) A UML-based pattern specification technique. IEEE Trans Softw Eng 30(3): 193–206
Fontoura M, Lucena C (2001) Extending UML to improve the representation of design patterns. J Object-Oriented Program 13(11): 12–19
Flores A, Reynoso L, Moore R (2000) A formal model of object-oriented design and GoF patterns, UNU/IIST Report No.200
Gamma E, Helm R, Johnson R, Vlissides J (1995) Design patterns: elements of reusable object-oriented software. Addison Wesley, Reading, MA,USA
Guennec A, Sunye G, Jezequel J (2000) Precise modeling of design patterns. In: Proc. UML 2000, LNCS 1939, pp 482–496
Kim S-K, Burger D, Carrington D (2005) An MDA approach towards integrating formal and informal modeling languages. Formal Methods, LNCS 3582, pp 448–464
Kim S-K (2002) A metamodel-based approach to integrate object-oriented graphical and formal specification techniques. PhD thesis, ITEE, The University of Queensland
Lauder A, Kent S (1998) Precise visual specification of design patterns. In: Proc. ECOOP 98, LNCS 1445, pp 114–134
Lano K, Goldsack S, Bicarrehui J (1996) Formalizing design patterns. In: Proc. BCS-FACS. http://www1.bcs.org.uk/DocsRepository/02700/2790/lano.pdf
Malik P, Utting M (2005) CZT: A framework for Z tools. In: Proceedings of the 4th international conference of B and Z users, LNCS 3455, pp 65–84
Mak J, Choy C, Lun D (2004) Precise modeling of design patterns in UML. In: Proc. ICSE’04, pp 252–261
Mens T, Tourwe T (2001) A declarative evolution framework for object-oriented design patterns. In: Proceedings of the international conference on software maintenance, pp 570–579
Mapelsden D, Hosking J, Grundy J (2002) Design pattern modelling and instantiation using DPML. In: Proc. TOOLS Pacific, pp 3–11
Mikkonen T (1998) Formalizing design patterns. In: Proc. ICSE’98, pp 115–124
Neal S, Linington P (2001) Tool support for development using patterns. In: Proceedings of the international enterprise distributed object computing, pp 237–248
Riehle D (1996) Describing and composing patterns using role diagrams. In: Proc. Ubilab Conference, pp 137–152
Sanada Y, Adams R (2002) Representing design patterns and frameworks in uml—towards a comprehensive approach. J Obj Technol 2: 143–154
Süß JG, McComb T, Kim SK, Wildman L, Watson G (2006) MDA-based re-engineering with object-Z. In: MoDELS 2006. Volume 4199 of LNCS, pp 291–305
Soundarajan N, Hallstrom J (2004) Responsibilities and rewards: specifying design patterns. In: Proc. ICSE’04, pp 666–675
Taibi T (2006) Formalising design patterns composition. Software. IEE Proceedings 153(3): 126–153
Tefkat—The EMF Transformation Engine. http://tefkat.sourceforge.net/. Visited 30 October 20007
Taibi T, Ngo D (2003) Formal specification of design patterns—a balanced approach. J Object-Oriented Program 2(4): 128–140
OMG, UML 2.0 superstructure specification. http://www.omg.org/uml/
Author information
Authors and Affiliations
Corresponding author
Additional information
M. J. Butler
Rights and permissions
About this article
Cite this article
Kim, SK., Carrington, D. A formalism to describe design patterns based on role concepts. Form Asp Comp 21, 397–420 (2009). https://doi.org/10.1007/s00165-008-0090-7
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00165-008-0090-7