This text is an introduction to object-oriented (OO) design for second-year or higher
undergraduate computer science students. It discusses software design and implementation
in terms of “elegance,” which is defined in Chapter 1. It reviews the concepts
of object-oriented programming and then covers fundamental software design
techniques, coding style, refactoring, UML, and design patterns.
It uses many examples and one small and two moderate-size case studies to introduce
design principles and patterns. The principles and patterns are introduced at
the point where they are needed to solve a design problem. In this text, many examples
and case studies start with an “obvious” solution to a problem, which evolves to
a more elegant solution through a discussion of the advantages and disadvantages of
that initial solution.
The book is not intended to be a complete, definitive “bible” regarding elegance
in coding and design. Instead, it is an introduction to many of the topics that need
to be addressed in order to achieve such elegance. References for further study are
provided in the text for students who wish to pursue the topics further.
All the discussion and examples in the text use Java 1.5, but the concepts and
principles presented are mostly of a general object-oriented nature and so apply to
design and implementation using other object-oriented languages.
The book includes extensive exercises. There are an average of 18 exercises per
chapter in each of Chapters 2 to 9. These exercises include simple tests of the students’
understanding of the material in the chapters, but most of the exercises lead
in directions that could not be covered in the current text without straying too far
from the main subject and without making the text unwieldly large.