Precise Specification of Design Pattern Structure and Behaviour

  • Ashley Sterritt
  • Siobhán Clarke
  • Vinny Cahill
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6138)


Applying design patterns while developing a software system can improve its non-functional properties, such as extensibility and loose coupling. Precise specification of structure and behaviour communicates the invariants imposed by a pattern on a conforming implementation and enables formal software verification. Many existing design-pattern specification languages (DPSLs) focus on class structure alone, while those that do address behaviour suffer from a lack of expressiveness and/or imprecise semantics. In particular, in a review of existing work, three invariant categories were found to be inexpressible in state-of-the-art DPSLs: dependency, object state and data-structure. This paper presents Alas: a precise specification language that supports design-pattern descriptions including these invariant categories. The language is based on UML Class and Sequence diagrams with modified syntax and semantics. In this paper, the meaning of the presented invariants is formalized and relevant ambiguities in the UML Standard are clarified. We have evaluated Alas by specifying the widely-used Gang of Four pattern catalog and identified patterns that benefitted from the added expressiveness and semantics of Alas.


Design Pattern Sequence Diagram Object Constraint Language Object Constraint Language Expression Cardinality Invariant 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)Google Scholar
  2. 2.
    Le Guennec, A., Sunyé, G., Jézéquel, J.: Precise Modeling of Design Patterns. In: Evans, A., Kent, S., Selic, B. (eds.) UML 2000. LNCS, vol. 1939, pp. 482–496. Springer, Heidelberg (2000)Google Scholar
  3. 3.
    Object Management Group: Object Constraint Language, Version 2.0 (2006),
  4. 4.
    Helm, R., Holland, I.M., Gangopadhyay, D.: Contracts: Specifying Behavioral Compositions in Object-Oriented Systems. SIGPLAN Not. 25(10), 169–180 (1990)CrossRefGoogle Scholar
  5. 5.
    Object Management Group: Unified Modeling Language: Superstructure (2009),
  6. 6.
    Eden, A.H.: Formal Specification of Object-Oriented Design. In: Proceedings of the International Conference on Multidisciplinary Design in Engineering (2001)Google Scholar
  7. 7.
    Mak, J.K.H., Choy, C.S.T., Lun, D.P.K.: Precise Modeling of Design Patterns in UML. In: ICSE 2004, Washington, DC, USA, pp. 252–261. IEEE Computer Society, Los Alamitos (2004)Google Scholar
  8. 8.
    Lauder, A., Kent, S.: Precise Visual Specification of Design Patterns. In: ECOOP 1998: Proceedings of the 12th European Conference on Object-Oriented Programming, London, UK, pp. 114–134. Springer, Heidelberg (1998)Google Scholar
  9. 9.
    Flores, A., Cechich, A., Aranda, G.: A Generic Model of Object-Oriented Patterns Specified in RSL, pp. 44–72. IGI Publishing (2007)Google Scholar
  10. 10.
    Lano, K., Bicarregui, J., Goldsack, S.: Formalising Design Patterns. In: RBCS-FACS Northern Formal Methods Workshop (1996)Google Scholar
  11. 11.
    Taibi, T., Ngo, D.C.L.: Formal Specification of Design Patterns - A Balanced Approach. Journal of Object Technology 2(4), 127–140 (2003)Google Scholar
  12. 12.
    Dong, J., Alencar, P., Cowan, D.: Formal Specification and Verification of Design Patterns, pp. 94–108. IGI Publishing (2007)Google Scholar
  13. 13.
    France, R.B., Kim, D.K., Ghosh, S., Song, E.: A UML-Based Pattern Specification Technique. IEEE Transactions on Software Engineering 30(3), 193–206 (2004)CrossRefGoogle Scholar
  14. 14.
    Wendehals, L., Orso, A.: Recognizing Behavioral Patterns at Runtime using Finite Automata. In: WODA 2006: Proceedings of the 2006 international workshop on Dynamic systems analysis, pp. 33–40. ACM, New York (2006)CrossRefGoogle Scholar
  15. 15.
    Demuth, B., Wilke, C.: Model and Object Verification by Using Dresden OCL. In: Proceedings of the Russian-German Workshop Innovation Information Technologies: theory and practice, Ufa, Russia, July 25-31 (2009)Google Scholar
  16. 16.
    Dwyer, M., Hatcliff, J., Howell, R.: Lecture 14: Advanced OCL Expressions, Kansas State University (2001)Google Scholar
  17. 17.
    Lund, M.S., Stølen, K.: A Fully General Operational Semantics for UML 2.0 Sequence Diagrams with Potential and Mandatory Choice. In: Misra, J., Nipkow, T., Sekerinski, E. (eds.) FM 2006. LNCS, vol. 4085. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  18. 18.
    Sagiv, M., Reps, T., Wilhelm, R.: Parametric Shape Analysis via 3-Valued Logic. ACM Transactions on Programming Languages and Systems 24(3), 217–298 (2002)CrossRefGoogle Scholar
  19. 19.
    Berdine, J., Calcagno, C., Cook, B., Distefano, D., OHearn, P.W., Wies, T., Yang, H.: Shape Analysis for Composite Data Structures. In: Computer Aided Verification (2007)Google Scholar
  20. 20.
    Clarke, D.G., Potter, J.M., Noble, J.: Ownership Types for Flexible Alias Protection. SIGPLAN Not. 33(10), 48–64 (1998)CrossRefGoogle Scholar
  21. 21.
    Damm, W., Harel, D.: LSCs: Breathing Life into Message Sequence Charts. In: Formal Methods in System Design, pp. 293–312. Kluwer Academic Publishers, Dordrecht (1998)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Ashley Sterritt
    • 1
  • Siobhán Clarke
    • 1
  • Vinny Cahill
    • 1
  1. 1.Lero@TCD, Distributed Systems GroupTrinity College Dublin 

Personalised recommendations