skip to main content
research-article

An algebra of design patterns

Published:30 July 2013Publication History
Skip Abstract Section

Abstract

In a pattern-oriented software design process, design decisions are made by selecting and instantiating appropriate patterns, and composing them together. In our previous work, we enabled these decisions to be formalized by defining a set of operators on patterns with which instantiations and compositions can be represented. In this article, we investigate the algebraic properties of these operators. We provide and prove a complete set of algebraic laws so that equivalence between pattern expressions can be proven. Furthermore, we define an always-terminating normalization of pattern expression to a canonical form which is unique modulo equivalence in first-order logic.

By a case study, the pattern-oriented design of an extensible request-handling framework, we demonstrate two practical applications of the algebraic framework. First, we can prove the correctness of a finished design with respect to the design decisions made and the formal specification of the patterns. Second, we can even derive the design from these components.

References

  1. Alencar, P. S. C., Cowan, D. D., and De Lucena, C. J. P. 1996. A formal approach to architectural design patterns. In Proceedings of the 3rd International Symposium of Formal Methods Europe on Industrial Benefit and Advances in Formal Methods (FME'96). Springer, 576--594. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Alur, D., Crupi, J., and Malks, D. 2003. Core J2EE Patterns: Best Practices and Design Strategies, 2nd Ed. Prentice Hall. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Bayley, I. and Zhu, H. 2007. Formalising design patterns in predicate logic. In Proceedings of the 5th IEEE International Conference on Software Engineering and Formal Methods. IEEE Computer Society, 25--36. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bayley, I. and Zhu, H. 2008a. On the composition of design patterns. In Proceedings of the 8th International Conference on Quality Software (QSIC'08). IEEE Computer Society, 27--36. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Bayley, I. and Zhu, H. 2008b. Specifying behavioural features of design patterns in first order logic. In Proceedings of the 32nd IEEE International Conference on Computer Software and Applications (COMPSAC'08). IEEE Computer Society, 203--210. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Bayley, I. and Zhu, H. 2010a. A formal language of pattern composition. In Proceedings of the 2nd International Conference on Pervasive Patterns (PATTERNS'10). Xpert Publishing Services, 1--6.Google ScholarGoogle Scholar
  7. Bayley, I. and Zhu, H. 2010b. Formal specification of the variants and behavioural features of design patterns. J. Syst. Softw. 83, 2, 209--221. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Bayley, I. and Zhu, H. 2011. A formal language for the expression of pattern compositions. Int. J. Adv. Softw. 4, 3-4, 354--366.Google ScholarGoogle Scholar
  9. Blewitt, A., Bundy, A., and Stark, I. 2005. Automatic verification of design patterns in Java. In Proceedings of the 20th IEEE/ACM International Conference on Automated Software Engineering (ASE'05). ACM Press, New York, 224--232. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Buschmann, F., Henney, K., and Schmidt, D. C. 2007a. Pattern-Oriented Software Archiecture: On Patterns and Pattern Languages. Vol. 5, John Wiley and Sons Ltd. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Buschmann, F., Henney, K., and Schmidt, D. C. 2007b. Pattern-Oriented Software Architecture: A Pattern Language for Distributed Computing. Vol. 4, John Wiley and Sons Ltd. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Dipippo, L. and Gill, C. D. 2005. Design Patterns for Distributed Real-Time Systems. Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Dong, J., Alencar, P. S., and Cowan, D. D. 2000. Ensuring structure and behavior correctness in design composition. In Proceedings of the IEEE 7th Annual International Conference and Workshop on Engineering Computer Based Systems (ECBS'00). IEEE, 279--287.Google ScholarGoogle Scholar
  14. Dong, J., Alencar, P. S., Cowan, D. D., and Yang, S. 2007a. Composing pattern-based components and verifying correctness. J. Syst. Softw. 80, 11, 1755--1769. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Dong, J., Alencar, P. S., and Cowan, D. D. 1999. Correct composition of design components. In Proceedings of the 4th International Workshop on Component-Oriented Programming in Conjunction with the European Conference on Object-Oriented Programming (ECOOP'99). Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Dong, J., Peng, T., and Zhao, Y. 2010. Automated verification of security pattern compositions. Inf. Softw. Technol. 52, 3, 274C295. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Dong, J., Peng, T., and Zhao, Y. 2011. On instantiation and integration commutability of design pattern. Comput. J. 54, 1, 164--184. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Dong, J., Alencar, P. S., and Cowan, D. D. 2004. A behavioral analysis and verification approach to pattern-based design composition. Softw. Syst. Model. 3, 262--272.Google ScholarGoogle Scholar
  19. Dong, J., Yang, S., and Zhang, K. 2007b. Visualizing design patterns in their applications and compositions. IEEE Trans. Softw. Engin. 33, 7, 433--453. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Dong, J., Zhao, Y., and Peng, T. 2007c. Architecture and design pattern discovery techniques - A review. In Proceedings of the International Conference on Software Engineering Research and Practice (SERP'07). Vol. II, CSREA Press, 621--627.Google ScholarGoogle Scholar
  21. Douglass, B. P. 2002. Real Time Design Patterns: Robust Scalable Architecture for Real-Time Systems. Addison Wesley, Boston, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Eden, A. H. 2001. Formal specification of object-oriented design. In proceedings of the International Conference on Multidisciplinary Design in Engineering.Google ScholarGoogle Scholar
  23. Fowler, M. 2003. Patterns of Enterprise Application Architecture. Addison Wesley, Boston, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. France, R. B., Kim, D.-K., Ghosh, S., and Song, E. 2004. A UML-based pattern specification technique. IEEE Trans. Softw. Engin. 30, 3, 193--206. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Gamma, E., Helm, R., Johnson, R., and Vlissides, J. 1995. Design Patterns - Elements of Reusable Object-Oriented Software. Addison-Wesley, Boston, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Gasparis, E., Eden, A. H., Nicholson, J., and Kazman, R. 2008. The design navigator: Charting Java programs. In Proceedings of the Companion of the 30th International Conference on Software Engineering (ICSE Companion'08). 945--946. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Grand, M. 1999. Patterns in Java. Vol. 2, John Wiley and Sons, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Grand, M. 2002a. Java Enterprise Design Patterns. John Wiley and Sons, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Grand, M. 2002b. Patterns in Java: A Catalog of Reusable Design Patterns Illustrated with UML. Vol. 1. John Wiley and Sons, New York. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Hanmer, R. S. 2007. Patterns for Fault Tolerant Software. Wiley, West Sussex, UK. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Hohpe, G. and Woolf, B. 2004. Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions. Addison Wesley, Boston, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Hou, D. and Hoover, H. J. 2006. Using SCL to specify and check design intent in source code. IEEE Trans. Softw. Engin. 32, 6, 404--423. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Kim, D.-K. and Lu, L. 2006. Inference of design pattern instances in UML models via logic programming. In Proceedings of the 11th International Conference on Engineering of Complex Computer Systems (ICECCS'06). IEEE Computer Society, 47--56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Kim, D.-K. and Shen, W. 2007. An approach to evaluating structural pattern conformance of UML models. In Proceedings of the ACM Symposium on Applied Computing (SAC'07). ACM Press, New York, 1404--1408. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Kim, D.-K. and Shen, W. 2008. Evaluating pattern conformance of UML models: A divide-and-conquer approach and case studies. Softw. Qual. J. 16, 3, 329--359. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Lano, K., Bicarregui, J. C., and Goldsack, S. 1996. Formalising design patterns. In Proceedings of the BCS-FACS Northern Formal Methods Workshop. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Lauder, A. and Kent, S. 1998. Precise visual specification of design patterns. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP'99). Lecture Notes in Computer Science, vol. 1445. Springer, 114--134. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Mapelsden, D., Hosking, J., and Grundy, J. 2002. Design pattern modeling and instantiation using DPML. In Proceedings of the 40th International Conference on Tools Pacific (CRPIT'02). Australian Computer Society, 3--11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Mikkonen, T. 1998. Formalizing design patterns. In Proceedings of the 20th International Conference on Software Engineering (ICSE'98). IEEE Computer Society, 115--124. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Niere, J., Schafer, W., Wadsack, J. P., Wendehals, L., and Welsh, J. 2002. Towards pattern-based design recovery. In Proceedings of the 22nd International Conference on Software Engineering (ICSE'02). IEEE Computer Society, 338--348. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Nija Shi, N. and Olsson, R. 2006. Reverse engineering of design patterns from Java source code. In Proceedings of the 21st IEEE/ACM International Conference on Automated Software Engineering (ASE'06). IEEE Computer Society, 123--134. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Riehle, D. 1997. Composite design patterns. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA'97). ACM Press, New York, 218--228. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Schumacher, M., Fernandez, E., Hybertson, D., and Buschmann, F. 2005. Security Patterns: Integrating Security and Systems Engineering. John Wiley and Sons Ltd, West Sussex, UK. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Smith, J. M. 2011. The pattern instance notation: A simple hierarchical visual notation for the dynamic visualization and comprehension of software patterns. J. Vis. Lang. Comput. 22, 5, 355--374.Google ScholarGoogle ScholarCross RefCross Ref
  45. Steel, C. 2005. Applied J2EE Security Patterns: Architectural Patterns and Best Practices. Prentice Hall PTR, Upper Saddle River, NJ. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Taibi, T. 2006. Formalising design patterns composition. Softw. IEE Proc. 153, 3, 126--153.Google ScholarGoogle ScholarCross RefCross Ref
  47. Taibi, T., Check, D., and Ngo, L. 2003. Formal specification of design patterns-A balanced approach. J. Object Technol. 2, 4.Google ScholarGoogle ScholarCross RefCross Ref
  48. Taibi, T. and Ngo, D. C. L. 2003. Formal specification of design pattern combination using BPSL. Inf. Softw. Technol. 45, 3, 157--170.Google ScholarGoogle ScholarCross RefCross Ref
  49. Vlissides, J. 1998. Notation, notation, notation. C++ Report.Google ScholarGoogle Scholar
  50. Voelter, M., Kircher, M., and Zdun, U. 2004. Remoting Patterns. John Wiley and Sons, West Sussex, UK.Google ScholarGoogle Scholar
  51. Zhu, H. 2010. On the theoretical foundation of meta-modelling in graphically extended BNF and first order logic. In Proceedings of the 4th IEEE Symposium on Theoretical Aspects of Software Engineering (TASE'10). IEEE Computer Society, 95--104. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Zhu, H. 2012. An institution theory of formal meta-modelling in graphically extended BNF. Frontier Comput. Sci. 6, 1, 40--56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Zhu, H. and Bayley, I. 2010. Laws of pattern composition. In Proceedings of 12th International Conference on Formal Engineering Methods (ICFEM'10). Lecture Notes in Computer Science, vol. 6447, Springer, 630--645. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Zhu, H., Bayley, I., Shan, L., and Amphlett, R. 2009a. Tool support for design pattern recognition at model level. In Proceedings of the 33rd Annual IEEE International Conference on Computer Software and Applications (COMPSAC'09). IEEE Computer Society, 228--233. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Zhu, H. and Shan, L. 2006. Well-formedness, consistency and completeness of graphic models. In Proceedings of the 9th International Conference on Computer Modeling and Simulation (UKSIM'06). United Kingdom Simulation Society, 47--53.Google ScholarGoogle Scholar
  56. Zhu, H., Shan, L., Bayley, I., and Amphlett, R. 2009b. A formal descriptive semantics of UML and its applications. In UML 2 Semantics and Applications, K. Lano, Ed. John Wiley and Sons.Google ScholarGoogle Scholar

Index Terms

  1. An algebra of design patterns

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM Transactions on Software Engineering and Methodology
          ACM Transactions on Software Engineering and Methodology  Volume 22, Issue 3
          In memoriam, fault detection and localization, formal methods, modeling and design
          July 2013
          414 pages
          ISSN:1049-331X
          EISSN:1557-7392
          DOI:10.1145/2491509
          Issue’s Table of Contents

          Copyright © 2013 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 30 July 2013
          • Accepted: 1 May 2012
          • Revised: 1 April 2012
          • Received: 1 December 2011
          Published in tosem Volume 22, Issue 3

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article
          • Research
          • Refereed

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader