Summary

A major change that has accompanied the advent of object-oriented programming is that programming is now a matter of extending an existing code base. Talented Java developers spend more time reading than writing, to understand how their code will fit with and benefit from the voluminous class libraries. One class that you should be especially sure to understand is Object, the superclass from which all your classes will derive.

The subclasses you create should be logical and consistent extensions of their superclasses. The Java compiler will enforce some aspects of consistency; in many areas, however, consistency is a matter of judgment. The Liskov Substitution Principle suggests that subtypes should uphold the behavior of supertypes. ...

Get Design Patterns Java™ Workbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.