Skip to main content
Log in

A formalism to describe design patterns based on role concepts

  • Original Article
  • Published:
Formal Aspects of Computing

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. 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

  2. Budinsky F, Steinberg D, Merks E, Eliersick R, Grose TJ (2003) The Eclipse Modeling Framework. Addison Wesley, Reading, MA, USA

    Google Scholar 

  3. Dong J, Yang S, Zhang K (2007) Visualizing Design Patterns in Their Applications and Compositions. IEEE Trans Softw Eng 33(7): 433–453

    Article  Google Scholar 

  4. Duke R, Rose G (2002) Formal Object-Oriented Specification Using Object-Z. Macmillan, NY, USA

    Google Scholar 

  5. Maged E, Briand1 L, Labiche1 Y (2006) A metamodeling approach to pattern specification. In: Proc. MoDELS2006, LNCS 4199, pp 484–498

  6. Eclipse UML: http://www.eclipsedownload.com/index.html/

  7. 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

  8. 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/

  9. 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

  10. France R, Kim D-K, Sudipto G, Song E (2004) A UML-based pattern specification technique. IEEE Trans Softw Eng 30(3): 193–206

    Article  Google Scholar 

  11. Fontoura M, Lucena C (2001) Extending UML to improve the representation of design patterns. J Object-Oriented Program 13(11): 12–19

    Google Scholar 

  12. Flores A, Reynoso L, Moore R (2000) A formal model of object-oriented design and GoF patterns, UNU/IIST Report No.200

  13. Gamma E, Helm R, Johnson R, Vlissides J (1995) Design patterns: elements of reusable object-oriented software. Addison Wesley, Reading, MA,USA

    Google Scholar 

  14. Guennec A, Sunye G, Jezequel J (2000) Precise modeling of design patterns. In: Proc. UML 2000, LNCS 1939, pp 482–496

  15. 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

  16. Kim S-K (2002) A metamodel-based approach to integrate object-oriented graphical and formal specification techniques. PhD thesis, ITEE, The University of Queensland

  17. Lauder A, Kent S (1998) Precise visual specification of design patterns. In: Proc. ECOOP 98, LNCS 1445, pp 114–134

  18. Lano K, Goldsack S, Bicarrehui J (1996) Formalizing design patterns. In: Proc. BCS-FACS. http://www1.bcs.org.uk/DocsRepository/02700/2790/lano.pdf

  19. 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

  20. Mak J, Choy C, Lun D (2004) Precise modeling of design patterns in UML. In: Proc. ICSE’04, pp 252–261

  21. 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

  22. Mapelsden D, Hosking J, Grundy J (2002) Design pattern modelling and instantiation using DPML. In: Proc. TOOLS Pacific, pp 3–11

  23. Mikkonen T (1998) Formalizing design patterns. In: Proc. ICSE’98, pp 115–124

  24. Neal S, Linington P (2001) Tool support for development using patterns. In: Proceedings of the international enterprise distributed object computing, pp 237–248

  25. Riehle D (1996) Describing and composing patterns using role diagrams. In: Proc. Ubilab Conference, pp 137–152

  26. Sanada Y, Adams R (2002) Representing design patterns and frameworks in uml—towards a comprehensive approach. J Obj Technol 2: 143–154

    Google Scholar 

  27. 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

  28. Soundarajan N, Hallstrom J (2004) Responsibilities and rewards: specifying design patterns. In: Proc. ICSE’04, pp 666–675

  29. Taibi T (2006) Formalising design patterns composition. Software. IEE Proceedings 153(3): 126–153

    Google Scholar 

  30. Tefkat—The EMF Transformation Engine. http://tefkat.sourceforge.net/. Visited 30 October 20007

  31. Taibi T, Ngo D (2003) Formal specification of design patterns—a balanced approach. J Object-Oriented Program 2(4): 128–140

    Google Scholar 

  32. OMG, UML 2.0 superstructure specification. http://www.omg.org/uml/

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Soon-Kyeong Kim.

Additional information

M. J. Butler

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00165-008-0090-7

Keywords

Navigation