Principles Are Leading/alx
Principles Are Leading | |
Contributors | Christian Köppe |
---|---|
Last modification | May 16, 2017 |
Source | Köppe (2011)[1][2]; Köppe (2013)[3] |
Pattern formats | OPR Alexandrian |
Usability | |
Learning domain | |
Stakeholders |
Also Known As: Principle-Supporting Pattern Usage (Principle-Supporting Pattern Usage)
In many domains principles are defined which guide practitioners in this domain and help them to realize good solutions. These principles are often taught before or during the introduction of patterns, but the relation between these principles and the patterns are not always obvious to the students.
While learning design patterns students often focus on the implementation of the patterns in isolation, which regularly results in a bad overall design.
Good design of an object-oriented system is based on basic principles like high cohesion, loose coupling, etc. They should be taken into account while designing, and design patterns are just a tool to do so. As Warren states, the focus should be put on doing design by making effective use of design patterns[4].
Small Scale vs. Large Scale. Design patterns are often taught first using small examples. The design principles do not play a prominent role in these examples. However, when the examples become larger also the principles become more important. But the students often apply the patterns as in their small examples, which increases the chance of violating basic design principles.
Golden Design Bullet. Students tend to think that the pure application of patterns does automatically lead to a good design.
Therefore: Assure that the students understand that basic designprinciples are more important than the patterns themselves and should therefore always be followed first. Emphasize that design patterns can support the implementation of these principles if applied correctly, but do not automatically so.
Not for all domains principles have been identified which form guidelines for creation in these domains. In software design these principles are well known and described, and because patterns are mainly intended to follow these principles, this pattern is considered as invariant in the domain of software design patterns.
This pattern is inspired by the framework process pattern It’s Still OO To Me (It’s Still OO To Me)[5], which is applicable for the development of frameworks, but also for the usage of design patterns. Rasala states that one of the problems in teaching design is the “lack of clarity about fundamental issues” [6]. This problem is addressed by this pattern as well through making the fundamental issues —the principles which have to be followed — explicit and leading. The correct consideration of the principles should be emphasized continuously by the teacher or trainer when teaching design patterns. This ideally is also reflected when assessing the students’ practical work: not the multiple application of different patterns should be rewarded, but the support of the applied patterns for the realization of the design principles in the overall design.
Gestwicki and Sun define three main learning objectives for teaching Design Patterns[7]. The first and most important one is: “The student understands object-oriented design and modeling”. This requires the constant reminding of the students what a good object-oriented design is based on. Through making the OO-principles leading, this learning objective could be more easily achieved. As stated by Vlissides, design patterns are not necessarily object-oriented.[8]. So the design principles don’t have to be necessarily object-oriented. But the more important part is that whatever paradigm is used, the patterns should be used to support the principles valid for this paradigm.
Experience of Benefits (Experience of Benefits) can be used for the implementation of this pattern. If shown to students, the Experience of Benefits (Experience of Benefits) is often of value because of their maintenance of the design principles.
In our course we included in the discussions with the students also the resulting context. The students were constantly reminded of the design principles and had to explain how the resulting context conforms to these principles.
Eduardo Guerra introduces patterns in his courses at the Instituto Tecnol´ogico de Aeronautica as examples of how to realize different principles. This way it is ensured that the focus of the course is primarily on these principles and that the patterns only help in realizing them, which also makes the difference between principles and patterns more clear to the students.
In Head first Design Patterns the authors make a distinction between different levels of pattern thinking[9]. . They describe the highest level as Zen Thinking, which consists of thinking in object principles and applying patterns only if this naturally follows the object thinking. They also repeatedly emphasize the design principles and explain how the patterns are used to follow them. One example is the principle of loose coupling and how the Observer pattern can help in realizing this principle.
References
- ↑ Patlet first published in Köppe, C. (2011). A pattern language for teaching design patterns (part 1). In Proceedings of the 16th European Conference on Pattern Languages of Programs (EuroPLoP 2011) (p. 2). New York:ACM.
- ↑ Pattern first published in Köppe, C. (2011). A pattern language for teaching design patterns (part 2). In Proceedings of the 18th Conference on Pattern Languages of Programs (PLoP 2011). New York:ACM.
- ↑ Köppe, C. (2013). A Pattern Language for Teaching Design Patterns. In Transactions on Pattern Languages of Programming III (pp. 24-54). Springer Berlin Heidelberg.
- ↑ Warren, I. (2005). Teaching patterns and software design. In Proceedings of the 7th Australasian conference on Computing education-Volume 42 (pp. 39-49). Australian Computer Society, Inc..
- ↑ Carey, J., & Carlson, B. (2002). Framework process patterns: lessons learned developing application frameworks. Addison-Wesley Longman Publishing Co., Inc..
- ↑ Rasala, R. (1997). Design issues in computer science education. ACM SIGCSE Bulletin, 29(4), 4-7.
- ↑ Gestwicki, P., & Sun, F. S. (2008). Teaching design patterns through computer game development. Journal on Educational Resources in Computing (JERIC), 8(1), 2.
- ↑ Beck, K., Crocker, R., Meszaros, G., Vlissides, J., Coplien, J. O., Dominick, L., & Paulisch, F. (1996). Industrial experience with design patterns. In Proceedings of the 18th international conference on Software engineering (pp. 103-114). IEEE Computer Society. Washington DC.
- ↑ Freeman, E., Robson, E., Bates, B., & Sierra, K. (2004). Head first design patterns. O'Reilly Media, Inc..