Skip to main content

A Safari for Deviating GoF Pattern Definitions and Examples on the Web

  • Conference paper
  • First Online:
Conceptual Modeling (ER 2023)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14320))

Included in the following conference series:

  • 511 Accesses

Abstract

The Gang of Four (GoF) patterns have been around for many years now. People use them to solve object-oriented design problems. The main source to consult for the GoF patterns is the seminal book published by Gamma, Helm, Johnson, and Vlissides in 1994. However, today there is also a large amount of information about the GoF patterns on the Web. There, the developers can find pattern definitions and code examples.

In this paper, we assess the compliance of pattern definitions and examples found on the Web to the original GoF pattern definitions. We study a corpus of definitions and examples, gathered from 4 well-known sites. According to our findings, most of the provided pattern definitions comply with the original GoF pattern definitions. However, there are some intent deviations that result in incorrect definitions. There are also a few deviations that concern missing and incomplete participants. When it comes to the patterns examples, the situation is quite different. Deviations in the examples are much more frequent and include missing participants, incomplete participants, and erroneous participants. The paper concludes with a discussion of the practical implications of our findings for the developers.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 79.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    hillside.net.

  2. 2.

    www.europlop.net.

  3. 3.

    sourcemaking.com.

  4. 4.

    refactoring.guru.

  5. 5.

    www.tutorialspoint.com/design_pattern.

  6. 6.

    www.javatpoint.com/design-patterns-in-java.

  7. 7.

    Due to their volume, data are available in a non-monitored, anonymous google drive (https://drive.google.com/file/d/1vAn58ul7whaXM01TMFcj1er5UcCSzrYN/view?usp=sharing), to become eponymously public at github upon acceptance of the paper.

References

  1. Alfadel, M., Aljasser, K., Alshayeb, M.: Empirical study of the relationship between design patterns and code smells. PLoS ONE 15, e0231731 (2020)

    Article  Google Scholar 

  2. Almadi, S.H.S., Hooshyar, D., Ahmad, R.B.: Bad smells of gang of four design patterns: a decade systematic literature review. Sustainability 13, 10256 (2021)

    Article  Google Scholar 

  3. Aversano, L., Canfora, G., Cerulo, L., Grosso, C.D., Penta, M.D.: An empirical study on the evolution of design patterns. In: Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT International Symposium on Foundations of Software Engineering (ESEC-FSE), pp. 385–394. ACM (2007)

    Google Scholar 

  4. Bieman, J.M., Straw, G., Wang, H., Munger, P.W., Alexander, R.T.: Design patterns and change proneness: an examination of five evolving systems. In: Proceedings of the 9th IEEE International Software Metrics Symposium (METRICS), pp. 40–49 (2003)

    Google Scholar 

  5. Dale, M.R., Izurieta, C.: Impacts of design pattern decay on system quality. In: Proceedings of the 8th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement ESEM, pp. 37:1–37:4 (2014)

    Google Scholar 

  6. Feitosa, D., Ampatzoglou, A., Avgeriou, P., Nakagawa, E.Y.: Correlating pattern grime and quality attributes. IEEE Access 6, 23065–23078 (2018)

    Article  Google Scholar 

  7. Data are available at https://drive.google.com/file/d/1vAn58ul7whaXM01TMFcj1er5UcCSzrYN/view?usp=sharing

  8. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns - Elements of Reusable Object-Oriented Software. Addison-Wesley (1994)

    Google Scholar 

  9. Izurieta, C., Bieman, J.M.: A multiple case study of design pattern decay, grime, and rot in evolving software systems. Softw. Qual. J. 21(2), 289–323 (2013). https://doi.org/10.1007/s11219-012-9175-x

    Article  Google Scholar 

  10. Mayvan, B.B., Rasoolzadegan, A., Yazdi, Z.G.: The state of the art on design patterns: a systematic mapping of the literature. J. Syst. Softw. 125, 93–118 (2017)

    Article  Google Scholar 

  11. Prechelt, L., Unger, B., Philippsen, M., Tichy, W.F.: Two controlled experiments assessing the usefulness of design pattern documentation in program maintenance. IEEE Trans. Softw. Eng. 28(6), 595–606 (2002)

    Article  Google Scholar 

  12. Prechelt, L., Unger, B., Tichy, W.F., Brössler, P., Votta, L.G.: A controlled experiment in maintenance comparing design patterns to simpler solutions. IEEE Trans. Softw. Eng. 27(12), 1134–1144 (2001)

    Article  Google Scholar 

  13. Reimanis, D., Izurieta, C.: Behavioral evolution of design patterns: understanding software reuse through the evolution of pattern behavior. In: Peng, X., Ampatzoglou, A., Bhowmik, T. (eds.) ICSR 2019. LNCS, vol. 11602, pp. 77–93. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-22888-0_6

    Chapter  Google Scholar 

  14. Vokác, M.: Defect frequency and design patterns: an empirical study of industrial code. IEEE Trans. Softw. Eng. 30(12), 904–917 (2004)

    Article  Google Scholar 

  15. Walter, B., Alkhaeir, T.: The relationship between design patterns and code smells: an exploratory study. Inf. Softw. Technol. 74, 127–142 (2016)

    Article  Google Scholar 

  16. Zarras, A.: The strategy configuration problem and how to solve it. In: Proceedings of the ACM European Conference on Pattern Languages of Programs (EuroPLoP), pp. 9:1–9:11. ACM (2021)

    Google Scholar 

  17. Zarras, A.V.: Common mistakes when using the command pattern and how to avoid them. In: Proceedings of the ACM European Conference on Pattern Languages of Programs (EuroPLoP), pp. 4:1–4:9. ACM (2020)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Apostolos V. Zarras .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zarras, A.V., Vassiliadis, P. (2023). A Safari for Deviating GoF Pattern Definitions and Examples on the Web. In: Almeida, J.P.A., Borbinha, J., Guizzardi, G., Link, S., Zdravkovic, J. (eds) Conceptual Modeling. ER 2023. Lecture Notes in Computer Science, vol 14320. Springer, Cham. https://doi.org/10.1007/978-3-031-47262-6_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-47262-6_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-47261-9

  • Online ISBN: 978-3-031-47262-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics