Java: Object-Oriented Design - Inheritance

Inheritance is one of the fundamental OOP technologies. Each class can be defined to inherit the data and methods from another class. This idea is extremely powerful and can lead to enormously productivity as it becomes easy to build on work that is already done.

Not so common? As powerful as it is, it is also only really useful in solving certain problems; in fact many OO programs never make us of it in any explicity way.

GUI systems are one of the common areas where inheritance is used to great benefit. Most GUI systems have an extensive hierarchy of inheritance.

Topics to be covered

Java features

Java has many feature for defining inheritance, referencing inherited classes, controlling inheritance, etc.

Controversy - Open inheritance vs closed inheritance

One issue when designing source code that might be used by others is whether you should allow them to subclass your classes.

See DesignedInheritance for Martin Fowler's discussion of this issue.