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.
- 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 ScholarDigital Library
- Alur, D., Crupi, J., and Malks, D. 2003. Core J2EE Patterns: Best Practices and Design Strategies, 2nd Ed. Prentice Hall. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Dipippo, L. and Gill, C. D. 2005. Design Patterns for Distributed Real-Time Systems. Springer. Google ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Dong, J., Peng, T., and Zhao, Y. 2010. Automated verification of security pattern compositions. Inf. Softw. Technol. 52, 3, 274C295. Google ScholarDigital Library
- Dong, J., Peng, T., and Zhao, Y. 2011. On instantiation and integration commutability of design pattern. Comput. J. 54, 1, 164--184. Google ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 Scholar
- Douglass, B. P. 2002. Real Time Design Patterns: Robust Scalable Architecture for Real-Time Systems. Addison Wesley, Boston, MA. Google ScholarDigital Library
- Eden, A. H. 2001. Formal specification of object-oriented design. In proceedings of the International Conference on Multidisciplinary Design in Engineering.Google Scholar
- Fowler, M. 2003. Patterns of Enterprise Application Architecture. Addison Wesley, Boston, MA. Google ScholarDigital Library
- 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 ScholarDigital Library
- Gamma, E., Helm, R., Johnson, R., and Vlissides, J. 1995. Design Patterns - Elements of Reusable Object-Oriented Software. Addison-Wesley, Boston, MA. Google ScholarDigital Library
- 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 ScholarDigital Library
- Grand, M. 1999. Patterns in Java. Vol. 2, John Wiley and Sons, New York. Google ScholarDigital Library
- Grand, M. 2002a. Java Enterprise Design Patterns. John Wiley and Sons, New York. Google ScholarDigital Library
- Grand, M. 2002b. Patterns in Java: A Catalog of Reusable Design Patterns Illustrated with UML. Vol. 1. John Wiley and Sons, New York. Google ScholarDigital Library
- Hanmer, R. S. 2007. Patterns for Fault Tolerant Software. Wiley, West Sussex, UK. Google ScholarDigital Library
- Hohpe, G. and Woolf, B. 2004. Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions. Addison Wesley, Boston, MA. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Lano, K., Bicarregui, J. C., and Goldsack, S. 1996. Formalising design patterns. In Proceedings of the BCS-FACS Northern Formal Methods Workshop. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Mikkonen, T. 1998. Formalizing design patterns. In Proceedings of the 20th International Conference on Software Engineering (ICSE'98). IEEE Computer Society, 115--124. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- Steel, C. 2005. Applied J2EE Security Patterns: Architectural Patterns and Best Practices. Prentice Hall PTR, Upper Saddle River, NJ. Google ScholarDigital Library
- Taibi, T. 2006. Formalising design patterns composition. Softw. IEE Proc. 153, 3, 126--153.Google ScholarCross Ref
- Taibi, T., Check, D., and Ngo, L. 2003. Formal specification of design patterns-A balanced approach. J. Object Technol. 2, 4.Google ScholarCross Ref
- Taibi, T. and Ngo, D. C. L. 2003. Formal specification of design pattern combination using BPSL. Inf. Softw. Technol. 45, 3, 157--170.Google ScholarCross Ref
- Vlissides, J. 1998. Notation, notation, notation. C++ Report.Google Scholar
- Voelter, M., Kircher, M., and Zdun, U. 2004. Remoting Patterns. John Wiley and Sons, West Sussex, UK.Google Scholar
- 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 ScholarDigital Library
- Zhu, H. 2012. An institution theory of formal meta-modelling in graphically extended BNF. Frontier Comput. Sci. 6, 1, 40--56. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 Scholar
Index Terms
- An algebra of design patterns
Recommendations
On the Composability of Design Patterns
In real applications, design patterns are almost always to be found composed with each other. It is crucial that these compositions be validated. This paper examines the notion of validity, and develops a formal method for proving or disproving it, in a ...
Laws of pattern composition
ICFEM'10: Proceedings of the 12th international conference on Formal engineering methods and software engineeringDesign patterns are rarely used on their own. They are almost always to be found composed with each other in real applications. So it is crucial that we can reason about their compositions. In our previous work, we defined a set of operators on patterns ...
Kleene algebra with domain
We propose Kleene algebra with domain (KAD), an extension of Kleene algebra by simple equational axioms for a domain and a codomain operation. KAD considerably augments the expressiveness of Kleene algebra, in particular for the specification and ...
Comments