search for books and compare prices
Tables of Contents for An Introduction to Object-Oriented Programming
Chapter/Section Title
Page #
Page Count
Preface
Thinking Object-Oriented
Why is OOP Popular?
2
1
Language and Thought
2
5
Eskimos and snow
3
1
An example from computer languages
3
2
Church's conjecture and the Whorf hypothesis
5
2
A New Paradigm
7
1
A Way of Viewing the World
8
7
Agents and communities
9
1
Messages and methods
10
1
Responsibilities
11
1
Classes and instances
11
1
Class hierarchies--inheritance
12
2
Method binding and overriding
14
1
Summary of object-oriented concepts
14
1
Computation as Simulation
15
3
The power of metaphor
16
1
Avoiding infinite regression
17
1
A Brief History
18
7
Summary
19
1
Further Reading
20
2
Self-Study Questions
22
1
Exercises
23
2
Abstraction
25
24
Layers of Abstraction
26
4
Other Forms of Abstraction
30
9
Division into parts
32
1
Encapsulation and interchangeability
32
1
Interface and implementation
33
1
The service view
34
1
Composition
34
2
Layers of specialization
36
2
Patterns
38
1
A Short History of Abstraction Mechanisms
39
10
Assembly language
39
1
Procedures
40
1
Modules
41
2
Abstract data types
43
1
A service-centered view
44
1
Messages, inheritance, and polymorphism
44
1
Summary
45
1
Further Information
46
1
Self-Study Questions
47
1
Exercises
47
2
Object-Oriented Design
49
24
Responsibility Implies Noninterference
50
1
Programming in the Small and in the Large
51
1
Why Begin with Behavior?
51
1
A Case Study in RDD
52
3
The Interactive Intelligent Kitchen Helper
53
1
Working through scenarios
53
1
Identification of components
54
1
CRC Cards--Recording Responsibility
55
2
Give components a physical representation
55
1
The what/who cycle
56
1
Documentation
56
1
Components and Behavior
57
5
Postponing decisions
58
1
Preparing for change
59
1
Continuing the scenario
59
2
Interaction diagrams
61
1
Software Components
62
3
Behavior and state
62
1
Instances and classes
63
1
Coupling and cohesion
63
1
Interface and implementation--Parnas's principles
64
1
Formalize the Interface
65
2
Coming up with names
65
2
Designing the Representation
67
1
Implementating Components
67
1
Integration of Components
68
1
Maintenance and Evolution
69
4
Summary
69
1
Further Reading
70
1
Self-Study Questions
70
1
Exercises
71
2
Classes and Methods
73
28
Encapsulation
73
1
Class Definitions
74
6
C++, Java, and C#
75
2
Apple Object Pascal and Delphi Pascal
77
1
Smalltalk
77
2
Other languages
79
1
Methods
80
7
Order of methods in a class declaration
82
1
Constant or immutable data fields
83
1
Separating definition and implementation
83
4
Variations on Class Themes
87
14
Methods without classes in Oberon
87
1
Interfaces
88
1
Properties
89
1
Forward definitions
90
1
Inner or nested classes
91
3
Class data fields
94
2
Classes as objects
96
1
Summary
97
1
Further Reading
97
1
Self-Study Questions
98
1
Exercises
98
3
Messages, Instances, and Initialization
101
24
Message-Passing Syntax
101
2
Statically and Dynamically Typed Languages
103
1
Accessing the Receiver from within a Method
104
2
Object Creation
106
2
Creation of arrays of objects
107
1
Pointers and Memory Allocation
108
3
Memory recovery
109
2
Constructors
111
6
The orthodox canonical class form
115
1
Constant values
116
1
Destructors and Finalizers
117
3
Metaclasses in Smalltalk
120
5
Summary
122
1
Further Reading
122
1
Self-Study Questions
123
1
Exercises
123
2
A Case Study: The Eight-Queens Puzzle
125
22
The Eight-Queens Puzzle
125
2
Creating objects that find their own solution
126
1
Using Generators
127
3
Initialization
128
1
Finding a solution
129
1
Advancing to the next position
129
1
The Eight-Queens Puzzle in Several Languages
130
17
The eight-queens puzzle in Object Pascal
130
3
The eight-queens puzzle in C++
133
3
The eight-queens puzzle in Java
136
3
The eight-queens puzzle in Objective-C
139
3
The eight-queens puzzle in Smalltalk
142
1
The eight-queens puzzle in Ruby
143
2
Summary
145
1
Further Reading
145
1
Self-Study Questions
145
1
Exercises
146
1
A Case Study: A Billiards Game
147
14
The Elements of Billiards
147
1
Graphical Objects
148
7
The wall graphical object
149
1
The hole graphical object
150
1
The ball graphical object
151
4
The Main Program
155
1
Using Inheritance
156
5
Summary
159
1
Further Information
159
1
Self-Study Questions
159
1
Exercises
160
1
Inheritance and Substitution
161
26
An Intuitive Description of Inheritance
161
3
The is-a test
162
1
Reasons to use inheritance
162
2
Inheritance in Various Languages
164
2
Subclass, Subtype, and Substitution
166
2
Substitution and strong typing
167
1
Overriding and Virtual Methods
168
2
Interfaces and Abstract Classes
170
1
Forms of Inheritance
171
5
Subclassing for specialization (subtyping)
171
1
Subclassing for specification
171
1
Subclassing for construction
172
1
Subclassing for generalization
173
1
Subclassing for extension
174
1
Subclassing for limitation
174
1
Subclassing for variance
174
1
Subclassing for combination
175
1
Summary of the forms of inheritance
175
1
Variations on Inheritance
176
3
Anonymous classes in Java
176
1
Inheritance and constructors
177
1
Virtual destructors
178
1
The Benefits of Inheritance
179
2
Software reusability
179
1
Code sharing
179
1
Consistency of interface
179
1
Software components
179
1
Rapid prototyping
180
1
Polymorphism and frameworks
180
1
Information hiding
180
1
The Costs of Inheritance
181
6
Execution speed
181
1
Program size
181
1
Message-passing overhead
181
1
Program complexity
182
1
Summary
182
1
Further Reading
183
1
Self-Study Questions
183
1
Exercises
184
3
A Case Study--A Card Game
187
20
The Class PlayingCard
187
2
Data and View Classes
189
1
The Game
190
1
Card Piles--Inheritance in Action
191
8
The default card pile
193
1
The suit piles
194
1
The deck pile
194
2
The discard pile
196
1
The tableau piles
197
2
Playing the Polymorphic Game
199
1
The Graphical User Interface
199
8
Summary
204
1
Further Reading
204
1
Self-Study Questions
204
1
Exercises
205
2
Subclasses and Subtypes
207
14
Substitutability
207
1
Subtypes
208
3
The Substitutability Paradox
211
1
Is this a problem?
212
1
Subclassing for Construction
212
3
Private inheritance in C++
214
1
Dynamically Typed Languages
215
1
Pre-and Postconditions
216
1
Refinement Semantics
217
4
Summary
218
1
Further Reading
218
1
Self-Study Questions
219
1
Exercises
219
2
Static and Dynamic Behavior
221
14
Static versus Dynamic Typing
221
2
Static and Dynamic Classes
223
7
Run-time type determination
225
2
Down casting (reverse polymorphism)
227
1
Run-time testing without language support
227
2
Testing message understanding
229
1
Static versus Dynamic Method Binding
230
5
Summary
232
1
Further Reading
233
1
Self-Study Questions
233
1
Exercises
234
1
Implications of Substitution
235
18
Memory Layout
235
7
Minimum static space allocation
237
3
Maximum static space allocation
240
1
Dynamic memory allocation
240
2
Assignment
242
3
Assignment in C++
242
3
Copies and Clones
245
2
Copies in Smalltalk and Objective-C
245
1
Copy constructors in C++
245
1
Cloning in Java
246
1
Equality
247
6
Equality and identity
247
1
The paradoxes of equality testing
248
2
Summary
250
1
Further Reading
251
1
Self-Study Questions
251
1
Exercises
251
2
Multiple Inheritance
253
22
Inheritance as Categorization
254
3
Incomparable complex numbers
255
2
Problems Arising from Multiple Inheritance
257
6
Name ambiguity
257
2
Impact on substitutability
259
1
Redefinition in Eiffel
260
1
Resolution by class ordering in CLOS
261
2
Multiple Inheritance of Interfaces
263
4
Mixins in CLOS
266
1
Inheritance from Common Ancestors
267
4
Constructors and multiple inheritance
270
1
Inner Classes
271
4
Summary
272
1
Further Reading
273
1
Self-Study Questions
273
1
Exercises
273
2
Polymorphism and Software Reuse
275
12
Polymorphism in Programming Languages
275
2
Many tools, one goal
277
1
Mechanisms for Software Reuse
277
6
Using composition
278
2
Using inheritance
280
2
Composition and inheritance contrasted
282
1
Efficiency and Polymorphism
283
1
Will Widespread Software Reuse Become Reality?
284
3
Summary
285
1
Further Information
285
1
Self-Study Questions
286
1
Exercises
286
1
Overloading
287
22
Type Signatures and Scopes
288
1
Overloading Based on Scopes
289
1
Overloading Based on Type Signatures
290
9
Coercion and conversion
293
6
Redefinition
299
2
Polyadicity
301
2
Optional parameters
303
1
Multi-Methods
303
6
Overloading Based on Values
306
1
Summary
306
1
Further Information
306
1
Self-Study Questions
307
1
Exercises
307
2
Overriding
309
26
Notating Overriding
311
2
Replacement versus Refinement
313
7
Replacement in Smalltalk
313
3
Refinement in Beta
316
3
Refinement and the subclass/subtype distinction
319
1
Wrappers in CLOS
319
1
Deferred Methods
320
2
Overriding versus Shadowing
322
2
Covariance and Contravariance
324
5
Variations on Overriding
329
6
Final methods in Java
329
1
Versioning in C#
330
1
Summary
331
1
Further Information
332
1
Self-Study Questions
332
1
Exercises
332
3
The Polymorphic Variable
335
14
Simple Polymorphic Variables
335
2
The Receiver Variable
337
6
The role of the polymorphic variable in frameworks
339
1
Endpoint comparisons in Smalltalk
340
1
Self and super
341
2
Downcasting
343
1
Pure Polymorphism
344
5
Summary
347
1
Further Information
347
1
Self-Study Questions
348
1
Exercises
348
1
Generics
349
14
Template Functions
349
2
Template Classes
351
2
Bounded genericity
353
1
Inheritance in Template Arguments
353
3
Inheritance and arrays
355
1
Case Study--Combining Separate Classes
356
7
Summary
360
1
Further Reading
360
1
Self-Study Questions
360
1
Exercises
360
3
Container Classes
363
26
Containers in Dynamically Typed Languages
363
2
Containers in Smalltalk-80
364
1
Containers in Statically Typed Languages
365
11
The tension between typing and reuse
366
2
Substitution and downcasting
368
4
Using substitution and overriding
372
2
Parameterized classes
374
2
Restricting Element Types
376
2
Element Traversal
378
11
Iterator loops
379
2
The visitor approach
381
4
Summary
385
1
Further Reading
386
1
Self-Study Questions
387
1
Exercises
387
2
A Case Study: The STL
389
18
Iterators
391
2
Function Objects
393
1
Example Program--An Inventory System
394
2
Example Program--Graphs
396
6
Shortest path algorithm
399
1
Developing the data structures
399
3
A Concordance
402
3
The Future of OOP
405
2
Summary
406
1
Further Reading
406
1
Self-Study Questions
406
1
Exercises
406
1
Frameworks
407
16
Reuse and Specialization
407
6
High- and low-level abstractions
410
2
An upside-down library
412
1
Example Frameworks
413
10
The Java Applet API
413
1
A Simulation Framework
414
1
An event-driven simulation framework
415
7
Summary
422
1
Further Reading
422
1
Self-Study Questions
422
1
Exercises
422
1
An Example Framework: The AWT and Swing
423
18
The AWT Class Hierarchy
423
3
The Layout Manager
426
2
Listeners
428
2
Adapter clases
429
1
User Interface Components
430
3
Case Study: A Color Display
433
4
The Swing Component Library
437
1
Import Libraries
437
1
Different components
437
1
Different paint protocol
438
1
Adding components to a window
438
1
Summary
438
1
Further Reading
439
1
Self-Study Questions
439
1
Exercises
439
2
Object Interconnections
441
23
Coupling and Cohesion
442
8
Varieties of coupling
442
3
Varieties of cohesion
445
2
The law of Demeter
447
1
Class-level versus object-level visibility
448
1
Active values
449
1
Subclass Clients and User Clients
450
1
Control of Access and Visibility
451
8
Visibility in Smalltalk
451
1
Visibility in Object Pascal
452
1
Visibility in C++
452
5
Visibility in Java
457
1
Visibility in Objective-C
458
1
International Dependency
459
5
Summary
460
1
Further Reading
460
1
Self-Study Questions
461
1
Exercises
461
3
Desing Patterns
464
15
Controlling Information Flow
464
1
Describing Patterns
465
1
Iterator
466
1
Software Factory
467
1
Strategy
468
1
Singleton
469
1
Composite
469
2
Decorator
471
1
The Double-Dispatching Pattern
472
2
Flyweight
474
1
Proxy
474
1
Facade
475
1
Observer
475
4
Summary
476
1
Further Reading
477
1
Self-Study Questions
478
1
Exercises
478
1
Reflection and Introspection
479
14
Mechanisms for Understanding
479
6
Class objects
479
2
The class name as string
481
1
Testing the class of an object
481
2
Creating an instance from a class
483
1
Testing if an object understands a message
484
1
Class behavior
484
1
Methods as Objects
485
1
Mechanisms for Modification
486
3
Method editing in Smalltalk
486
1
Dynamic class loading in Java
487
2
Metaclasses
489
4
Summary
491
1
Further Reading
491
1
Self-Study Questions
492
1
Distributed Objects
493
18
Addresses, Ports, and Sockets
494
2
A Simple Client/Server Program
496
2
Multiple Clients
498
6
Transmitting Objects over a Network
504
3
Providing More Complexity
507
4
Summary
507
1
Further Reading
508
1
Self-Study Questions
508
1
Exercises
508
3
Implementation
511
16
Compilers and Interpreters
511
1
The Receiver as Argument
512
1
Inherited Methods
513
2
The problem of multiple inheritance
514
1
The slicing problem
515
1
Overridden Methods
515
3
Eliminating virtual calls and in-lining
517
1
Name Encoding
518
1
Dispatch Tables
518
3
A method cache
520
1
Bytecode Interpreters
521
2
Just-in-Time Compilation
523
4
Summary
524
1
Further Reading
524
1
Self-Study Questions
525
1
Exercises
525
2
A Source for the Eight-Queens Puzzle
527
16
A.1 Eight-Queens in Apple Object Pascal
527
3
A.2 Eight-Queens in C++
530
2
A.3 Eight-Queens in Java
532
4
A.4 Eight-Queens in Objective-C
536
3
A.5 Eight-Queens in Ruby
539
2
A.6 Eight-Queens in Smalltalk
541
2
B Source for the Billiards Game
543
14
B.1 The Version without Inheritance
543
9
B.2 The Version with Inheritance
552
5
C Source for the Solitaire Game
557
12
Glossary
569
16
References
585
14
Index
599