You are previewing The Object Primer.
O'Reilly logo
The Object Primer

Book Description

Scott Ambler, award-winning author of Building Object Applications that Work, Process Patterns, and More Process Patterns, has revised his acclaimed first book, The Object Primer. Long prized in its original edition by both students and professionals as the best introduction to object-oriented technology, this book is now completely up-to-date, with all modeling notation rewritten in the just-released UML 2.0. All chapters have been revised to take advantage of Agile Modeling (AM), which is presented in the new chapter 2 along with other important new modeling techniques. Review questions at the end of each chapter allow readers to test their newly acquired knowledge. In addition, the author takes time to reflect on the lessons learned over the past few years by discussing the proven benefits and drawbacks of the technology. This is the perfect book for any software development professional or student seeking an introduction to the concepts and terminology of object technology.

Table of Contents

  1. Coverpage
  2. The Object Primer
  3. Title page
  4. Copyright page
  5. Dedication
  6. Contents
  7. Acknowledgments
  8. Foreword
  9. Preface
  10. About the Author
  11. Chapter 1 Leading-Edge Software Development
    1. 1.1 Modern Development Technologies
      1. 1.1.1 Object Technology
      2. 1.1.2 Extensible Markup Language (XML)
      3. 1.1.3 Relational Database (RDB) Technology
      4. 1.1.4 Web Services
    2. 1.2 Modern Development Techniques
      1. 1.2.1 Agile Software Development
      2. 1.2.2 Unified Modeling Language (UML)
      3. 1.2.3 The Unified Process (UP)
      4. 1.2.4 Model-Driven Architecture (MDA)
      5. 1.2.5 Using Them Together
    3. 1.3 The Organization of This Book
    4. 1.4 The Case Studies
      1. 1.4.1 The Bank Case Study
    5. 1.5 What You Have Learned
  12. Chapter 2 Understanding the Basics–Object-Oriented Concepts
    1. 2.1 A Brief Overview of OO Concepts
    2. 2.2 OO Concepts from a Structured Point of View
    3. 2.3 The Diagrams of UML 2
    4. 2.4 Objects and Classes
    5. 2.5 Attributes and Operations/Methods
    6. 2.6 Abstraction, Encapsulation, and Information Hiding
      1. 2.6.1 Abstraction
      2. 2.6.2 Encapsulation
      3. 2.6.3 Information Hiding
      4. 2.6.4 An Example
    7. 2.7 Inheritance
      1. 2.7.1 Modeling Inheritance
      2. 2.7.2 Inheritance Tips and Techniques
      3. 2.7.3 Single and Multiple Inheritance
      4. 2.7.4 Abstract and Concrete Classes
    8. 2.8 Persistence
    9. 2.9 Relationships
      1. 2.9.1 Associations
      2. 2.9.2 Modeling the Unknown
      3. 2.9.3 How Associations Are Implemented
      4. 2.9.4 Properties
      5. 2.9.5 Aggregation and Composition
      6. 2.9.6 Dependencies
    10. 2.10 Collaboration
    11. 2.11 Coupling
    12. 2.12 Cohesion
    13. 2.13 Polymorphism
      1. 2.13.1 An Example: The Poker Game
      2. 2.13.2 Polymorphism at the University
    14. 2.14 Interfaces
    15. 2.15 Components
    16. 2.16 Patterns
    17. 2.17 What You Have Learned
    18. 2.18 Review Questions
  13. Chapter 3 Full Lifecycle Object-Oriented Testing (FLOOT)
    1. 3.1 The Cost of Change
    2. 3.2 Testing Philosophies
    3. 3.3 Full Lifecycle Object-Oriented Testing (FLOOT)
    4. 3.4 Regression Testing
    5. 3.5 Quality Assurance
    6. 3.6 Testing Your Models
      1. 3.6.1 Proving It with Code
      2. 3.6.2 Usage Scenario Testing
      3. 3.6.3 Prototype Reviews/Walkthroughs
      4. 3.6.4 User-Interface Testing
      5. 3.6.5 Model Reviews
      6. 3.6.6 When to Use Each Technique
    7. 3.7 Testing Your Code
      1. 3.7.1 Testing Terminology
      2. 3.7.2 Testing Tools
      3. 3.7.3 Traditional Code Testing Concepts
      4. 3.7.4 Object-Oriented Testing Techniques
      5. 3.7.5 Code Inspections
    8. 3.8 Testing Your System in Its Entirety
    9. 3.9 Testing by Users
    10. 3.10 Test-Driven Development (TDD)
    11. 3.11 What You Have Learned
    12. 3.12 Review Questions
  14. Chapter 4 Agile Model–Driven Development (AMDD)
    1. 4.1 Modeling Philosophies
    2. 4.2 Project Stakeholders
    3. 4.3 What Is Agile Modeling (AM)?
    4. 4.4 The Values of AM
    5. 4.5 The Principles of AM
    6. 4.6 The Practices of AM
    7. 4.7 Easing into Agile Modeling
    8. 4.8 Agile Model–Driven Development (AMDD)
      1. 4.8.1 How is AMDD Different?
    9. 4.9 Fundamental Information Gathering Skills
      1. 4.9.1 Interviewing
      2. 4.9.2 Observation
      3. 4.9.3 Brainstorming
    10. 4.10 Agile Documentation
    11. 4.11 Making Whiteboards Work for Software Development
    12. 4.12 AMDD and Other Agile Methodologies
    13. 4.13 Agile Modeling and Test-Driven Development (TDD)
    14. 4.14 What You Have Learned
    15. 4.15 Review Questions
  15. Chapter 5 Usage Modeling
    1. 5.1 Use Case Modeling
      1. 5.1.1 Starting Agile
      2. 5.1.2 Essential Use Case Diagrams
      3. 5.1.3 Identifying Actors
      4. 5.1.4 Writing an Essential Use Case
      5. 5.1.5 Identifying Use Cases
      6. 5.1.6 System Use Case Diagrams
      7. 5.1.7 System Use Cases
      8. 5.1.8 Writing Alternate Courses of Action
      9. 5.1.9 Other Use Case Styles
      10. 5.1.10 Comparing Essential and System Use Cases
      11. 5.1.11 Reuse in Use Case Models: <<extend>>, <<include>>, and Inheritance
      12. 5.1.12 Packages
      13. 5.1.13 Use Case Modeling Tips
      14. 5.1.14 Remaining Agile
    2. 5.2 User Stories
      1. 5.2.1 What About System User Stories?
    3. 5.3 Features
    4. 5.4 What You Have Learned
    5. 5.5 Review Questions
  16. Chapter 6 User-Interface Development
    1. 6.1 Essential User-Interface Prototyping
    2. 6.2 Traditional User-Interface Prototyping
    3. 6.3 User-Interface Flow Diagramming
    4. 6.4 Usability
    5. 6.5 User-Interface Design Strategies
    6. 6.6 Agile Stakeholder Documentation
    7. 6.7 What You Have Learned
    8. 6.8 Review Questions
  17. Chapter 7 Supplementary Requirements
    1. 7.1 Business Rules
    2. 7.2 Technical Requirements
    3. 7.3 Constraints
    4. 7.4 Object Constraint Language (OCL)
    5. 7.5 Glossaries
    6. 7.6 Supplementary Specifications
    7. 7.7 What You Have Learned
    8. 7.8 Review Questions
  18. Chapter 8 Conceptual Domain Modeling
    1. 8.1 Robustness Diagrams
    2. 8.2 Object Role Model (ORM) Diagrams
    3. 8.3 Class Responsibility Collaborator (CRC) Cards
    4. 8.4 Analysis Class Diagrams
      1. 8.4.1 Modeling Classes and Responsibilities
      2. 8.4.2 Modeling Associations
      3. 8.4.3 Introducing Reuse between Classes via Inheritance
      4. 8.4.4 Modeling Composition and Associations
      5. 8.4.5 Modeling Vocabularies
    5. 8.5 Logical Data Models (LDMs)
    6. 8.6 Applying Analysis Patterns Effectively
    7. 8.7 UML Object Diagram
    8. 8.8 Keeping Conceptual Domain Modeling Agile
    9. 8.9 What You Have Learned
    10. 8.10 Review Questions
  19. Chapter 9 Business Process Modeling
    1. 9.1 Data Flow Diagrams (DFDs)
    2. 9.2 Flowcharts
    3. 9.3 UML Activity Diagrams
    4. 9.4 What You Have Learned
    5. 9.5 Review Questions
  20. Chapter 10 Agile Architecture
    1. 10.1 Architecture Techniques and Concepts
      1. 10.1.1 Put Architectural Decisions Off as Long as Possible
      2. 10.1.2 Accept That Some Architectural Decisions Are Already Made
      3. 10.1.3 Prove It with Code
      4. 10.1.4 Set an Architectural Change Strategy
      5. 10.1.5 Consider Reuse
      6. 10.1.6 Roll Up Your Sleeves
      7. 10.1.7 Be Prepared to Make Trade-offs
      8. 10.1.8 Consider Adopting the Zachman Framework
      9. 10.1.9 Apply Architectural Patterns Gently
    2. 10.2 Looking to the Future with Change Cases
    3. 10.3 UML Package Diagrams
      1. 10.3.1 Class Package Diagrams
      2. 10.3.2 Data Package Diagrams
      3. 10.3.3 Use Case Package Diagrams
    4. 10.4 UML Component Diagrams
      1. 10.4.1 Interfaces and Ports
      2. 10.4.2 Designing Components
      3. 10.4.3 Creating Component Models
      4. 10.4.4 Remaining Agile
    5. 10.5 Free-Form Diagrams
    6. 10.6 UML Deployment Diagrams
    7. 10.7 Network Diagrams
    8. 10.8 Layering Your Architecture
    9. 10.9 What You Have Learned
    10. 10.10 Review Questions
  21. Chapter 11 Dynamic Object Modeling
    1. 11.1 UML Sequence Diagrams
      1. 11.1.1 Visual Coding Via Sequence Diagrams
      2. 11.1.2 How to Draw Sequence Diagrams
      3. 11.1.3 Keeping It Agile
    2. 11.2 UML Communication Diagrams
    3. 11.3 UML State Machine Diagrams
    4. 11.4 UML Timing Diagrams
    5. 11.5 UML Interaction Overview Diagrams
    6. 11.6 UML Composite Structure Diagrams
    7. 11.7 What You Have Learned
    8. 11.8 Review Questions
  22. Chapter 12 Structural Design Modeling
    1. 12.1 UML Class Diagrams
      1. 12.1.1 Modeling Methods during Design
      2. 12.1.2 Modeling Attributes during Design
      3. 12.1.3 Inheritance Techniques
      4. 12.1.4 Association and Dependency Techniques
      5. 12.1.5 Composition Techniques
      6. 12.1.6 Introducing Interfaces into Your Model
      7. 12.1.7 Class Modeling Design Tips
    2. 12.2 Applying Design Patterns Effectively
      1. 12.2.1 The Singleton Design Pattern
      2. 12.2.2 The Façade Design Pattern
      3. 12.2.3 Tips for Applying Patterns Effectively
    3. 12.3 Physical Data Modeling with the UML
    4. 12.4 What You Have Learned
    5. 12.5 Review Questions
      1. 12.5.1 The Bank Case Study Six Months Later
  23. Chapter 13 Object-Oriented Programming
    1. 13.1 Philosophies for Effective Programming
    2. 13.2 Programming Tips and Techniques for Writing High-Quality Code
    3. 13.3 Test-Driven Development (TDD)
      1. 13.3.1 TDD and AMDD
      2. 13.3.2 Why TDD?
    4. 13.4 From Object Design to Java Code
      1. 13.4.1 From UML Sequence Diagrams to Code
      2. 13.4.2 From UML Class Diagrams to Code
      3. 13.4.3 Implementing a Class in Java
      4. 13.4.4 Declaring Instance Attributes in Java
      5. 13.4.5 Implementing Instance Methods in Java
      6. 13.4.6 Implementing Static Methods and Attributes in Java
      7. 13.4.7 Documenting Methods
      8. 13.4.8 Implementing Constructors
      9. 13.4.9 Encapsulating Attributes with Accessors
      10. 13.4.10 Implementing Inheritance in Java
      11. 13.4.11 Implementing Interfaces in Java
      12. 13.4.12 Implementing Relationships in Java
      13. 13.4.13 Implementing Dependencies
      14. 13.4.14 Implementing Collaborations in Java
      15. 13.4.15 Implementing Business Rules
      16. 13.4.16 Iterate, Iterate, Iterate
    5. 13.5 What You Have Learned
    6. 13.6 Review Questions
  24. Chapter 14 Agile Database Development
    1. 14.1 Philosophies for Effective Data Development
    2. 14.2 Mapping Objects to Relational Databases
      1. 14.2.1 Shadow Information
      2. 14.2.2 Mapping Inheritance Structures
      3. 14.2.3 Mapping Relationships
    3. 14.3 Strategies for Implementing Persistence Code
    4. 14.4 From Design to Database Code
      1. 14.4.1 Defining and Modifying Your Persistence Schema
      2. 14.4.2 Creating, Retrieving, Updating, and Deleting Data
      3. 14.4.3 Interacting with a Database from Java
      4. 14.4.4 Implementing Your Mappings
    5. 14.5 Data-Oriented Implementation Strategies
      1. 14.5.1 Concurrency Control
      2. 14.5.2 Transaction Control
      3. 14.5.3 Shared Logic and Referential Integrity
      4. 14.5.4 Security Access Control
      5. 14.5.5 Searching for Objects
      6. 14.5.6 Reports
    6. 14.6 Database Refactoring
    7. 14.7 Legacy Analysis
      1. 14.7.1 Formalizing Contract Models
      2. 14.7.2 Common Legacy Challenges
      3. 14.7.3 Creating Contract Models
    8. 14.8 What You Have Learned
    9. 14.9 Review Questions
  25. Chapter 15 Where to Go from Here
    1. 15.1 Become a Generalizing Specialist
    2. 15.2 Continuing Your Learning Process
    3. 15.3 Parting Words
  26. Glossary
  27. References and Recommended Reading
  28. Index