The heart of object-oriented design is polymorphism, and in order to use it we need to understand how and when to utilize inheritance and interfaces. You have previously learned the syntax for inheritance, and in this sprint we will discuss how to know when a class should be split into two, when an inheritance structure is called for, and when to choose to use interfaces.
How to create inheritance hierarchies in Java, and what the benefits of polymorphism are
How to use interfaces in Java
Reasons for choosing inheritance or interface & abstract or concrete
For each of these design principles, know what it means, why it leads to "good" code, and which coding practices support it:
Open/Closed Principle
Loose Coupling
High Cohesion
DRY, Shy, and Tell the Other Guy
5. Definitions of Refactoring, Code smells, and Design by Refactoring
6. Know common code smells, which design principles they violate, and how to refactor them
Design Principles:
Lecture slides on Open-Closed, Coupling, Cohesion, and OO in One Sentence
(Article) OO in One Sentence
(Book Chapter) Design Principles: Originality is Overrated, from Book Head-First Object-Oriented Analysis and Design (Note: We will NOT cover the LSP yet)
(Online article) Coupling and Cohesion
(Book Chapter) The Open-Closed Principle from book Agile Principles, Patterns, and Practices
(Book Chapter) Functions from Clean Code (covers Step-Down Design)
Java Abstractions: Hierarchies and Interfaces
Lecture Slides on Abstractions
(Article) When and How to Extract a Class
(Article) A Systematic Approach to Writing Better Code with OOP Concepts
(Reference) Oracle Tutorial on Interfaces,
(Book Chapter) Mastering Inheritance and Composition, from book The Object-Oriented Thought Process
(Book Chapter) Classes and Objects, from book Object-Oriented Analysis and Design with Applications
Refactoring and Code Smells
(Book Chapter) Bad Smells in Code, from book Refactoring: Improving the Design of Existing Code
(Online Reference) Code Smells
Example of Factory: