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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 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
Alfadel, M., Aljasser, K., Alshayeb, M.: Empirical study of the relationship between design patterns and code smells. PLoS ONE 15, e0231731 (2020)
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)
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)
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)
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)
Feitosa, D., Ampatzoglou, A., Avgeriou, P., Nakagawa, E.Y.: Correlating pattern grime and quality attributes. IEEE Access 6, 23065–23078 (2018)
Data are available at https://drive.google.com/file/d/1vAn58ul7whaXM01TMFcj1er5UcCSzrYN/view?usp=sharing
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns - Elements of Reusable Object-Oriented Software. Addison-Wesley (1994)
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
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)
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)
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)
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
Vokác, M.: Defect frequency and design patterns: an empirical study of industrial code. IEEE Trans. Softw. Eng. 30(12), 904–917 (2004)
Walter, B., Alkhaeir, T.: The relationship between design patterns and code smells: an exploratory study. Inf. Softw. Technol. 74, 127–142 (2016)
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)
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)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
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)