Objectives This chapter is intended to provide an overview of the object-oriented
software development approach. We start with a general discussion on software
development and the desirable qualities of software products, followed
by a discussion on what makes software development difficult and the difference
between software engineering and other, more established engineering practices.
Then, we introduce the basic principles, concepts, processes, and techniques
of the object-oriented development approach. We also introduce a graphical
notation for object-oriented analysis and modeling, and conclude the chapter
with a case study of object-oriented analysis and modeling.
Contents 4.1 Overloading
4.2 Inheritance
4.2.1 Constructors of Extended Classes
4.2.2 Subtypes and Polymorphism
4.2.3 Overriding Methods
4.2.4 Restriction
4.3 Extending and Implementing Interfaces
4.4 Hiding Fields and Static Methods
4.5 Designing Classes
4.5.1 Avoiding Public Fields
4.5.2 Separating Interface From Implementation
4.5.3 File Organization
4.5.4 The Canonical Form
4.5.5 Class Organization
4.5.6 Documentation
4.5.7 Unit Testing
4.6 Applications --- Animation Applets
4.6.1 Getting Parameters
4.6.2 An Idiom for Animation
4.6.3 Using Double-Buffering
4.6.4 Reading Files In Applets
This is a simple animation applet. It displays a text banner that moves
horizontally from left to right. When the banner moves completely off of
the left end of the viewing area, it reappears at the right end.
This program illustrates the Animation Applet Idiom, graphics drawing,
and double buffering. This applet shows a ball moving inside a rectangular
box. The ball reverses direction when it touches any of the four sides
of the box.