The Polymorphism Challenge - Department of Computer Science

advertisement
The Polymorphism Challenge
Joseph Bergin
Computer Science
Pace University
New York, NY USA
(home) 45 North Oakwood Ter
New Paltz, NY 12561
1-845-255-4369
1-845-255-2883 (fax)
berginf@pace.edu
Eugene Wallingford
Computer Science
University of Northern Iowa
Cedar Falls, IA USA
50614-0507
1-319-273-2618
wallingf@cs.uni.edu
ABSTRACT
Facility with polymorphic programming is a valuable skill for a programmer or an instructor. This hands-on workshop will
give you ideas and practice with the techniques required to program with dynamic polymorphism. As a participant you will
practice the polymorphism etude with a partner under direction of the workshop leaders. You will re-write simple but
complete programs that normally use if statements, to completely remove all selection structures in favor of polymorphism.
This will give you important design experience and improve your skill as an object-oriented programmer and as a teacher.
The workshop will stress techniques applicable to CS1.
Qualifications
Joe Bergin has been teaching for 32 years and OO programming since 1986. He is the creator of the polymorphism etude
exercise, has broad background in design patterns (especially elementary patterns used here) and the techniques of Extreme
Programming (such as pair programming) that will be used in the workshop. He has spoken to several groups about this
exercise and has used it effectively in the classroom with unskilled (dated skills) programmers, though it is intended as an aid
in the education of teachers and programmers, not necessarily students. He has written widely on OO programming and
especially the central role of polymorphic thinking. Bergin has also submitted a paper on this topic to SIGCSE '04.
Eugene Wallingford has been deeply involved in the teaching of object-oriented programming for a decade and writing
object-oriented programs for over 15 years. He is a leading proponent of the study and writing of patterns, in particular the
elementary patterns that novice OO programmers most need. He has several successful SIGCSE workshops on elementary
patterns and coordinated several elementary patterns workshops at the annual ChiliPLoP conference. This year he is the chair
of the OOPSLA Educators' Symposium. Eugene has published several papers on the teaching of OOP, Extreme
Programming, and patterns. Finally, he maintains the Elementary Patterns Home Page at:
http://www.cs.uni.edu/~wallingf/patterns/elementary
Intended audience
This is intended for any instructors who want to do a better job in thinking about and then teaching object-oriented
programming. We propose to offer this workshop twice: once for college faculty (or open to all) and again for AP Computer
Science high school faculty. The latter workshop will be promoted on the AP list server.
Materials to be given
We will prepare a number of exercises that the participants would find simple to do with the usual selection mechanisms such
as if statements. Participants will solve the problems, under our guidance, in a closed lab, using polymorphism and no
selection at all. Solutions will be provided after the lab completes. We will also distribute a short paper that describes some
useful programming techniques for being successful at this. The materials will be made available on Bergin's web site after
the symposium.
Audio/Visual/Computer requirements
We will need an LCD projector for demonstration and ten computers to be shared by 20 participants. The computers will
need Java and a common IDE (or several) installed. We use Eclipse and emacs primarily. BlueJ may be helpful for the high
school instructor version. JUnit should also be installed.
Additional Information
This is a hands-on lab workshop. Participants will be paired at computers and given a program to write. We will discuss the
problem in general and mention some typical (selection dominated) solutions. We will then work toward a fully polymorphic
solution by discussing the necessary steps: Decomposition of behavior; Creation of objects; Mapping to the problem space.
After a simple demonstration by the presenters, a more complex problem will be done by the participants. We will end with a
further challenge that participants may work out on their own.
Download