Unit 3: Object Orientation and Re-usability
Unit Overview
This unit will teach you how to group objects into classes and will discuss the concepts of superclass and subclass. Inheritance can be used as a mechanism to propagate attributes and methods from superclasses to subclasses. This unit will also discuss static binding and dynamic binding concepts and how dynamic binding contributes to polymorphism. The Java Collections Framework at the end of this unit consists of many predefined classes that encapsulate data structures and can be used to hold a collection of elements.
Learning Outcomes
After completing this unit, you should be able to
- describe the differences between generalization and specialization;
- describe the differences between an abstract class and a concrete class;
- explain how inheritance enables code reuse, enhances software maintainability, and enables class extension;
- explain how dynamic binding contributes to polymorphism;
- use three types of Collection class: ArrayList, HashSet, and HashMap.
Learning Activities
- Read the Learning Notes and follow the links to read the recommended online materials.
- Read the Review Questions and use the discussion board of this course to
- answer any two of the review questions;
- share any useful information about the supplemental reading materials that you have read;
- comment on another student’s response to the review questions;
- answer any questions posed to you.
- Complete the Unit Exercise and share the experience with your peers on the discussion board. [Note: Do not post assignment-relevant pseudocodes or source codes at any time; however, you can post your thoughts, ideas, and problem-solving steps.]
Learning Notes
Read the following recommended online materials:
- Poo, D., Kiong, D., & Ashok, S. (2008). Object-Oriented Programming and Java (2nd ed.). London: Springer-Verlag.
- Read Chapter 5: Classification, Generalization, and Specialization (pp. 51–59).
- Read Chapter 6: Inheritance (pp. 61–91).
- Read Chapter 7: Polymorphism (pp. 93–102).
- Read Section 12.4: Collections Framework (pp. 186–195).
- Read Section 13.5: Other Kinds of Class Definitions (pp. 226–230).