Pedagogical Pattern #1
Concrete to Abstraction

(Version 2.0)
Ian Chai
University of Illinois
1304 West Springfield Ave.
Urbana, IL 61801 USA
chai@uiuc.edu

Intent:

To keep students' interest when introducing them to their first patterns (or other abstractions.)

Motivation:

Students taking their first OO class usually have never heard of patterns, and do not know what benefit they might derive from them. They may lose interest or get distracted before they understand what is going on.

Most readers of a book on design patterns already know that they want to learn a pattern. The reason they picked up that pattern was because they have read the summary and think it is relevant to their problem.

With a typical introductory classroom situation, however, students may not yet have this motivation. If we start by giving them a pattern name and then talking about the pattern, we could lose half the class before engaging their interest.

Applicability:

This pattern is mainly for use with students unfamiliar with the utility of patterns, or the domain of the particular patterns.

Structure:

Concrete:
Start with an example to which the students can relate. See Acquaintance Examples [Anthony] for suggestions on how to pick a good example.

Abstraction:
After you take the students through the example, then you can point out the aspects which can be applied in other instances. You can point out general principles, and then finally end up with describing the general pattern itself.

Consequences:

This kind of presentation engages the students' interest and demonstrate the usefulness of the pattern before introducing the probably unfamiliar concept of patterns. Is not as good for a pattern catalog because it can take a long time to get around to the point. However, it keeps the students' interest better when they are unfamiliar with the problem.

After a few patterns introduced in this way, the students will start appreciating the power of patterns and become eager to learn the next pattern. At this point, you can then return to introducing them by name, motivation, and context.

Implementation:

Here is an example of using this pattern to introduce the Adaptor pattern [GoF]:

Concrete Example:
"One day, Maria's sink backs up. But she lives in a small town with only one plumber, a Vietnamese refugee named Tuan. Maria doesn't speak Vietnamese and Tuan's English is very poor. Fortunately, Maria has a friend, Jim, whose family came to the USA with the fall of Saigon, and thus he knows both English and Vietnamese very well. So Jim translates for Maria and Tuan gets the job done, and everyone is happy.

"An analogous situation often happens in software. For example, Fred gives you a program that reads data from files using a File object. Mary gives you a HTTP client object that takes data from web pages.

"Now you want to modify Fred's program so that it can take data from web pages, but the protocols for the File object and the HTTP client object do not match. So you write a new object that sits in front of Mary's HTTP client object and presents a File object's interface for Fred's program.

"In this way, Fred's program can now read data from the web using Mary's HTTP client object.

"This kind of situation often comes up in OO when you have objects from different sources, which expect different protocols. It happens often enough that we've got a name for it: the Adaptor Pattern.

Abstraction:
"The Adapter Pattern tells you how to convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces. Here is a diagram of how it works...

Related Patterns:

Acquaintance Examples, Colorful Analogy [Anthony], Physical Analogy [Phil McLaughlin], Abstract to Concrete [not yet written: it says that once the students are familiar with the kinds of abstractions presented in class, you can then just present the abstraction first and they will already be motivated to see how to apply it -- this was suggested by someone during the Workshop]

Example Instances:

This pattern has been used to teach:

References:

[Anthony]
"Patterns for Classroom Education" by Dana Anthony; PLoP '95 Proceedings
http://st-www.cs.uiuc.edu/~chai/classroom-ed.html

[GoF]
"Design Patterns" by Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides; Addison-Wesley 1995.
http://st-www.cs.uiuc.edu/users/patterns/DPBook/DPBook.html


The following two patterns are from Dana Anthony's paper "Patterns for Classroom Education". I am including them here because I refer to them in my pattern.


Acquaintance Examples

Problem:

How do you choose specific examples to use for a class?

Constraints and forces:

There is a range of example domains, from those totally unfamiliar to those in which the student has professional expertise.

If a student is completely unfamiliar with an example's basis, the instructor can spend more time explaining the example than using it. If the instructor is trying to demonstrate the creation of abstract classes, and uses as the example "Control Chart", which has as concrete subclasses "Non P Control Chart" and "X Bar Chart" among others, he doesn't want to spend more time explaining what X Bar means than what the difference between abstract and concrete is.

On the other hand, if the student is an expert in the example domain, the student can become bogged down in the example's domain details, and fail to see the point the example was intended to illustrate. If the instructor is trying to explain when to use a Phone Number object instead of an array of strings representing the area code, exchange, and station of a phone number, she doesn't want the telephony expert student arguing whether exchanges are a valid description of how phone numbers work these days.

Solution:

Choose examples that are the most likely to be familiar to students, but not to be within the area of students' expertise. One way to do this is to choose businesses that students patronize but don't run, for instance a hotel or a video rental store. You may wish to have two alternatives ready so you can use the one which is more appropriate for each group of students. Choosing appropriate Acquaintance Examples can be a very difficult task.

If a class is homogeneous, with all students having expertise in the same domain, an Acquaintance Example can serve as an "ice-breaker", to get students to see how to apply their new knowledge. Then the instructor can supplement the Acquaintance Example with an example closer to the students' domain, to demonstrate that their new knowledge applies to their domain of expertise as well.


Colorful Analogy

Problem:

A concept which is very important has a lot of boring, detailed ramifications. It is not suitable for a simulation game, and is easily forgotten until it becomes a problem and causes trouble.

Constraints and forces:

This is a concept whose name may be memorable but the explanation is not. People may tend to remember that there's something called that, but they forget what it means. Simply emphasizing this concept tends to just confuse people, or to be so boring that students will just tune out.

Solution:

A dry concept can be highlighted with a colorful analogy that provides a place to go back to recall the details.

The example I see most frequently using the colorful analogy is the explanation of the difference between identity and equality in objects. The analogy is a story of a restaurant patron who sees another diner eating a delicious-looking lasagna. He tells the waiter, "I want what she's having." Equality would mean the waiter goes into the kitchen and gets another plate of lasagna for him. Identity would mean that the waiter takes the lasagna the other customer is eating, and gives it to him. With the right analogy, a single word (in this case, "lasagna") can become a touchstone that recalls enough of the details of the explanation to make sense.


Home Project
Leaders
Pedagogical Pattern
Format
Evolution of a
pedagogical pattern
Sample
Patterns
Publications
Subject
Index
Learning Obj.
Index
Teaching/Learning
Element Index
Alphabetical
Index
Author(s)
Index
Contact
Us
Previous pattern Search This Site Next pattern