0 Introduction
Software design patterns are an important aspect of software engineering, helping developers solve common design problems and improve the quality and maintainability of software systems.[1] Traditional teaching methods for software design patterns courses have some issues, such as cumbersome preparation of teaching cases by teachers and the difficulty for students to understand and apply specific cases, leading to a mismatch between talent training and market demand.
Generative Artificial Intelligence (GAI) is a technology based on machine learning and deep learning that can generate new content by learning from large amounts of data and mimicking human thinking. In software design pattern courses, GAI technology can effectively assist teachers in preparing teaching cases and help students learn specific cases. GAI tools present learning content through various means such as multimedia, interactive experiments, and games, providing a rich learning experience, increasing students’ interest and engagement, and enhancing learning outcomes[2], effectively addressing the issues in the teaching of software design pattern courses.
1 Relevant Applications of GAI Technology in Teaching
GAI is a branch of artificial intelligence based on machine learning and natural language processing technologies, aiming to enable computers to autonomously generate content. By learning from large amounts of data and patterns, GAI can generate text, images, and audio with semantic coherence, creativity, and logic[3]. The core of GAI consists of deep learning models such as Recurrent Neural Networks (RNN) and Variational Autoencoders (VAE), which possess strong expressive and pattern recognition capabilities, allowing them to extract features from input data and generate new data with similar characteristics.
GAI has a wide range of applications across various fields: in natural language processing, it can be used for automatic text summarization, dialogue systems, and machine translation; in image processing, it can be used for image generation, super-resolution, and image style transfer; in audio processing, it can be used for speech synthesis and music generation. Additionally, GAI has shown potential in creative arts, game design, and education[4]. In recent years, the application of GAI technology in education has garnered widespread attention, providing assistance in preparing teaching cases, student learning of specific cases, personalized learning support, and teaching assessment and feedback[5].
1.1 Teacher Preparation of Teaching Cases
Teachers need to prepare a variety of teaching cases to support student learning. GAI technology can provide teachers with instant suggestions and case generation through interaction with generative artificial intelligence tools. Teachers can converse with GAI, pose questions, and obtain cases related to the teaching content. Such applications can help teachers quickly acquire suitable teaching cases and improve teaching effectiveness[6].
1.2 Student Learning of Specific Cases
Students need to understand and master specific cases during the learning process to better apply the knowledge acquired. Through dialogue with GAI tools, students can ask questions about specific cases and receive instant answers and guidance. This personalized learning approach caters to students’ learning needs, enhancing their interest and motivation[7].
1.3 Personalized Learning Support
GAI technology can provide personalized learning support and feedback for students. Through interaction with GAI tools, students can receive customized learning suggestions and guidance based on their learning needs and progress. GAI can offer personalized learning paths and resource recommendations based on students’ questions, answers, and learning history. This personalized learning approach helps students better understand and master knowledge, improving learning outcomes[8].
1.4 Teaching Assessment and Feedback
Another application of GAI technology in teaching is to assist teachers in assessing and providing feedback on students’ learning outcomes. By recording and analyzing students’ interactions with GAI tools, teachers can understand students’ learning progress and difficulties, evaluate students’ learning processes and comprehension levels, and provide appropriate feedback and support. This GAI-based teaching assessment and feedback mechanism can help teachers better understand students’ learning situations and needs, allowing for timely adjustments to teaching strategies[9].
In summary, GAI technology has broad application prospects in teaching. By integrating the characteristics and requirements of the course, teachers can use GAI technology to design personalized teaching cases, aiding students in better understanding and mastering key concepts and practices in the course; students can interact with GAI technology to receive targeted feedback and guidance, improving learning outcomes[10].
2 Introducing GAI into Software Design Pattern Course Reform Ideas
The case teaching method is a classic teaching approach based on case studies, promoting learning by guiding students to think and solve practical problems. Currently, the case teaching method has become an important aspect of teaching method reform, and the corresponding case library construction has also been included as a core component of course development. The goal of the software design pattern course is to enable students to deeply understand the concepts and principles of various software design patterns and to initially possess the ability to apply software design thinking to carry out detailed software design and practice. Using the case teaching method in the course’s teaching practice can effectively stimulate students’ interest and initiative in learning, deepen their theoretical understanding, improve practical skills, and significantly enhance teaching effectiveness.
Software design patterns are general solutions to specific software problems. Applying software design patterns can improve software reusability and scalability while reducing software development and maintenance costs. The traditional process of preparing teaching cases is cumbersome and time-consuming, making it difficult to adapt to the diverse demands and real-time updates of cases. The reform idea of introducing GAI into the software design pattern course is based on the characteristics of the software design pattern course, utilizing the knowledge chain of design patterns to prepare teaching cases with GAI technology, thereby enhancing teachers’ preparation efficiency. Using GAI for teaching case preparation can greatly simplify teachers’ work and provide richer and more practical case content. According to the characteristics of design patterns, when preparing teaching cases with GAI, teachers can interact with GAI tools according to specific knowledge modules of design patterns, collecting and organizing relevant case materials. The knowledge chain of software design patterns consists of six parts: pattern concepts, pattern structures, applicable scenarios, advantages and disadvantages analysis, code examples, and application examples (as shown in Figure 1). The pattern concept primarily explains the definition, characteristics, and purposes of the design pattern, the pattern structure presents the principles and architecture of the pattern, the applicable scenarios describe the problems the design pattern aims to solve and the conditions for its applicability, the advantages and disadvantages analysis summarizes the pros and cons of the specific design pattern, the code examples should demonstrate the implementation of the design pattern with specific code, and the application examples should provide successful applications of the design pattern in real software systems.

3 Specific Implementation
3.1 GAI-Assisted Teacher Preparation of Teaching Cases
Teachers can provide a specific design pattern question or topic to GAI tools (such as ChatGPT). For example, given an Observer Pattern, teachers can sequentially ask the GAI tool the following series of questions according to the knowledge chain shown in Figure 1: “What is the factory pattern?” “Please provide the principles and structure of the observer pattern.” “What are its application scenarios?” “Please analyze the advantages and disadvantages of this design pattern.” “Please provide a code example of this design pattern.” “Please give an example of this pattern’s application in real software systems.” The GAI tool will generate a series of responses, including concept definitions, case explanations, and best practice suggestions. The specific interaction process for teachers using GAI tools to automatically generate the advantages and disadvantages analysis of the factory pattern is shown below.
Teachers can also use GAI tools to automatically generate code examples of the factory pattern and the specific interaction process for collecting content as follows.
Through interaction with GAI tools, teachers can organize detailed content for teaching cases based on the responses generated by GAI tools. During the organization process, teachers can filter and modify as necessary according to course requirements and students’ actual situations to ensure the accuracy and comprehensibility of the cases.
The method of preparing teaching cases using GAI not only saves teachers time and effort but also provides more diverse and personalized case content to meet students’ different needs and learning styles. It should be noted that teachers should maintain critical thinking when interacting with GAI tools and use their professional knowledge and experience to evaluate the information and suggestions provided by GAI tools. GAI tools (such as ChatGPT) are still in their early development stages, and teachers play a crucial role in preparing teaching cases and personalized teaching by integrating educational principles and student needs.
3.2 Students Using GAI to Learn Software Design Patterns
In traditional software design pattern courses, students learn specific cases through reading textbooks, analyzing code, and participating in practical projects. However, these learning methods face challenges such as limited learning resources, mismatched case difficulty, and inconsistent learning progress due to individual differences among students. The method of student learning of specific cases based on GAI can promote students’ active learning and personalized learning through interaction with tools like ChatGPT.
When using GAI tools for learning design patterns, considering that students’ learning is a process of gradual deepening and expanding from points to the whole, an iterative interaction process can be adopted (as shown in Figure 2). Since students are beginners in software design patterns, their understanding and recognition of design patterns are relatively vague, making it difficult for them to prepare all questions and key points in advance like teachers. Therefore, during the interaction with GAI tools, they should start with the most basic questions, learning and understanding the content provided by GAI, analyzing which areas are still unclear, and continuing to ask questions, iterating their learning process with GAI tools.

During the learning process of software design patterns, students can ask questions, explore cases, and receive instant feedback and guidance. For example, while learning the observer pattern, after the teacher’s explanation, students may have an initial understanding of the observer pattern and become interested in the specific implementation methods of this pattern. They can then ask the GAI tool, “What are the implementation methods of the observer pattern?” The GAI tool will generate responses based on existing knowledge and cases, allowing students to deepen their understanding of the concept, application, and usage of the observer pattern through interaction with the GAI tool. An example of the content automatically generated by the GAI tool in response to the question, “What are the implementation methods of the observer pattern?” is shown below.
By learning and understanding the content generated by GAI tools, students may still have some areas that require further clarification. For example, students may be interested in the specific data structure used by the observable class to maintain all observers and can iteratively ask, “What specific data structure does the observable class use to maintain all observers?” An example of the interaction between the student and the GAI tool regarding this question is shown below.
In addition to the iterative questioning process mentioned above, students can also engage in programming exercises with GAI tools to deepen their understanding of the specific implementation of the observer pattern. Students can provide relevant code snippets or questions and discuss with GAI tools how to use the observer pattern to solve specific programming problems. GAI tools can provide code examples, suggestions, or guidance to help students understand how to use the observer pattern to design and implement scalable and flexible systems.
Through interactive learning with GAI tools, students can explore the observer pattern from different angles, including theoretical concepts, practical applications, and programming practices. This personalized and interactive learning approach can stimulate students’ interest and initiative, improving learning outcomes and deep thinking abilities. It is important to note that while GAI tools can provide useful information and guidance to students, they also have certain limitations as learning tools. During the learning process, students should maintain critical thinking and integrate other learning resources and teacher guidance to comprehensively understand and apply software design patterns.
4 Teaching Effectiveness
4.1 Transforming Teacher Roles
In traditional software design pattern courses, teachers are typically knowledge transmitters and guides. After adopting GAI technology, the role of teachers has transformed. First, teachers no longer need to spend a lot of time and effort preparing and explaining cases. By interacting with GAI tools, teachers can quickly obtain accurate and practical case content, allowing them to devote more time and energy to integrating cases and practical activities, enhancing students’ hands-on abilities and problem-solving skills. Second, the teacher’s role has shifted from knowledge transmitter to learning guide. By interacting with students, teachers can guide students to ask questions, explore cases, and provide guidance and feedback on their learning processes. Finally, teachers can adjust the difficulty and depth of cases based on students’ specific needs and understanding, helping students better understand and apply software design patterns.
4.2 Changing Student Learning Methods
In traditional software design pattern courses, students primarily learn specific cases through reading textbooks, analyzing code, and participating in practical projects. The GAI-based learning method changes students’ learning approach: students can actively ask questions through interaction with GAI tools and receive instant answers and explanations. This personalized learning method meets students’ different needs and learning styles, improving learning effectiveness and efficiency. By interacting with tools like ChatGPT for case exploration and practice, students can ask specific questions and obtain specific applications and solutions to problems, helping them better understand the concepts and practical applications of software design patterns.
4.3 Enhancing Teaching Effectiveness
Introducing GAI has significantly improved the teaching effectiveness of software design pattern courses. First, by using GAI tools, teachers can provide richer and more practical case content, enabling students to better understand and apply software design patterns, cultivating good software design thinking and problem-solving abilities. Second, the GAI learning method stimulates students’ initiative and autonomous learning abilities, allowing them to engage in personalized learning through interaction with GAI tools like ChatGPT, exploring cases autonomously, and obtaining guidance and support based on their understanding and needs. This personalized and autonomous learning approach can ignite students’ interest and motivation, ultimately improving learning outcomes.
5 Conclusion
The GAI-based teaching method provides a new direction and possibility for software design pattern course education. Introducing GAI teaching methods in software design pattern courses holds significant application prospects but still faces challenges and unresolved issues. First, the development of GAI technology needs further breakthroughs and optimizations. Current GAI tools have certain limitations in answering questions and generating cases, requiring improvements in accuracy and reliability. Second, teachers need to fully understand and master the usage of GAI tools to better utilize them for auxiliary teaching. Finally, teachers should conduct in-depth research and exploration of GAI technology and its application fields to better apply it in teaching practice. Additionally, the evaluation and feedback mechanism during the teaching process needs improvement. How to assess students’ learning outcomes and the actual effectiveness of GAI tools in teaching requires exploration in future work. Future research can further delve into the application of GAI technology in other courses and fields to promote innovation and progress in the education sector.
References:
[1] Liu Dong. Data-driven analysis and application of software design patterns[D]. Dalian: Dalian University of Technology, 2021.
[2] Wang Fang, Zhao Zuo, Wang Yihang, et al. Exploration and practice of artificial intelligence in programming teaching[J]. Computer Education, 2023(11): 45-50.
[3] Abukmeil M, Ferrari S, Genovese A, et al. A survey of unsupervised generative models for exploratory data analysis and representation learning[J]. ACM Computing Surveys (CSUR), 2021, 54(5): 1-40.
[4] Ooi B, Tan H, Al-Emran M, et al. The potential of generative artificial intelligence across disciplines: Perspectives and future directions[J]. Journal of Computer Information Systems, 2023(10): 1-32.
[5] Baidoo-Anu D, Ansah O. Education in the era of generative artificial intelligence (AI): Understanding the potential benefits of ChatGPT in promoting teaching and learning[J]. Journal of AI, 2023, 7(1): 52-62.
[6] Peres R, Schreier M, Schweidel D, et al. On ChatGPT and beyond: How generative artificial intelligence may affect research, teaching, and practice[J]. International Journal of Research in Marketing, 2023, 40(2): 269-275.
[7] Ratten V, Jones P. Generative artificial intelligence (ChatGPT): Implications for management educators[J]. The International Journal of Management Education, 2023, 21(3): 100857.
[8] Cooper G. Examining science education in ChatGPT: An exploratory study of generative artificial intelligence[J]. J Sci Educ Technol, 2023, 32(3): 444–452.
[9] Jürgen R, Samson T, Shannon T. ChatGPT: Bullshit spewer or the end of traditional assessments in higher education?[J]. Journal of Applied Learning and Teaching, 2023, 6(1): 342-362.
[10] Kohnke L, Moorhouse L, Zou D. Exploring generative artificial intelligence preparedness among university language instructors: A case study[J]. Computers and Education: Artificial Intelligence, 2023(5): 100156.
Citation Format: Xiao Chenglong, Wang Shanshan. Application of Generative Artificial Intelligence in Software Design Patterns Education[J]. Computer Education, 2024,(11):161-166.
Article Header Image Created by “Zhizhu Qingyan”.
(End)
More Exciting:
Yan Shi│The Impact of Generative AI on Computer Science Education and Countermeasures
Principal Interview|Rooted in Border Ethnic Areas, Focusing on Normal Education to Cultivate High-Quality Applied Talents——Interview with Principal Chen Benhui of Lijiang Normal University
Yan Shi│Review and Prospects of Computer System Capability Cultivation
Discussion on the Concept of “Student-Centered” Teaching and Implementation Path
Principal Interview|Promoting Interdisciplinary Integration to Cultivate Innovative Talents in the New Era——Interview with Professor Ni Mingxuan, Founding Principal of Hong Kong University of Science and Technology (Guangzhou)
New Year Message from the 7th Editorial Board
Guidelines for Teaching Ideology in Computer Courses
Academician Chen Guoliang|Cultural Construction of Virtual Teaching and Research Room in Computer Courses
Professor Chen Daoxu of Nanjing University|Change and Constancy: The Dialectics in the Learning Process
Yan Shi│Reflections and Suggestions on the “Predicament” of Young Teachers in Universities
Xu Xiaofei et al.|The Metaverse Education and Its Service Ecosystem
【Directory】Computer Education 2024 No. 10
【Directory】Computer Education 2024 No. 9
【Directory】Computer Education 2024 No. 8
【Editorial Board Message】Professor Li Xiaoming of Peking University: Thoughts from the “Year of Classroom Teaching Improvement”…
Professor Chen Daoxu of Nanjing University: Teaching students to ask questions and teaching students to answer questions, which is more important?
【Yan Shi Series】: Development Trends in Computer Disciplines and Their Impact on Computer Education
Professor Li Xiaoming of Peking University: From Interesting Mathematics to Interesting Algorithms to Interesting Programming——A Path for Non-Professional Learners to Experience Computational Thinking?
Reflections on Several Issues in Building a First-Class Computer Discipline
New Engineering and Big Data Major Construction
Lessons from Other Countries Can Be Valuable—Compilation of Research Articles on Computer Education in China and Abroad