Elementary Patterns in the Classroom

A Report on the ChiliPLoP'99 Hot Topic Workshop

Eugene Wallingford
Department of Computer Science
University of Northern Iowa

To the Elementary Patterns Home Page


For over two years, a group of computer science (CS) educators has been exploring the role that patterns and pattern languages can play in helping students to learn how to design and implement programs. We have focused on so-called "elementary patterns", recurring solutions to problems students face at their own level of programming. At the 1998 OOPSLA Educators Symposium, I reported on the 1998 ChiliPloP hot topic workshop, also titled "Elementary Patterns and their Role in Instruction". In this report, I will describe some of the developments in elementary patterns since last year's symposium, including what transpired at the 1999 ChiliPLoP Hot Topic.

The Idea of Elementary Patterns

Helping novice students learn how to write computer programs is a difficult task. Students must learn, among other things, how to use a programming language; how to create readable, modifiable code; how to evaluate the quality of programs; and how to modify existing code. They must also learn how to decompose solutions into parts, to make design trade-offs based on conflicting goals, and to "grow" their programs as they come to a better understanding of the problem's requirements.

The software patterns movement addresses many of these difficulties directly and most others indirectly. Pattern languages describe structures that recur in the constructed world, structures that balance the various forces that drive designers to achieve conflicting goals. Pattern languages allow designers to guide the evolution of their products by the process of piecemeal growth [6]. The literary form of patterns stresses the documentation not only of solutions but also reasons: explication of the forces and how the pattern resolves them. The form also encourages the author to document examples of the pattern and to build on the examples of other patterns in the language. Taken together, these features make patterns a potentially powerful vehicle for student learning.

Prior to the ChiliPLoP'99, a number of elementary patterns appeared at various conferences, in particular Roundabout [11], One Loop for Linear Structures [2], a rough language of loop patterns [3], and a pair of elementary OOP patterns, delegation and substitution [5]. Nguyen [9] and Goodrich et al. [8] also reported the use of several patterns from Design Patterns [7] to teach data structures.


Robert Biddle, Rick Mercer, and I organized a workshop at OOPSLA'99 on the topic of evaluating object-oriented design. At that workshop, I presented a short experience paper on the use of a pattern language as a tool for evaluating design [13]. I base my approach on the notion of diagnosis described by Christopher Alexander in The Oregon Experiment [1]. Pattern languages provide not only a vocabulary for discussing designs but also relatively explicit descriptions of when to consider using a pattern and of what forces to take into account.

The ChiliPLoP'99 Hot Topic

The second Hot Topic on elementary patterns and their role in instruction took place at ChiliPLoP'99. Four veterans of the first workshop--Joe Bergin, Robert Duvall, Rick Mercer, and I--were joined by newcomers Doug Dechow (Knox College) and Dwight Deugo (Carleton University). We chose this year to focus specifically on elementary patterns of object-oriented programs. To make our task more concrete, we decided to outline a small manual structured as a set of pattern languages, to serve as a companion volume to the typical CS1 textbook. Material for some of the chapters came largely from existing patterns work, such as the selection, loop, and recursion patterns. Some of the chapters present challenges to the elementary patterns community to write more patterns, especially in the areas of novice analysis and design.

Work on these and other areas continues. Available on-line are some rough notes on the workshop and rough working notes on the first two chapters of the proposed book.

SIGCSE'99 Workshops

The original ChiliPLoP'98 Hot Topic participants organized and led two workshops on elementary patterns at SIGCSE, the week after ChiliPLoP'99. We proposed these workshops under the umbrella title, "Using Patterns in the CS Curriculum".

Workshop 1, Incorporating Patterns into CS Courses, aimed to help computer science instructors explore how they might use existing patterns and pattern languages in their courses. After a short introduction, we spent most of the rest of the evening conducting a reader's workshop of Loop Patterns [3]. Participants read the paper and the worked in small groups to identify ways they might use the patterns in their course. (They also provided useful feedback to the authors, who intend to include their suggestions in the next version of the paper.) The evening concluded with a large group discussion that integrated and expanded on the ideas of the small groups.

Workshop 2, Writing Patterns for CS Courses, aimed to help computer science instructors explore how they might begin to write patterns and pattern languages for their own courses. The group of participants was considerably smaller than for the first workshop, which enabled us to conduct a much more intimate and wide-ranging discussion. We spent most of the morning conducting a writer's workshop of Selection Patterns [4]. In the course of understanding the paper and suggesting ways in which the author might improve it, we managed to discuss several critical issues in the writing and presentation of elementary patterns. As often happens with first-time participants at PloP, attendees who had never participated in a writer's workshop found the experience exhilarating.

The 1999 PLoP and EuroPLoP Conferences

Several elementary patterns papers appeared at the summer flagship patterns conferences. Joe Bergin took his Selection Patterns [4] paper from SIGCSE to EuroPLoP in July. At PLoP, we workshopped two papers: Dorin Sandu's and Dwight Deugo's The Lambda Pattern [10] and my Envoy: A Pattern Language for Managing State in a Functional Program [14]. Lambda documents a pattern of on-the-fly behaviors as seen in Java inner classes and Smalltalk blocks. It draws its inspiration from Lisp's nameless functions. Envoy describes structures in functional programming for storing and modifying state. These structures rely on the idea of a closure, which itself is a nameless lambda expression. Dwight and I also reprised our PloP'98 birds-of-a-feather session on elementary patterns, at which we learned from graduate students and people from industry some of their ideas and concerns regarding the use of patterns in teaching and learning.

The Future of Elementary Patterns

Many of the questions that I raised in last year's ChiliPLoP report on how to write and use elementary patterns remain unanswered, but the community of CS educators working on them has grown markedly since that time. We have made more progress on the task of writing patterns than we have on the task of capturing how to use them in the classroom. I think that this is a natural evolution: without patterns in print, we won't be able to explore their use in any great detail. In many regards, we proceed in the task of writing patterns on faith in their ultimate usefulness. I also think that, regardless of the answers we ultimate reach on their use in the classroom, we will be better teachers--and our courses will be better for students--for our having written the patterns at all.

I continue to host a web site as a resource for the elementary patterns community. The site contains pointers to elementary patterns and pattern languages, pointers to papers on how to use patterns in the classroom, and pointers to relevant conferences and workshops, as well as information on how to join the Elementary Patterns e-mail discussion list. The Elementary Patterns home page resides at:


We hope to hold an elementary patterns workshop again at SIGCSE'00, and we also plan to offer another Hot Topic workshop at ChiliPLoP'00. We sincerely hope that others in the patterns community, the academic CS community, and the OO practitioner community will join is in this effort to improve undergraduate computer science education. Some believe that the use of patterns and pattern languages could lead to a radically different way of teaching computer science. If you are interested in any way, please visit the Elementary Patterns home page, subscribe to the discussion list, and join us!


I thank the many participants of the Elementary Patterns community for their helping me to organize workshops, birds-of-a-feather sessions and other conference activities, for their pattern-writing efforts, and for their ideas. The work I report here is theirs.


  1. Alexander, Christopher, M. Silverstein, S. Angel, S. Ishikawa, and D. Abrams (1975). The Oregon Experiment, Oxford University Press.

  2. Astrachan, Owen (1998). "Design Patterns: An Essential Component of CS Curricula," SIGCSE Bulletin 30(1):153-160.

  3. Astrachan, Owen, and Eugene Wallingford (1998). "Loop Patterns," Proceedings of the 5th Pattern Languages of Programs Conference, Monticello, Illinois, August 1998.

  4. Bergin, Joseph (1999). "Selection Patterns," Proceedings of the 4th EuroPLoP Conference, Bad Irsee, Germany, July 1999.

  5. Deugo, Dwight (1998). "Foundation Patterns", Proceedings of the 5th Pattern Languages of Programs Conference, Monticello, Illinois, August 1998.

  6. Gabriel, Richard (1996). Patterns of Software. Oxford University Press.

  7. Gamma, Erich, Richard Helm, Ralph Johnson, and John Vlissides (1995). Design Patterns. Addison-Wesley.

  8. Goodrich, Michael, Natasha Gelfand, and Roberto Tomassia, (1998). "Teaching Data Structures Design Patterns," SIGCSE Bulletin 30(1):331-335.

  9. Nguyen, Dung (1998). "Design Patterns for Data Structures," SIGCSE Bulletin 30(1):336-340.

  10. Sandu, Dorin, and Dwight Deugo (1999). "The Lambda Pattern," Proceedings of the 6th Pattern Languages of Programs Conference, Monticello, Illinois, August 1999.

  11. Wallingford, Eugene (1997). "Roundabout: A Pattern Language for Recursive Programming," Proceedings of the 4th Pattern Languages of Programs Conference, Monticello, Illinois, September 1997.

  12. Wallingford, Eugene (1998). "A Report on the ChiliPLoP'98 Hot Topic Workshop 'Elementary Patterns and their Role in Instruction,'" Proceedings of the 1998 OOPSLA Educators Symposium, October 1998.

  13. Wallingford, Eugene (1998). "Using a Pattern Lan-guage to Evaluate Design," Workshop on Evaluating Object-Oriented Design, OOPSLA'98. URL: http://www.cs.uni.edu/~wallingf/patterns/elementary/conferences/oopsla98_workshop_rtp.html

  14. Wallingford, Eugene (1999). "Envoy: A Pattern Language for Managing State in a Functional Program," Proceedings of the 6th Pattern Languages of Programs Conference, Monticello, Illinois, August 1999.

Eugene Wallingford ==== wallingf@cs.uni.edu ==== November 17, 1999