Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development, Third Edition

Book description

“This edition contains Larman’s usual accurate and thoughtful writing. It is a very good book made even better.”
Alistair Cockburn, author, Writing Effective Use Cases and Surviving OO Projects

“Too few people have a knack for explaining things. Fewer still have a handle on software analysis and design. Craig Larman has both.”
John Vlissides, author, Design Patterns and Pattern Hatching

“People often ask me which is the best book to introduce them to the world of OO design. Ever since I came across it Applying UML and Patterns has been my unreserved choice.”
Martin Fowler, author, UML Distilled and Refactoring

“This book makes learning UML enjoyable and pragmatic by incrementally introducing it as an intuitive language for specifying the artifacts of object analysis and design. It is a well written introduction to UML and object methods by an expert practitioner.”
Cris Kobryn, Chair of the UML Revision Task Force and UML 2.0 Working Group

  • A brand new edition of the world’s most admired introduction to object-oriented analysis and design with UML

  • Fully updated for UML 2 and the latest iterative/agile practices

  • Includes an all-new case study illustrating many of the book’s key points

  • Applying UML and Patterns is the world’s #1 business and college introduction to “thinking in objects”—and using that insight in real-world object-oriented analysis and design. Building on two widely acclaimed previous editions, Craig Larman has updated this book to fully reflect the new UML 2 standard, to help you master the art of object design, and to promote high-impact, iterative, and skillful agile modeling practices.

    Developers and students will learn object-oriented analysis and design (OOA/D) through three iterations of two cohesive, start-to-finish case studies. These case studies incrementally introduce key skills, essential OO principles and patterns, UML notation, and best practices. You won’t just learn UML diagrams—you’ll learn how to apply UML in the context of OO software development.

    Drawing on his unsurpassed experience as a mentor and consultant, Larman helps you understand evolutionary requirements and use cases, domain object modeling, responsibility-driven design, essential OO design, layered architectures, “Gang of Four” design patterns, GRASP, iterative methods, an agile approach to the Unified Process (UP), and much more. This edition’s extensive improvements include

  • A stronger focus on helping you master OOA/D through case studies that demonstrate key OO principles and patterns, while also applying the UML

  • New coverage of UML 2, Agile Modeling, Test-Driven Development, and refactoring

  • Many new tips on combining iterative and evolutionary development with OOA/D

  • Updates for easier study, including new learning aids and graphics

  • New college educator teaching resources

  • Guidance on applying the UP in a light, agile spirit, complementary with other iterative methods such as XP and Scrum

  • Techniques for applying the UML to documenting architectures

  • A new chapter on evolutionary requirements, and much more

  • Applying UML and Patterns, Third Edition, is a lucid and practical introduction to thinking and designing with objects—and creating systems that are well crafted, robust, and maintainable.



    Table of contents

    1. Copyright
      1. Dedication
    2. Contents by Major Topics
    3. Foreword
    4. Preface
      1. Educator and Web Resources
      2. Intended Audience—an Introduction!
      3. Prerequisites
      4. Java Examples, But ...
      5. Book Organization
      6. About the Author
      7. Contact
      8. Enhancements to the Previous Edition
      9. Acknowledgments
      10. Typographical Conventions
      11. Production Notes
    5. 1. Introduction
      1. 1. Object-Oriented Analysis and Design
        1. 1.1. What Will You Learn? Is it Useful?
          1. UML vs. Thinking in Objects
          2. OOD: Principles and Patterns
          3. Case Studies
          4. Use Cases
          5. Iterative Development, Agile Modeling, and an Agile UP
          6. Many Other Skills Are Important!
        2. 1.2. The Most Important Learning Goal?
        3. 1.3. What is Analysis and Design?
        4. 1.4. What is Object-Oriented Analysis and Design?
        5. 1.5. A Short Example
          1. Define Use Cases
          2. Define a Domain Model
          3. Assign Object Responsibilities and Draw Interaction Diagrams
          4. Define Design Class Diagrams
          5. Summary
        6. 1.6. What is the UML?
          1. Three Ways to Apply UML
          2. Three Perspectives to Apply UML
            1. The Meaning of “Class” in Different Perspectives
          3. UML 1 and UML 2
          4. Why Won't We See Much UML for a Few Chapters?
        7. 1.7. Visual Modeling is a Good Thing
        8. 1.8. History
        9. 1.9. Recommended Resources
      2. 2. Iterative, Evolutionary, and Agile
        1. Introduction
        2. 2.1. What is the UP? Are Other Methods Complementary?
          1. What If I Don't Care About the UP?
        3. 2.2. What is Iterative and Evolutionary Development?
          1. How to Handle Change on an Iterative Project?
          2. Are There Benefits to Iterative Development?
          3. How Long Should an Iteration Be? What is Iteration Timeboxing?
        4. 2.3. What About the Waterfall Lifecycle?
          1. Guideline: Don't Let Waterfall Thinking Invade an Iterative or UP Project
          2. Why is the Waterfall so Failure-Prone?
          3. The Need for Feedback and Adaptation
        5. 2.4. How to do Iterative and Evolutionary Analysis and Design?
        6. 2.5. What is Risk-Driven and Client-Driven Iterative Planning?
        7. 2.6. What are Agile Methods and Attitudes?
          1. The Agile Manifesto and Principles
            1. The Agile Manifesto
            2. The Agile Principles
        8. 2.7. What is Agile Modeling?
          1. Agile Modeling in this Book: Why the Snapshots of UML Sketches?
        9. 2.8. What is an Agile UP?
        10. 2.9. Are There Other Critical UP Practices?
        11. 2.10. What are the UP Phases?
        12. 2.11. What are the UP Disciplines?
          1. What is the Relationship Between the Disciplines and Phases?
          2. How is the Book Structure Influenced by UP Phases and Disciplines?
        13. 2.12. How to Customize the Process? The UP Development Case
          1. Are There Optional Artifacts or Practices in the UP?
          2. Definition: What is the Development Case?
        14. 2.13. You Know You Didn't Understand Iterative Development or the UP When...
        15. 2.14. History
        16. 2.15. Recommended Resources
      3. 3. Case Studies
        1. Introduction
        2. 3.1. What is and isn't Covered in the Case Studies?
        3. 3.2. Case Study Strategy: Iterative Development + Iterative Learning
        4. 3.3. Case One: The NextGen POS System
        5. 3.4. Case Two: The Monopoly Game System
    6. 2. Inception
      1. 4. Inception is Not the Requirements Phase
        1. Introduction
        2. 4.1. What is Inception?
          1. Does this Analogy Help?
        3. 4.2. How Long is Inception?
        4. 4.3. What Artifacts May Start in Inception?
          1. Isn't That a Lot of Documentation?
        5. 4.4. You Know You Didn't Understand Inception When...
        6. 4.5. How Much UML During Inception?
      2. 5. Evolutionary Requirements
        1. Introduction
        2. 5.1. Definition: Requirements
        3. 5.2. Evolutionary vs. Waterfall Requirements
        4. 5.3. What are Skillful Means to Find Requirements?
        5. 5.4. What are the Types and Categories of Requirements?
        6. 5.5. How are Requirements Organized in UP Artifacts?
          1. What is the Correct Format for these Artifacts?
        7. 5.6. Does the Book Contain Examples of These Artifacts?
        8. 5.7. Recommended Resources
      3. 6. Use Cases
        1. Introduction
        2. 6.1. Example
        3. 6.2. Definition: What are Actors, Scenarios, and Use Cases?
        4. 6.3. Use Cases and the Use-Case Model
        5. 6.4. Motivation: Why Use Cases?
        6. 6.5. Definition: Are Use Cases Functional Requirements?
        7. 6.6. Definition: What are Three Kinds of Actors?
        8. 6.7. Notation: What are Three Common Use Case Formats?
        9. 6.8. Example: Process Sale, Fully Dressed Style
        10. 6.9. What do the Sections Mean?
          1. Preface Elements
            1. Scope
            2. Level
            3. Primary Actor
            4. Stakeholders and Interests List—Important!
            5. Preconditions and Success Guarantees (Postconditions)
          2. Main Success Scenario and Steps (or Basic Flow)
          3. Extensions (or Alternate Flows)
            1. Performing Another Use Case Scenario
          4. Special Requirements
          5. Technology and Data Variations List
        11. 6.10. Notation: Are There Other Formats? A Two-Column Variation
          1. The Best Format?
        12. 6.11. Guideline: Write in an Essential UI-Free Style
          1. New and Improved! The Case for Fingerprinting
          2. Essential Style Writing
          3. Contrasting Examples
            1. Essential Style
            2. Concrete Style—Avoid During Early Requirements Work
        13. 6.12. Guideline: Write Terse Use Cases
        14. 6.13. Guideline: Write Black-Box Use Cases
        15. 6.14. Guideline: Take an Actor and Actor-Goal Perspective
        16. 6.15. Guideline: How to Find Use Cases
          1. Step 1: Choose the System Boundary
          2. Steps 2 and 3: Find Primary Actors and Goals
            1. Are There Questions to Help Find Actors and Goals?
            2. How to Organize the Actors and Goals?
            3. Why Ask About Actor Goals Rather Than Use Cases?
            4. Is the Cashier or Customer the Primary Actor?
            5. Other Ways to Find Actors and Goals? Event Analysis
          3. Step 4: Define Use Cases
        17. 6.16. Guideline: What Tests Can Help Find Useful Use Cases?
          1. The Boss Test
          2. The EBP Test
          3. The Size Test
          4. Example: Applying the Tests
          5. Reasonable Violations of the Tests
        18. 6.17. Applying UML: Use Case Diagrams
          1. Guideline: Diagramming
          2. Guideline: Downplay Diagramming, Keep it Short and Simple
        19. 6.18. Applying UML: Activity Diagrams
        20. 6.19. Motivation: Other Benefits of Use Cases? Requirements in Context
          1. High-Level System Feature Lists Are Acceptable
          2. When Are Detailed Feature Lists Appropriate Rather than Use Cases?
        21. 6.20. Example: Monopoly Game
        22. 6.21. Process: How to Work With Use Cases in Iterative Methods?
          1. How to Evolve Use Cases and Other Specifications Across the Iterations?
          2. When Should Various UP Artifact (Including Use Cases) be Created?
          3. How to Write Use Cases in Inception?
          4. How to Write Use Cases in Elaboration?
          5. How to Write Use Cases in Construction?
          6. Case Study: Use Cases in the NextGen Inception Phase
        23. 6.22. History
        24. 6.23. Recommended Resources
      4. 7. Other Requirements
        1. Introduction
        2. Other Requirement Artifacts
        3. 7.1. How Complete are these Examples?
        4. 7.2. Guideline: Should We Analyze These Thoroughly During Inception?
          1. Reliable Specifications: An Oxymoron?
        5. 7.3. Guideline: Should These Artifacts be at the Project Website?
        6. 7.4. NextGen Example: (Partial) Supplementary Specification
        7. 7.5. Commentary: Supplementary Specification
          1. Quality Attributes
          2. Functionality in the Supplementary Spec? Shouldn't that be in the Use Cases?
          3. Application-Specific Domain (Business) Rules
          4. Information in Domains of Interest
        8. 7.6. NextGen Example: (Partial) Vision
        9. 7.7. Commentary: Vision
          1. The Key High-Level Goals and Problems of the Stakeholders
            1. Guideline: What are Some Facilitation Methods?
          2. Summary of System Features
            1. Guideline: How to Write the Feature List?
          3. Guideline: Should We Duplicate Other Requirements in the Vision?
          4. Guideline: Should You Write the Vision or Use Cases First?
        10. 7.8. NextGen Example: A (Partial) Glossary
        11. 7.9. Commentary: Glossary (Data Dictionary)
          1. Glossary as Data Dictionary
          2. Guideline: Can We use the Glossary to Record Composite Terms?
        12. 7.10. NextGen Example: Business Rules (Domain Rules)
        13. 7.11. Commentary: Domain Rules
        14. 7.12. Process: Evolutionary Requirements in Iterative Methods
          1. Inception
          2. Elaboration
          3. Construction
        15. 7.13. Recommended Resources
    7. 3. Elaboration Iteration 1—Basics
      1. 8. Iteration 1—Basics
        1. Introduction
        2. 8.1. Iteration 1 Requirements and Emphasis: Core OOA/D Skills
          1. NextGen POS
          2. Monopoly
          3. In Iterative Development We Don't Implement All the Requirements at Once
          4. Incremental Development for the Same Use Case Across Iterations
        3. 8.2. Process: Inception and Elaboration
          1. What Happened in Inception?
          2. On to Elaboration
            1. What Artifacts May Start in Elaboration?
            2. You Know You Didn't Understand Elaboration When...
        4. 8.3. Process: Planning the Next Iteration
      2. 9. Domain Models
        1. Introduction
        2. 9.1. Example
        3. 9.2. What is a Domain Model?
          1. Definition: Why Call a Domain Model a “Visual Dictionary”?
          2. Definition: Is a Domain Model a Picture of Software Business Objects?
          3. Definition: What are Two Traditional Meanings of “Domain Model”?
          4. Definition: What are Conceptual Classes?
          5. Definition: Are Domain and Data Models the Same Thing?
        4. 9.3. Motivation: Why Create a Domain Model?
          1. Motivation: Lower Representational Gap with OO Modeling
        5. 9.4. Guideline: How to Create a Domain Model?
        6. 9.5. Guideline: How to Find Conceptual Classes?
          1. What are Three Strategies to Find Conceptual Classes?
          2. Method 2: Use a Category List
          3. Method 3: Finding Conceptual Classes with Noun Phrase Identification
        7. 9.6. Example: Find and Draw Conceptual Classes
          1. Case Study: POS Domain
          2. Case Study: Monopoly Domain
        8. 9.7. Guideline: Agile Modeling—Sketching a Class Diagram
        9. 9.8. Guideline: Agile Modeling—Maintain the Model in a Tool?
        10. 9.9. Guideline: Report Objects—Include 'Receipt' in the Model?
        11. 9.10. Guideline: Think Like a Mapmaker; Use Domain Terms
        12. 9.11. Guideline: How to Model the Unreal World?
        13. 9.12. Guideline: A Common Mistake with Attributes vs. Classes
        14. 9.13. Guideline: When to Model with 'Description' Classes?
          1. Motivation: Why Use 'Description' Classes?
          2. Guideline: When Are Description Classes Useful?
          3. Example: Descriptions in the Airline Domain
        15. 9.14. Associations
          1. Guideline: When to Show an Association?
          2. Guideline: Why Should We Avoid Adding Many Associations?
          3. Perspectives: Will the Associations Be Implemented In Software?
          4. Applying UML: Association Notation
            1. Guideline: How to Name an Association in UML?
          5. Applying UML: Roles
          6. Applying UML: Multiplicity
          7. Applying UML: Multiple Associations Between Two Classes
          8. Guideline: How to Find Associations with a Common Associations List
        16. 9.15. Example: Associations in the Domain Models
          1. Case Study: NextGen POS
          2. Case Study: Monopoly
        17. 9.16. Attributes
          1. Guideline: When to Show Attributes?
          2. Applying UML: Attribute Notation
            1. More Notation
            2. Guideline: Where to Record Attribute Requirements?
            3. Derived Attributes
          3. Guideline: What are Suitable Attribute Types?
            1. Focus on Data Type Attributes in the Domain Model
            2. Data Types
            3. Perspectives: What About Attributes in Code?
          4. Guideline: When to Define New Data Type Classes?
            1. Applying UML: Where to Illustrate These Data Type Classes?
          5. Guideline: No Attributes Representing Foreign Keys
          6. Guideline: Modeling Quantities and Units
        18. 9.17. Example: Attributes in the Domain Models
          1. Case Study: NextGen POS
          2. Case Study: Monopoly
        19. 9.18. Conclusion: Is the Domain Model Correct?
        20. 9.19. Process: Iterative and Evolutionary Domain Modeling
          1. Domain Models Within the UP
            1. Inception
            2. Elaboration
            3. The UP Business Object Model vs. Domain Model
        21. 9.20. Recommended Resources
      3. 10. System Sequence Diagrams
        1. Introduction
        2. 10.1. Example: NextGen SSD
        3. 10.2. What are System Sequence Diagrams?
        4. 10.3. Motivation: Why Draw an SSD?
        5. 10.4. Applying UML: Sequence Diagrams
          1. Loops in Sequence Diagrams
        6. 10.5. What is the Relationship Between SSDs and Use Cases?
          1. Applying UML: Should We Show Use Case Text in the SSD?
        7. 10.6. How to Name System Events and Operations?
        8. 10.7. How to Model SSDs Involving Other External Systems?
        9. 10.8. What SSD Information to Place in the Glossary?
        10. 10.9. Example: Monopoly SSD
        11. 10.10. Process: Iterative and Evolutionary SSDs
          1. SSDs Within the UP
          2. UP Phases
        12. 10.11. History and Recommended Resources
      4. 11. Operation Contracts
        1. Introduction
        2. 11.1. Example
        3. 11.2. Definition: What are the Sections of a Contract?
        4. 11.3. Definition: What is a System Operation?
        5. 11.4. Definition: Postconditions
          1. How are Postconditions Related to the Domain Model?
          2. Motivation: Why Postconditions?
          3. Guideline: How to Write a Postcondition?
          4. Analogy: The Spirit of Postconditions: The Stage and Curtain
          5. Guideline: How Complete Should Postconditions Be? Agile vs. Heavy Analysis
        6. 11.5. Example: enterItem Postconditions
          1. Instance Creation and Deletion
          2. Attribute Modification
          3. Associations Formed and Broken
        7. 11.6. Guideline: Should We Update the Domain Model?
        8. 11.7. Guideline: When Are Contracts Useful?
        9. 11.8. Guideline: How to Create and Write Contracts
          1. Writing Contracts
          2. What's the Most Common Mistake?
        10. 11.9. Example: NextGen POS Contracts
          1. System Operations of the Process Sale Use Case
          2. Changes to the POS Domain Model
        11. 11.10. Example: Monopoly Contracts
        12. 11.11. Applying UML: Operations, Contracts, and the OCL
          1. Operation Contracts Expressed with the OCL
        13. 11.12. Process: Operation Contracts Within the UP
          1. Phases
        14. 11.13. History
          1. Programming Language Support for Contracts
        15. 11.14. Recommended Resources
      5. 12. Requirements to Design—Iteratively
        1. Introduction
        2. 12.1. Iteratively Do the Right Thing, Do the Thing Right
        3. 12.2. Provoking Early Change
        4. 12.3. Didn't All That Analysis and Modeling Take Weeks To Do?
      6. 13. Logical Architecture and UML Package Diagrams
        1. Introduction
        2. 13.1. Example
        3. 13.2. What is the Logical Architecture? And Layers?
        4. 13.3. What Layers are the Focus in the Case Studies?
        5. 13.4. What is Software Architecture?
        6. 13.5. Applying UML: Package Diagrams
          1. UML Tools: Reverse-engineer Package Diagrams from Code
        7. 13.6. Guideline: Design with Layers
          1. Benefits of Using Layers
          2. Guideline: Cohesive Responsibilities; Maintain a Separation of Concerns
          3. Code: Mapping Code Organization to Layers and UML Packages
            1. UML Tools: Reverse-engineer Package Diagrams from Code
          4. Definition: Domain Layer vs. Application Logic Layer; Domain Objects
            1. What's the Relationship Between the Domain Layer and Domain Model?
          5. Definition: Tiers, Layers, and Partitions
          6. Guideline: Don't Show External Resources as the Bottom Layer
        8. 13.7. Guideline: The Model-View Separation Principle
        9. 13.8. What's the Connection Between SSDs, System Operations, and Layers?
        10. 13.9. Example: NextGen Logical Architecture and Package Diagram
        11. 13.10. Example: Monopoly Logical Architecture?
        12. 13.11. Recommended Resources
      7. 14. On to Object Design
        1. Introduction
        2. 14.1. Agile Modeling and Lightweight UML Drawing
        3. 14.2. UML CASE Tools
        4. 14.3. How Much Time Spent Drawing UML Before Coding?
        5. 14.4. Designing Objects: What are Static and Dynamic Modeling?
          1. Dynamic Object Modeling
          2. Static Object Modeling
        6. 14.5. The Importance of Object Design Skill over UML Notation Skill
        7. 14.6. Other Object Design Techniques: CRC Cards
      8. 15. UML Interaction Diagrams
        1. Introduction
        2. 15.1. Sequence and Communication Diagrams
          1. What are the Strengths and Weaknesses of Sequence vs. Communication Diagrams?
          2. Example Sequence Diagram: makePayment
          3. Example Communication Diagram: makePayment
        3. 15.2. Novice UML Modelers Don't Pay Enough Attention to Interaction Diagrams!
        4. 15.3. Common UML Interaction Diagram Notation
          1. Illustrating Participants with Lifeline Boxes
          2. Basic Message Expression Syntax
          3. Singleton Objects
        5. 15.4. Basic Sequence Diagram Notation
          1. Lifeline Boxes and Lifelines
          2. Messages
          3. Focus of Control and Execution Specification Bars
          4. Illustrating Reply or Returns
          5. Messages to “self” or “this”
          6. Creation of Instances
          7. Object Lifelines and Object Destruction
          8. Diagram Frames in UML Sequence Diagrams
          9. Looping
          10. Conditional Messages
          11. Conditional Messages in UML 1.x Style—Still Useful?
          12. Mutually Exclusive Conditional Messages
          13. Iteration Over a Collection
          14. Nesting of Frames
          15. How to Relate Interaction Diagrams?
          16. Messages to Classes to Invoke Static (or Class) Methods
          17. Polymorphic Messages and Cases
          18. Asynchronous and Synchronous Calls
        6. 15.5. Basic Communication Diagram Notation
          1. Links
          2. Messages
          3. Messages to “self” or “this”
          4. Creation of Instances
          5. Message Number Sequencing
          6. Conditional Messages
          7. Mutually Exclusive Conditional Paths
          8. Iteration or Looping
          9. Iteration Over a Collection
          10. Messages to a Classes to Invoke Static (Class) Methods
          11. Polymorphic Messages and Cases
          12. Asynchronous and Synchronous Calls
      9. 16. UML Class Diagrams
        1. Introduction
        2. 16.1. Applying UML: Common Class Diagram Notation
        3. 16.2. Definition: Design Class Diagram
        4. 16.3. Definition: Classifier
        5. 16.4. Ways to Show UML Attributes: Attribute Text and Association Lines
          1. Guideline: When to Use Attribute Text versus Association Lines for Attributes?
          2. The UML Notation for an Association End
          3. How to Show Collection Attributes with Attribute Text and Association Lines?
        6. 16.5. Note Symbols: Notes, Comments, Constraints, and Method Bodies
        7. 16.6. Operations and Methods
          1. Operations
          2. How to Show Methods in Class Diagrams?
          3. Operation Issues in DCDs
            1. The create Operation
            2. Operations to Access Attributes
        8. 16.7. Keywords
        9. 16.8. Stereotypes, Profiles, and Tags
        10. 16.9. UML Properties and Property Strings
        11. 16.10. Generalization, Abstract Classes, Abstract Operations
        12. 16.11. Dependency
          1. Dependency Labels
        13. 16.12. Interfaces
        14. 16.13. Composition Over Aggregation
        15. 16.14. Constraints
        16. 16.15. Qualified Association
        17. 16.16. Association Class
        18. 16.17. Singleton Classes
        19. 16.18. Template Classes and Interfaces
        20. 16.19. User-Defined Compartments
        21. 16.20. Active Class
        22. 16.21. What's the Relationship Between Interaction and Class Diagrams?
      10. 17. GRASP: Designing Objects with Responsibilities
        1. 17.1. UML versus Design Principles
        2. 17.2. Object Design: Example Inputs, Activities, and Outputs
          1. What Are Inputs to Object Design?
          2. What Are Activities of Object Design?
          3. What Are the Outputs?
        3. 17.3. Responsibilities and Responsibility-Driven Design
        4. 17.4. GRASP: A Methodical Approach to Basic OO Design
        5. 17.5. What's the Connection Between Responsibilities, GRASP, and UML Diagrams?
        6. 17.6. What are Patterns?
          1. Patterns Have Names—Important!
          2. 'New Pattern' is an Oxymoron
          3. The Gang-of-Four Design Patterns Book
          4. Is GRASP a Set of Patterns or Principles?
        7. 17.7. Where are We Now?
        8. 17.8. A Short Example of Object Design with GRASP
          1. Creator
            1. Problem: Who creates the Square object?
          2. Information Expert
            1. Problem: Who knows about a Square object, given a key?
          3. Low Coupling
            1. Question: Why Board over Dog?
          4. Controller
          5. High Cohesion
        9. 17.9. Applying GRASP to Object Design
        10. 17.10. Creator
        11. 17.11. Information Expert (or Expert)
        12. 17.12. Low Coupling
          1. Pick Your Battles
        13. 17.13. Controller
          1. Web UIs and Server-Side Application of Controller
          2. Implementation with Java Swing: Rich Client UI
          3. Implementation with Java Struts: Client Browser and WebUI
          4. Bloated Controllers
          5. UI Layer Does Not Handle System Events
          6. Message Handling Systems and the Command Pattern
        14. 17.14. High Cohesion
          1. Another Classic Principle: Modular Design
          2. Cohesion and Coupling; Yin and Yang
        15. 17.15. Recommended Resources
      11. 18. Object Design Examples with GRASP
        1. Introduction
          1. The No-Magic Zone
        2. 18.1. What is a Use Case Realization?
        3. 18.2. Artifact Comments
          1. SSDs, System Operations, Interaction Diagrams, and Use Case Realizations
          2. Use Cases and Use Case Realizations
            1. Involve the Customer Frequently
          3. Operation Contracts and Use Case Realizations
          4. The Domain Model and Use Case Realizations
        4. 18.3. What's Next?
        5. 18.4. Use Case Realizations for the NextGen Iteration
          1. Initialization and the 'Start Up' Use Case
          2. How to Design makeNewSale?
            1. Choosing the Controller Class
            2. Creating a New Sale
            3. Conclusion
          3. How to Design enterItem?
            1. Choosing the Controller Class
            2. Display Item Description and Price?
            3. Creating a New SalesLineItem
            4. Finding a ProductDescription
            5. Visibility to a ProductCatalog
            6. The Final Design
            7. Retrieving ProductDescriptions from a Database
          4. How to Design endSale?
            1. Choosing the Controller Class
            2. Setting the Sale.isComplete Attribute
            3. Calculating the Sale Total
            4. The Sale.getTotal Design
          5. How to Design makePayment?
            1. Creating the Payment
            2. Logging a Sale
            3. Calculating the Balance
          6. The Final NextGen DCD for Iteration-1
          7. How to Connect the UI Layer to the Domain Layer?
          8. Initialization and the 'Start Up' Use Case
            1. When to Create the Initialization Design?
            2. How do Applications Start Up?
            3. Choosing the Initial Domain Object
            4. Store.create Design
        6. 18.5. Use Case Realizations for the Monopoly Iteration
          1. How to Design playGame?
            1. Choosing the Controller Class
            2. The Game-Loop Algorithm
            3. Who is Responsible for Controlling the Game Loop?
            4. Who Takes a Turn?
            5. Taking a Turn
              1. Who Coordinates All This?
              2. The Problem of Visibility
            6. The Final Design of playGame
          2. The Command-Query Separation Principle
            1. Motivation: Why Bother?
          3. Initialization and the 'Start Up' Use Case
        7. 18.6. Process: Iterative and Evolutionary Object Design
          1. Object Design Within the UP
        8. 18.7. Summary
      12. 19. Designing for Visibility
        1. Introduction
        2. 19.1. Visibility Between Objects
        3. 19.2. What is Visibility?
          1. Attribute Visibility
          2. Parameter Visibility
          3. Local Visibility
          4. Global Visibility
      13. 20. Mapping Designs to Code
        1. Introduction
          1. Language Samples
        2. 20.1. Programming and Iterative, Evolutionary Development
          1. Creativity and Change During Implementation
        3. 20.2. Mapping Designs to Code
        4. 20.3. Creating Class Definitions from DCDs
          1. Defining a Class with Method Signatures and Attributes
        5. 20.4. Creating Methods from Interaction Diagrams
          1. The Register.enterItem Method
        6. 20.5. Collection Classes in Code
        7. 20.6. Exceptions and Error Handling
        8. 20.7. Defining the Sale.makeLineItem Method
        9. 20.8. Order of Implementation
        10. 20.9. Test-Driven or Test-First Development
        11. 20.10. Summary of Mapping Designs to Code
        12. 20.11. Introduction to the NextGen POS Program Solution
          1. Class Payment
          2. Class ProductCatalog
          3. Class Register
          4. Class ProductDescription
          5. Class Sale
          6. Class SalesLineItem
          7. Class Store
        13. 20.12. Introduction to the Monopoly Program Solution
          1. Class Square
          2. Class Piece
          3. Class Die
          4. Class Board
          5. Class Player
          6. Class MonopolyGame
      14. 21. Test-Driven Development and Refactoring
        1. Introduction
        2. 21.1. Test-Driven Development
          1. Example
          2. IDE Support for TDD and xUnit
        3. 21.2. Refactoring
          1. Example
          2. IDE Support for Refactoring
        4. 21.3. Recommended Resources
      15. 22. UML Tools and UML as Blueprint
        1. Introduction
        2. 22.1. Forward, Reverse, and Round-Trip Engineering
        3. 22.2. What is a Common Report of Valuable Features?
        4. 22.3. What to Look For in a Tool?
        5. 22.4. If Sketching UML, How to Update the Diagrams After Coding?
        6. 22.5. Recommended Resources
    8. 4. Elaboration Iteration 2—More Patterns
      1. 23. Iteration 2—More Patterns
        1. Introduction
        2. 23.1. From Iteration 1 to 2
          1. Simplifications in the Case Study
        3. 23.2. Iteration-2 Requirements and Emphasis: Object Design and Patterns
          1. NextGen POS
            1. Incremental Development for a Use Case Across Iterations
          2. Monopoly
      2. 24. Quick Analysis Update
        1. Introduction
        2. 24.1. Case Study: NextGen POS
          1. Use Cases
          2. SSDs
          3. Domain Model
          4. System Operation Contracts
        3. 24.2. Case Study: Monopoly
          1. Use Cases, etc.
          2. Domain Model
      3. 25. GRASP: More Objects with Responsibilities
        1. Introduction
        2. 25.1. Polymorphism
          1. NextGen Problem: How Support Third-Party Tax Calculators?
          2. Monopoly Problem: How to Design for Different Square Actions?
          3. Guideline: When to Design with Interfaces?
        3. 25.2. Pure Fabrication
          1. NextGen Problem: Saving a Sale Object in a Database
          2. Monopoly Problem: Handling the Dice
        4. 25.3. Indirection
          1. TaxCalculatorAdapter
          2. PersistentStorage
        5. 25.4. Protected Variations
          1. Mechanisms Motivated by Protected Variations
            1. Core Protected Variations Mechanisms
            2. Data-Driven Designs
            3. Service Lookup
            4. Interpreter-Driven Designs
            5. Reflective or Meta-Level Designs
            6. Uniform Access
            7. Standard Languages
            8. The Liskov Substitution Principle (LSP)
          2. Caution: Speculative PV and Picking Your Battles
          3. PV is applied to both variation and evolution points.
          4. Information Hiding
          5. Open-Closed Principle
      4. 26. Applying GoF Design Patterns
        1. Introduction
          1. The Gang-of-Four Design Patterns
        2. 26.1. Adapter (GoF)
        3. 26.2. Some GRASP Principles as a Generalization of Other Patterns
          1. What's the Problem? Pattern Overload!
          2. A Solution: See the Underlying Principles
          3. Example: Adapter and GRASP
        4. 26.3. “Analysis” Discoveries During Design: Domain Model
        5. 26.4. Factory
        6. 26.5. Singleton (GoF)
          1. Implementation and Design Issues
        7. 26.6. Conclusion of the External Services with Varying Interfaces Problem
        8. 26.7. Strategy (GoF)
          1. Creating a Strategy with a Factory
            1. Reading and Initializing the Percentage Value
          2. Summary
        9. 26.8. Composite (GoF) and Other Design Principles
          1. Creating Multiple SalePricingStrategies
            1. Considering GRASP and Other Principles in the Design
          2. Summary
        10. 26.9. Facade (GoF)
          1. Summary
        11. 26.10. Observer/Publish-Subscribe/Delegation Event Model (GoF)
          1. Why Is It Called Observer, Publish-Subscribe, or Delegation Event Model?
          2. Observer Is Not Only for Connecting UIs and Model Objects
          3. One Publisher Can Have Many Subscribers for an Event
          4. Implementation
            1. Events
            2. Java
          5. Summary
        12. 26.11. Conclusion
        13. 26.12. Recommended Resources
    9. 5. Elaboration Iteration 3—Intermediate Topics
      1. 27. Iteration 3—Intermediate Topics
        1. Introduction
        2. 27.1. NextGen POS
        3. 27.2. Monopoly
      2. 28. UML Activity Diagrams and Modeling
        1. Introduction
        2. 28.1. Example
        3. 28.2. How to Apply Activity Diagrams?
          1. Business Process Modeling
          2. Data Flow Modeling
          3. Concurrent Programming and Parallel Algorithm Modeling
        4. 28.3. More UML Activity Diagram Notation
        5. 28.4. Guidelines
        6. 28.5. Example: NextGen Activity Diagram
        7. 28.6. Process: Activity Diagrams in the UP
        8. 28.7. Background
      3. 29. UML State Machine Diagrams and Modeling
        1. Introduction
        2. 29.1. Example
        3. 29.2. Definitions: Events, States, and Transitions
        4. 29.3. How to Apply State Machine Diagrams?
          1. State-Independent and State-Dependent Objects
          2. Modeling State-dependent Objects
            1. Complex Reactive Objects
            2. Protocols and Legal Sequences
        5. 29.4. More UML State Machine Diagram Notation
          1. Transition Actions and Guards
          2. Nested States
        6. 29.5. Example: UI Navigation Modeling with State Machines
        7. 29.6. Example: NextGen Use Case State Machine Diagram
        8. 29.7. Process: State Machine Diagrams in the UP
        9. 29.8. Recommended Resources
      4. 30. Relating Use Cases
        1. Introduction
          1. Guideline: Avoid Agonizing Over Use Case Relationships
        2. 30.1. The include Relationship
          1. Using include with Asynchronous Event Handling
          2. Summary
        3. 30.2. Terminology: Concrete, Abstract, Base, and Addition Use Cases
        4. 30.3. The extend Relationship
        5. 30.4. The generalize Relationship
        6. 30.5. Use Case Diagrams
      5. 31. Domain Model Refinement
        1. Introduction
        2. 31.1. New Concepts for the NextGen Domain Model
          1. Concepts Category List
          2. Noun Phrase Identification from the Use Cases
          3. Authorization Service Transactions
        3. 31.2. Generalization
        4. 31.3. Defining Conceptual Superclasses and Subclasses
          1. Generalization and Conceptual Class Definition
          2. Generalization and Class Sets
          3. Conceptual Subclass Definition Conformance
          4. Conceptual Subclass Set Conformance
          5. What Is a Correct Conceptual Subclass?
        5. 31.4. When to Define a Conceptual Subclass?
          1. Motivations to Partition a Conceptual Class into Subclasses
        6. 31.5. When to Define a Conceptual Superclass?
        7. 31.6. NextGen POS Conceptual Class Hierarchies
          1. Payment Classes
          2. Authorization Service Classes
          3. Authorization Transaction Classes
        8. 31.7. Abstract Conceptual Classes
          1. Abstract Class Notation in the UML
        9. 31.8. Modeling Changing States
        10. 31.9. Class Hierarchies and Inheritance in Software
        11. 31.10. Association Classes
        12. 31.11. Aggregation and Composition
          1. How to Identify Composition
          2. A Benefit of Showing Composition
          3. Composition in the NextGen Domain Model
        13. 31.12. Time Intervals and Product Prices—Fixing an Iteration 1 “Error”
        14. 31.13. Association Role Names
        15. 31.14. Roles as Concepts versus Roles in Associations
        16. 31.15. Derived Elements
        17. 31.16. Qualified Associations
        18. 31.17. Reflexive Associations
        19. 31.18. Using Packages to Organize the Domain Model
          1. Ownership and References
          2. Package Dependencies
          3. How to Partition the Domain Model
          4. POS Domain Model Packages
          5. Core/Misc Package
          6. Payments
          7. Products
          8. Sales
          9. Authorization Transactions
        20. 31.19. Example: Monopoly Domain Model Refinements
      6. 32. More SSDs and Contracts
        1. Introduction
        2. 32.1. NextGen POS
          1. New System Sequence Diagrams
            1. Common Beginning of Process Sale Scenario
            2. Credit Payment
            3. Check Payment
          2. New System Operations
          3. New System Operation Contracts
      7. 33. Architectural Analysis
        1. Introduction
        2. 33.1. Process: When Do We Start Architectural Analysis?
        3. 33.2. Definition: Variation and Evolution Points
        4. 33.3. Architectural Analysis
        5. 33.4. Common Steps in Architectural Analysis
        6. 33.5. The Science: Identification and Analysis of Architectural Factors
          1. Architectural Factors
          2. Quality Scenarios
            1. Pick Your Battles
          3. Describing Factors
          4. Factors and UP Artifacts
        7. 33.6. Example: Partial NextGen POS Architectural Factor Table
        8. 33.7. The Art: Resolution of Architectural Factors
          1. Recording Architectural Alternatives, Decisions, and Motivation
          2. Priorities
            1. Priorities and Evolution Points: Under- and Over-engineering
          3. Basic Architectural Design Principles
            1. Separation of Concerns and Localization of Impact
          4. Promotion of Architectural Patterns
        9. 33.8. Summary of Themes in Architectural Analysis
        10. 33.9. Process: Iterative Architecture in the UP
          1. Architectural Information in the UP Artifacts
          2. Phases
        11. 33.10. Recommended Resources
      8. 34. Logical Architecture Refinement
        1. Introduction
        2. 34.1. Example: NextGen Logical Architecture
          1. Inter-Layer and Inter-Package Coupling
          2. Inter-Layer and Inter-Package Interaction Scenarios
        3. 34.2. Collaborations with the Layers Pattern
          1. Simple Packages versus Subsystems
          2. Facade
          3. Session Facades and the Application Layer
          4. Controller
          5. System Operations and Layers
          6. Upward Collaboration with Observer
          7. Relaxed Layered Coupling
            1. Isn't Coupling to Technical and Foundation Layers Dangerous?
        4. 34.3. Other Layer Pattern Issues
          1. Logical versus Process and Deployment Views of the Architecture
          2. Is the Application Layer Optional?
          3. Fuzzy Set Membership in Different Layers
          4. Contraindications and Liabilities for Layers
          5. Known Uses
            1. Virtual Machines and Operating Systems
            2. Information Systems: The Classic Three-Tier Architecture
          6. Related Patterns
          7. Also Known As
        5. 34.4. Model-View Separation and “Upward” Communication
        6. 34.5. Recommended Resources
      9. 35. Package Design
        1. Introduction
          1. Source Code Physical Design in the Implementation Model
        2. 35.1. Package Organization Guidelines
          1. Guideline: Package Functionally Cohesive Vertical and Horizontal Slices
          2. Guideline: Package a Family of Interfaces
          3. Guideline: Package by Work and by Clusters of Unstable Classes
          4. Guideline: Most Responsible Are Most Stable
          5. Guideline: Factor out Independent Types
          6. Guideline: Use Factories to Reduce Dependency on Concrete Packages
            1. Domain Object Factory Pattern
          7. Guideline: No Cycles in Packages
        3. 35.2. Recommended Resources
      10. 36. More Object Design with GoF Patterns
        1. Introduction
        2. 36.1. Example: NextGen POS
        3. 36.2. Failover to Local Services; Performance with Local Caching
          1. Caching Strategies
          2. Stale Cache
          3. Threads in the UML
        4. 36.3. Handling Failure
          1. Throwing Exceptions
          2. Exceptions in the UML
          3. Handling Errors
        5. 36.4. Failover to Local Services with a Proxy (GoF)
        6. 36.5. Designing for Non-Functional or Quality Requirements
        7. 36.6. Accessing External Physical Devices with Adapters
        8. 36.7. Abstract Factory (GoF) for Families of Related Objects
          1. An Abstract Class Abstract Factory
        9. 36.8. Handling Payments with Polymorphism and Do It Myself
          1. Fine-Grained Classes?
          2. Credit Payment Authorization
            1. Relevant Credit Payment Domain Information
            2. A Design Scenario
        10. 36.9. Example: Monopoly
        11. 36.10. Conclusion
          1. Caution: Pattern-itis
      11. 37. Designing a Persistence Framework with Patterns
        1. Introduction
        2. 37.1. The Problem: Persistent Objects
          1. Storage Mechanisms and Persistent Objects
        3. 37.2. The Solution: A Persistence Service from a Persistence Framework
        4. 37.3. Frameworks
          1. Frameworks Are Reusable
        5. 37.4. Requirements for the Persistence Service and Framework
        6. 37.5. Key Ideas
        7. 37.6. Pattern: Representing Objects as Tables
        8. 37.7. UML Data Modeling Profile
        9. 37.8. Pattern: Object Identifier
        10. 37.9. Accessing a Persistence Service with a Facade
        11. 37.10. Mapping Objects: Database Mapper or Database Broker Pattern
          1. Metadata-Based Mappers
        12. 37.11. Framework Design with the Template Method Pattern
        13. 37.12. Materialization with the Template Method Pattern
          1. The UP and the Software Architecture Document
          2. Synchronized or Guarded Methods in the UML
        14. 37.13. Configuring Mappers with a MapperFactory
        15. 37.14. Pattern: Cache Management
        16. 37.15. Consolidating and Hiding SQL Statements in One Class
        17. 37.16. Transactional States and the State Pattern
        18. 37.17. Designing a Transaction with the Command Pattern
        19. 37.18. Lazy Materialization with a Virtual Proxy
          1. Who Creates the Virtual Proxy?
          2. Implementation of a Virtual Proxy
        20. 37.19. How to Represent Relationships in Tables
        21. 37.20. PersistentObject Superclass and Separation of Concerns
        22. 37.21. Unresolved Issues
      12. 38. UML Deployment and Component Diagrams
        1. 38.1. Deployment Diagrams
        2. 38.2. Component Diagrams
      13. 39. Documenting Architecture: UML & the N+1 View Model
        1. Introduction
        2. 39.1. The SAD and Its Architectural Views
          1. The Software Architect Document
          2. Motivation: Why Create a SAD?
          3. Architectural Views
          4. The N+1 (or 4+1) View Model
          5. Architectural Views in More Detail
          6. Guideline: Don't Forget the Motivation!
        3. 39.2. Notation: The Structure of a SAD
        4. 39.3. Example: A NextGen POS SAD
        5. 39.4. Example: A Jakarta Struts SAD
        6. 39.5. Process: Iterative Architectural Documentation
          1. UP and the SAD
        7. 39.6. Recommended Resources
    10. 6. Special Topics
      1. 40. More on Iterative Development and Agile Project Management
        1. Introduction
        2. 40.1. How to Plan an Iteration?
        3. 40.2. Adaptive versus Predictive Planning
        4. 40.3. Phase and Iteration Plans
        5. 40.4. How to Plan Iterations with Use Cases and Scenarios?
        6. 40.5. The (In)Validity of Early Estimates
        7. 40.6. Organizing Project Artifacts
        8. 40.7. You Know You Didn't Understand Iterative Planning When...
        9. 40.8. Recommended Resources
    11. Bibliography
    12. Glossary
    13. Inside Front Cover
    14. Praise for Applying UML and Patterns
    15. Inside Back Cover

    Product information

    • Title: Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development, Third Edition
    • Author(s): Craig Larman
    • Release date: October 2004
    • Publisher(s): Pearson
    • ISBN: 0131489062