Inheritance Lecture
This lecture is required only for the additional higher grade tasks.
To Read
- Section 9.3 of A First Course in Object Oriented Development, and the pattern Template Method, which is described in section 9.4.
Recording, Part 1
Content, Part 1
00:00 Introduction to inheritance
02:01 The difference between polymorphism, interface implementation, and inheritance
05:22 A first example of inheritance
08:38 Overriding a method
12:14 The difference between declaration och implementation
15:36 Calling a method in the superclass
18:23 Protected accessibility, and how to represent inheritance in UML
Recording, Part 2
Inheritance Lecture, Part 2 Links to an external site.
Content, Part 2
00:00 Introduction to the lecture
00:23 First inheritance downside, code reuse becomes hard
08:06 Second inheritance downside, inheritance breaks encapsulation
25:15 Third inheritance downside, no control over public interface
29:00 Conditions for using inheritance
34:00 Examples of appropriate use of inheritance
Recording, Part 3
Inheritance Lecture, Part 3 Links to an external site.
Content, Part 1
00:00 Introduction to the lecture
00:40 The template method design pattern
06:02 The coursebook example of template method
11:30 Template method implementation in the coursebook example
Solutions to Exercises
Here's a NetBeans project with the template method implementation that was written in part three, oodbook-examples-des-pat-with-temp-met.zip Download oodbook-examples-des-pat-with-temp-met.zip. The other code examples written during the lecture are identical to the code in the text book's git repository, https://github.com/oodbook/code/