| Contents | 7 |
---|
| About the Author | 22 |
---|
| About the Technical Reviewer | 23 |
---|
| Acknowledgments | 24 |
---|
| Preface | 25 |
---|
| Introduction | 26 |
---|
| Part 1 The ABCs of Objects | 37 |
---|
| Chapter 1 Abstraction and Modeling | 38 |
| Simplification Through Abstraction | 38 |
| Generalization Through Abstraction | 39 |
| Reuse of Abstractions | 44 |
| Inherent Challenges | 45 |
| Summary | 47 |
| Chapter 2 Some Java Basics | 50 |
| Why Java? | 50 |
| Anatomy of a Simple Java Program | 59 |
| The Mechanics of Java | 63 |
| Primitive Types | 67 |
| Variables | 68 |
| Variable Initialization | 70 |
| The String Type | 71 |
| Case Sensitivity | 72 |
| Java Expressions | 73 |
| Automatic Type Conversions and Explicit Casting | 77 |
| Loops and Other Flow-Control Structures | 79 |
| Block-Structured Languages and the Scope of a Variable | 88 |
| Printing to the Screen | 89 |
| Elements of Java Style | 93 |
| Summary | 98 |
| Chapter 3 Objects and Classes | 100 |
| Software at Its Simplest | 100 |
| What Is an Object? | 103 |
| What Is a Class? | 106 |
| Instantiation | 109 |
| Encapsulation | 110 |
| User-Defined Types and Reference Variables | 111 |
| Instantiating Objects: A Closer Look | 112 |
| Objects As Attributes | 120 |
| Three Distinguishing Features of an Object- Oriented Programming Language | 127 |
| Summary | 127 |
| Chapter 4 Object Interactions | 129 |
| Events Drive Object Collaboration | 129 |
| Declaring Methods | 131 |
| Methods Implement Business Rules | 141 |
| Objects As the Context for Method Invocation | 142 |
| Method Overloading | 149 |
| Message Passing Between Objects | 150 |
| Delegation | 152 |
| Obtaining Handles on Objects | 153 |
| Objects As Clients and Suppliers | 156 |
| Information Hiding/Accessibility | 158 |
| Public Accessibility | 159 |
| Accessing Private Features from Client Code | 166 |
| The Power of Encapsulation Plus InformationHiding | 172 |
| Exceptions to the Public/Private Rule | 181 |
| Constructors | 184 |
| Software at Its Simplest, Revisited | 195 |
| Summary | 197 |
| Chapter 5 Relationships Between Objects | 200 |
| Associations and Links | 200 |
| Aggregation and Composition | 206 |
| Inheritance | 207 |
| Three Distinguishing Features of an OOPL, Revisited | 242 |
| Summary | 242 |
| Chapter 6 Collections of Objects | 246 |
| What Are Collections? | 246 |
| Three Generic Types of Collection | 249 |
| Arrays As Simple Collections | 252 |
| A More Sophisticated Type of Collection: The ArrayList Class | 260 |
| The HashMap Collection Class | 273 |
| The TreeMap Class | 279 |
| The Same Object Can Be Simultaneously Referenced by Multiple Collections | 281 |
| Inventing Our Own Collection Types | 282 |
| Collections As Method Return Types | 292 |
| Collections of Derived Types | 293 |
| Revisiting Our Student Class Design | 294 |
| Summary | 303 |
| Chapter 7 Some Final Object Concepts | 305 |
| Polymorphism | 306 |
| Abstract Classes | 314 |
| Interfaces | 322 |
| Static Features | 345 |
| Summary | 359 |
| Part 2 Object Modeling 101 | 362 |
---|
| Chapter 8 The Object Modeling Process in a Nutshell | 363 |
| The Big Picture Goal of Object Modeling | 363 |
| Jacquie s Recommended Object Modeling Process,in a Nutshell | 367 |
| Summary | 371 |
| Chapter 9 Formalizing Requirements Through Use Cases | 372 |
| What Are Use Cases? | 373 |
| Actors | 375 |
| Specifying Use Cases | 379 |
| Matching Up Use Cases with Actors | 380 |
| To Diagram or Not to Diagram? | 380 |
| Summary | 382 |
| Chapter 10 Modeling the Static/Data Aspects of the System | 383 |
| Identifying Appropriate Classes | 384 |
| Producing a Data Dictionary | 395 |
| Determining Associations Between Classes | 396 |
| Identifying Attributes | 400 |
| UML Notation: Modeling the Static Aspects of an Abstraction | 400 |
| Object Diagrams | 414 |
| Associations As Attributes | 416 |
| Information Flows Along an Association Pipeline | 417 |
| Mixing and Matching Relationship Notations | 423 |
| Association Classes | 425 |
| Our Completed Student Registration System Class Diagram | 428 |
| Metadata | 434 |
| Summary | 435 |
| Chapter 11 Modeling the Dynamic/Behavioral Aspects of the System | 437 |
| How Behavior Affects State | 438 |
| Scenarios | 443 |
| Sequence Diagrams | 447 |
| Using Sequence Diagrams to Determine Methods | 452 |
| Communication Diagrams | 454 |
| Revised SRS Class Diagram | 456 |
| Summary | 457 |
| Chapter 12 Wrapping Up Our Modeling Efforts | 459 |
| Testing the Model | 459 |
| Revisiting Requirements | 460 |
| Reusing Models: A Word About Design Patterns | 462 |
| Summary | 465 |
| Part 3 Translating an Object Blueprint into Java Code | 467 |
---|
| Chapter 13 Rounding Out Your Java Knowledge | 468 |
| Java-Specific Terminology | 468 |
| Java Application Architecture | 471 |
| Java Archive (JAR) Files | 473 |
| Javadoc Comments | 477 |
| The Object Nature of Strings | 484 |
| Message Chains | 497 |
| Object Self-Referencing with this | 499 |
| Java Exception Handling | 500 |
| Enum(eration)s | 528 |
| Providing Input to Command Line Driven Programs | 536 |
| Features of the Object Class | 549 |
| A Deeper Look Behind the Scenes of the JVM | 559 |
| The Date Class | 568 |
| Accessibility, Revisited | 574 |
| Variable Initialization, Revisited | 579 |
| Inner Classes | 581 |
| Additional J2SE 5.0 Enhancements | 584 |
| Summary | 591 |
| Chapter 14 Transforming Your Model into Java Code | 594 |
| Suggestions for Getting the Maximum Value from Thi
|