skip to main content
10.1145/1640089.1640125acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Design pattern density defined

Published:25 October 2009Publication History

ABSTRACT

Design pattern density is a metric that measures how much of an object-oriented design can be understood and represented as instances of design patterns. Expert developers have long believed that a high design pattern density implies a high maturity of the design under inspection. This paper presents a quantifiable and observable definition of this metric. The metric is illustrated and qualitatively validated using four real-world case studies. We present several hypotheses of the metric's meaning and their implications, including the one about design maturity. We propose that the design pattern density of a maturing framework has a fixed point and we show that if software design patterns make learning frameworks easier, a framework's design pattern density is a measure of how much easier it will become.

References

  1. Kent Beck and Erich Gamma. JUnit: A Cook's Tour. Available from http://junit.sourceforge.net/doc/cookstour/cooks-tour.htmGoogle ScholarGoogle Scholar
  2. Rebecca Wirfs-Brock and Brian Wilkerson. "Object-Oriented Design: A Responsibility-Driven Approach." In Proceedings of the 1989 Conference on Object-Oriented Program--ming, Systems, Languages and Applications (OOPSLA '89). ACM Press, 1989: Pages 71--75. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Rebecca Wirks-Brock, Brian Wilkerson, and Lauren Wiener. Designing Object-Oriented Software. Prentice Hall, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Trygve Reenskaug, Per Wold, and O.A. Lehne. Working with Objects: The OOram Software Engineering Method. Prentice Hall, 1996.Google ScholarGoogle Scholar
  5. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. David Garlan and Mary Shaw. An Introduction to Software Architecture. Prentice Hall, 1994.Google ScholarGoogle Scholar
  7. James O. Coplien. Advanced C++ Programming Styles and Idioms. Addison Wesley, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Ralph Johnson, John Vlissides. Personal Email Communication, 2002.Google ScholarGoogle Scholar
  9. Dirk Riehle. A Role-Based Design Pattern Catalog of Atomic and Composite Patterns Structured by Pattern Purpose. Ubilab Technical Report 97.1.1. Zurich: UBS AG, 1997.Google ScholarGoogle Scholar
  10. Dirk Riehle, Roger Brudermann, Thomas Gross, and Kai-Uwe Mätzel. "Pattern Density and Role Modeling of an Object Transport Service." ACM Computing Surveys 32, 1es (March 2000): Article No. 10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Dirk Riehle. "Composite Design Patterns." In Proceedings of the 1997 Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA '97). ACM Press, 1997: Pages 218--228. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. The Object Management Group (OMG). UML 2.x Specification. OMG, 2007. See http://www.uml.org.Google ScholarGoogle Scholar
  13. Dirk Riehle. Framework Design: A Role Modeling Approach. Ph.D. Thesis, No. 13509. ETH Zürich, 2000.Google ScholarGoogle Scholar
  14. Dirk Riehle. JUnit 3.8 Documented Using Collaborations. In Software Engineering Notes Volume 33, Issue 2 (March 2008), Article No. 5. ACM Press, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Bertrand Meyer. Object-Oriented Software Construction. Prentice Hall, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Erich Gamma. Advanced Design with Java and Patterns. Tutorial held at the 1998 JAOO Conference. Available from http://www.riehle.org/blogs/research/2007/2007-01-03.htmlGoogle ScholarGoogle Scholar
  17. Kent Beck and Erich Gamma. JHotDraw-Patterns Applied. Tutorial held at the 1997 Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '97). ACM Press, 1997.Google ScholarGoogle Scholar
  18. Joseph (Yossi) Gil and Itay Maman. "Micro Patterns in Java Code." In Proceedings of the 2005 Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA '05). ACM Press, 2005: Pages 97--116. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Uwe Zdun and Paris Avgeriou. "Modeling Architectural Patterns Using Architectural Primitives." In Proceedings of the 2005 Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '05). ACM Press, 2005: Pages 133--146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Brian Henderson-Sellers. Object-Oriented Metrics: Measures of Complexity. Prentice-Hall, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Sandeep Puraoand Vijay Vaishnavi. "Product Metrics for Object-Oriented Systems." ACM Computing Surveys Vol. 35, No 2 (June 2003). ACM Press: Pages 191--221. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Cara Stein, Letha Etzkorn, and Dawn Utley. "Computing Software Metrics from Design Documents." In Proceedings of the 2004 ACM South East Conference (ACMSE '04). ACM Press, 2004: Pages 146--151. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Letha Etzkorn and H Delugach. "Towards a Semantic Metrics Suite for Object-Oriented Design." In Proceedings of the 34th International Conference on Technology of Object-Oriented Languages and Systems (TOOLS 2000). Pages: 71--80. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Joshua Kerievsky. Refactoring to Patterns. Addison-Wesley, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Serge Demeyer. Stéphane Ducasse, and Oscar Nierstrasz. "Finding Refactorings via Change Metrics." In Proceedings of the 15th Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2000). ACM Press, 2000: Pages: 166--177. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Christian Krämer and Lutz Prechelt. "Design Recovery by Automated Search for Structural Design Patterns in Object-Oriented Software." In Proceedings of the Working Conference on Reverse Engineering. IEEE Press, 1996: Pages 208--215. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Nathanael Schärli, Stéphane Ducasse, Oscar Nierstrasz and Andrew Black. "Traits: Composable Units of Behavior." In Proceedings of the European Conference on Object-Oriented Programming (ECOOP '03). Springer Verlag, 2003: Pages 248--274.Google ScholarGoogle Scholar
  28. Harold Ossher, Matthew Kaplan, William Harrison, Alexander Katz and Vincent Kruskal. "Subject-Oriented Composition Rules." In Proceedings of the 1995 Conference on Object-Oriented Programming, Systems Languages and Applications. ACM Press, 1995: Pages: 235--250. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. George Fairbanks, David Garlan, and William Scherlis. "Design Fragments Make Using Frameworks Easier." In Proceedings of the 2006 Conference on Object-Oriented Programming, Systems Languages and Applications. ACM Press, 2006: Pages 75--88. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Gregor Kiczales, John Lamping, Anurag Mendhekar, Chris Maeda, Cristina Lopes, Jean-Marc Loingtier, and John Irwin. "Aspect-Oriented Programming." In Proceedings of the 1997 European Conference on Object-Oriented Programming (ECOOP 1997). Springer Verlag: Pages 220--242.Google ScholarGoogle Scholar
  31. Jan Hannemann and Gregor Kiczales. "Design Pattern Implementation in Java and AspectJ." In Proceedings of the 2002 Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2002). ACM Press, 2002: Pages 161--173. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Egil Andersen. Conceptual Modeling of Objects: A Role Modeling Approach. Ph.D. Thesis, University of Oslo, 1997.Google ScholarGoogle Scholar
  33. Kent Beck and Erich Gamma. Source code available from http://www.junit.org.Google ScholarGoogle Scholar
  34. Dirk Riehle et al. "Design Pattern Density Validated." In preparation.Google ScholarGoogle Scholar
  35. Simon Denier and Pierre Cointe. "Understanding Design Pattern Density with Aspects: A Case Study in JHotDraw using AspectJ." In Proceedings of the 5th International Symposium on Software Composition (SC 2006). Springer Verlag, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Dirk Heuzeroth, Thomas Holl, Gustav Högström, and Welf Löwe. "Automatic design pattern detection." In Proceedings of the 11th IEEE International Workshop on In Program Comprehension, 2003. IEEE Press, 2003. Page 94--103. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Rudolf Keller, Reinhard Schauer, Sebastian Robitaille, and Peter Page. "Pattern-Based Reverse-Engineering of Design Components." In Proceedings of the 21st International Conference on Software Engineering (ICSE 1999). IEEE Press. Page 226--235. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Nikolaos Tsantalis, Alexander Chatzigeorgiou, George Stephanides, and Spyros T. Halkidis, "Design Pattern Detection Using Similarity Scoring," IEEE Transactions on Software Engineering, vol. 32, no. 11 (November 2006). Page 896--909. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Zsolt Balanyi and Rudolf Ferenc, "Mining Design Patterns from C++ Source Code." In Proceedings of the 2003 International Conference on Software Maintenance (ICSM '03). IEEE Press, 2003. Page 305--314. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Ivica Aracic, Vaidas Gasiunas, Mira Mezini, and Klaus Ostermann. "Overview of CaesarJ." Transactions on Aspect-Oriented Software Development I (LNCS vol. 3880). Springer Verlag, 2006. Page 135--173. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Design pattern density defined

          Recommendations

          Reviews

          Nancy S. Eickelmann

          In this paper, Riehle sets out to present "a quantitative definition of design pattern density so that we can track its value in the evolution of a given framework." One object-oriented framework-JUnit 3.8-is used as a detailed exemplar [1]. Riehle uses a role or collaboration view, and identifies nine patterns and 19 collaborations for the entire JUnit 3.8 framework, resulting in a pattern density of 47 percent. The new measure includes a composite pattern, which is known to be more complex than some patterns. The impact of the nonuniformity of complexity is not explicitly addressed, and is stated as outside the scope of the paper. Riehle identifies the TestResult class as having three patterns-observer, command, and adapter-and six collaborations. One of the collaborations of TestResult was identified as having a pattern (collecting parameter); it was counted in the original nine patterns for JUnit 3.8, but is not counted as a pattern in this context. In order to apply this measure in practice, the paper needs a more detailed explanation of the operational definitions of how and when to count the patterns. Beck and Gamma, the developers of JUnit, provide a class view of the design pattern density, which is composed of four patterns, in their work [1]. This class-view measure of design pattern density centers on the key abstraction, the TestCase class. This measure is one of pattern clustering or proximity to the key abstraction, and is a simple count of the total number of patterns linked to the key abstraction. Online Computing Reviews Service

          Access critical reviews of Computing literature here

          Become a reviewer for Computing Reviews.

          Comments

          Login options

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

          Sign in

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!