At the end of this lecture, you’ll be able to:
- Criticize design decisions for a simple type hierarchy in Java made by employing inheritance mechanism.
- Recognize the usefulness of abstract classes and abstract methods to provide code reuse as well as a common interface among subtypes.
- Identify the syntax of Java Abstract Classes and contrast it with the syntax of Java Interfaces.
- Contrast the utility of abstract classes and interfaces.
- Catalogue class relationships into is-a and has-a classes and further separate is-a relationships into “extends” and “implements” types.
- Distinguish between interfaces and implementations.
- Define what is an Abstract Data Type (ADT).
- Declare an ADT using a Java interface, with complete Javadoc comments.
- Understand the importance and use of pre- and post-conditions for methods documentation.
- Write pre- and post-conditions for a given method definition within the Javadoc framework.
In this lecture, we'll cover the following lessons:
- The Roster Class: Two Types of Roster
- Two Types of Roster: Critique Design Decisions⚡
- Two Types of Roster: Using an Abstract Class⚡
- Two Types of Roster: Extending an Abstract Class
- The Roster Class: An Abstract Data Type!
- Java Interlude: Abstract Classes
- Java Interlude: Java Interfaces
- Java Interlude: Implementing Interfaces
- Java Interfaces: The Nuances
- Class Diagram: Exercise⚡
- IndexedList: Our first ADT!
- IndexedList: Code Contracts Using Documentation Comments
Lessons marked with ⚡ contain exercise/activity.