Download presentation
Presentation is loading. Please wait.
Published byDarlene Williamson Modified over 8 years ago
1
Design Pattern Introduction in Data Structures Purpose Natural integration of patterns into data structures education Plan Cover traditional topics in Data Structures Introduce design patterns for producing reusable code Have students work on a problem that lends itself easily to a design pattern.
2
Adapter Applicable topics in Data Structures Deques, Stacks, Queues Problem Implement a Stack class Solution Use a Deque object and Stack interface.
3
Template Method Applicable topics in Data Structures Binary tree traversal Problem Provides a skeleton algorithm for traversal where desired behavior can be implemented as desired. Solution See next slide.
4
Template Method Solution
5
Comparator (err… Strategy) Applicable topics in Data Structures Priority Queues Problem Create a generic implementation of a priority queue. Solution Use of a derived class implementing specific methods.
6
Pedagogical Patterns What is a pedagogical pattern? What does that have to do with design patterns? How can the two patterns be brought together?
7
What is a pedagogical pattern? Pedagogy – the art or profession of teaching. Over 100 patterns dealing with teaching patterns. Range from daily instruction to broad overview of how classes can be taught.
8
What does this have to do with design patterns? Pedagogical patterns are analogous to teaching as design patterns are to programming. The purpose is to be able to teach expert knowledge at a level such that inexperienced people understand and learn.
9
Examples Early Bird Consistent Metaphor Fill in the blanks Fixer upper And many more…
10
Pedagogical Patterns Early Bird Introduce and discuss major topics early in the course to reinforce important ideas Consistent Metaphor Create a metaphor which the students can use as a reference for understanding Fill in the Blanks Learn by reading and doing Fixer Upper Students work on a large project which contains carefully placed errors to induce students to think about important concepts.
11
Teaching Fundamental Concepts Intent To expose students to the fundamentals of good object-oriented design Structure of the Course The instructor selects a design pattern that implements the concept Discuss the design concept Present the design pattern Group work on a problem Groups present solutions Class discuss solutions Individual practice/assignments
12
Teaching the concept behind a complex framework Intent To introduce a design concept behind a complex framework or toolbox Structure Mine patterns from the framework Explain the concept Describe the actual implementation Hands on practice Examples Microsoft Foundation Classes Java AWT, Swing Model-View-Controller
13
Discussion Questions? Which is better? Elementary,Brute Force? Why? Where do you think design patterns should be introduced? Can you think of other ways of introducing design patterns? Can you think of any other patterns we didn’t talk about here? Where have you used them before? What patterns are very “natural”, i.e. which ones are just byproducts of the fact that you program? Are there patterns that make up the patterns you are already familiar with?
14
References Definition of pedagogy http://dictionary.com/ http://dictionary.com/ Integration of Design Patterns and Data Structures http://www.cs.brown.edu/cgc/jdsl/papers/patterns.pdf http://www.cs.brown.edu/cgc/jdsl/papers/patterns.pdf Pedagogical Patterns http://csis.pace.edu/~bergin/ http://csis.pace.edu/~bergin/ http://www.pedagogicalpatterns.org/ http://www.pedagogicalpatterns.org/ Pedagogical Patterns for Design Patterns http://www-lifia.info.unlp.edu.ar/ppp/pp28.html http://www-lifia.info.unlp.edu.ar/ppp/pp28.html http://www-lifia.info.unlp.edu.ar/ppp/pp29.html http://www-lifia.info.unlp.edu.ar/ppp/pp29.html
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.