Object-oriented programming poses considerable problems for first-year students, and for their teachers. Concepts such as class and object, inheritance, and polymorphism are difficult for students to grasp. No less difficult is the implementation of object-oriented concepts in constructs, such as that of interface in Java. This paper provides guidance for teachers attempting to address these issues.
The paper provides teachers and textbook authors with valuable insights and information. The author, using Design patterns [1], a seminal text in object-oriented programming, discusses the definition, implementation, and complexities associated with interfaces. The author then presents the results of a survey of more than two dozen introductory texts that graphically maps how they discuss the Java interface. The chart allows teachers to compare and contrast approaches, and it dramatically illustrates the author’s point that, with few exceptions, textbooks do not adhere to Gamma’s principle that interfaces be prominently discussed in the context of subtyping and polymorphism.
The author concludes with a proposed order of presentation of object-oriented concepts and implementations: writing standalone classes, acquiring familiarity with encapsulation; substitutability and interoperability; and interfaces, which put theory into practice. Inheritance and extension then follow. The author presents a strong case for his order of presentation, but other teachers and authors adopt a different order, for equally strong reasons. This paper thus provides a basis for further discussion on the issue.