Patterns for decoupling data structures and algorithms

  • Authors:
  • Dung (“Zung”) Nguyen;Stephen B. Wong

  • Affiliations:
  • Dept. of Mathematics/Computer Science, Pepperdine University, Malibu, CA;Computer Science Program, Oberlin College, Oberlin, OH

  • Venue:
  • SIGCSE '99 The proceedings of the thirtieth SIGCSE technical symposium on Computer science education
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

Abstract

In order to build a data structure that is extensible and reusable, it is necessary to decouple the intrinsic and primitive behavior of the structure from the application specific behavior that manipulates it. To illustrate such a construction, this paper proposes a uniform object-oriented structural pattern for recursive data structures, and shows how external algorithms can be added without rewriting any code using the visitor design pattern. By presenting data structures in this manner, we can more effectively teach students about recursion, abstraction, design, and good software engineering practices.