Pedagogical Pattern #36
Tool Box Pattern
(Version 1.2, October 1998)
Contributed by:
Joseph Bergin
Pace University
One Pace Plaza
New York, NY 10038 USA
berginf@pace.edu
NAME:
Tool Box
THUMBNAIL:
The intent is to let the students build a tool kit in early courses for use in later courses. If well thought out and implemented, it can be a wonderful guide to reusable software. Students become apprentices in the same sense that young people once served as apprentices in medieval guilds. There they spent their early years building tools they would need if they were to achieve master status in the guild.
Students build things in early courses that will actually be used later in the same course and in later courses as well.
AUDIENCE/ CONTEXT:
The pattern is used most heavily in the early programming courses, especially the data structures course. However, it can be added to as well as used in later courses such as database, AI, operating systems, compilers, and the like.
FORCES:
Students in later programming courses make use of knowledge from earlier courses, but in the past made little use of the actual programs built there.
Having a personal tool kit of reusable software components can be a wonderful help in a difficult project.
Building a tool kit stresses different, but important, skills.
SOLUTION:
Student exercises have multiple parts. One part of each exercise is to build a general tool that might be useful in other projects and to take some effort in its proper formulation for reuse. The design for reuse must be explicit and must be discussed by the students and commented on by the instructor. Groups of students can combine individual designs of the tools, discuss the relative merits of each and then build a common implementation that improves each of the individual designs.
DISCUSSION/ CONSEQUENCES/ IMPLEMENTATION:
Students gain skill in the early courses building reusable components. To the extent that they fail, the lessons are reinforced in the later courses when they need to rebuild parts of the tool kit for use in the projects of those course. Languages supporting reusability need to be used. Most of these languages are either object-oriented or functional. Scheme, C++, Eiffel, Java, Ada are good choices. There are a few others such as Modula 3, Beta, Oberon, CLOS, and Standard ML. Languages supporting genericity (templates) are especially useful.
Instructors can provide some tools (data structures and algorithms) in the form of class hierarchies or other libraries. Students complement this collection. Time should be spent by students and instructor evaluating student built tools for correctness, of course, but also for the potential for reusability. Instructors in later courses must be aware that students have these personal tool kits and should use exercises and projects that exploit the tool kits and permit their extension.
Coordination with later courses is an important element of this pattern.
SPECIAL RESOURCES:
Thought needs to be given in the design of the early courses as to what tools are broadly useful, but especially which tools will necessarily be useful in later courses. Thought should also be given to platform independence of the tools. The instructor needs a plan and must be able to provide implementations of those tools that the students will need, but will not build themselves. For example, the instructor can give a singly linked list and have students build a doubly linked list. Both would be included in the toolkit.
RELATED PATTERNS:
- Fixer Upper can be used by the instructor to provide partially flawed tools for the students to comment on and repair.
- Tools can be built as part of each cycle of a Spiral.
See Also: Fixer Upper, Spiral, Mistake, Early Bird, Toy Box, Tool Box, Lay of the Land, Test Tube and Larger Than Life as a pattern language.
EXAMPLE INSTANCES:
Kernighan & Plauger's Software Tools books were a good use of this pattern. This book should probably be read by anyone who wants to implement this pattern. It shows how a high degree of reusability can be achieved with extremely simple tools.
Many data structures, with only slight modification, could be taken as early examples of this pattern.
Lisp, ML, and Scheme depend heavily on libraries of functions. These can be built in early courses and used later.
CONTRAINDICATIONS:
This pattern is probably not for use in theoretical or "concept" courses.
REFERENCES:
Software Tools in Pascal, Brian Kernighan, P.J. Plauger, Addison Wesley, 1981