Object-Oriented Analysis and Design with Applications Third Edition The Addison-Wesley Object Technology Series Grady Booch, Ivar Jacobson, and James Rumbaugh, Series Editors For more information, check out the series web site at www.awprofessional.com/otseries. Ahmed/Umrysh,Developing Enterprise Java Applications with J2EE™ Kruchten,The Rational Unified Process, 3E: An Introduction and UML LaLonde,Discovering Smalltalk Arlow/Neustadt, Enterprise Patterns and MDA: Building Better Software Lau,The Art of Objects: Object-Oriented Design and Architecture with Archetype Patterns and UML Leffingwell/Widrig,Managing Software Requirements, 2E: A Use Case Arlow/Neustadt, UML 2 and the Unified Process, Second Edition Approach Armour/Miller,Advanced Use Case Modeling: Software Systems Manassis,Practical Software Engineering: Analysis and Design for the Bellin/Simone,The CRC Card Book .NET Platform Bergström/Råberg, Adopting the Rational Unified Process: Success with Marshall,Enterprise Modeling with UML: Designing Successful the RUP Software through Business Analysis Binder, Testing Object-Oriented Systems:Models, Patterns, and Tools McGregor/Sykes, A Practical Guide to Testing Object-Oriented Software Bittner/Spence,Use Case Modeling Mellor/Balcer, Executable UML: A Foundation for Model-Driven Booch,Object Solutions: Managing the Object-Oriented Project Architecture Booch,Object-Oriented Analysis and Design with Applications, 2E Mellor et al., MDADistilled: Principles of Model-Driven Architecture Booch/Bryan,Software Engineering with ADA, 3E Naiburg/Maksimchuk, UML for Database Design Booch/Rumbaugh/Jacobson,The Unified Modeling Language User Oestereich,Developing Software with UML, 2E: Object-Oriented Guide, Second Edition Analysis and Design in Practice Box et al., Effective COM: 50 Ways to Improve Your COMand MTS- Page-Jones, Fundamentals of Object-Oriented Design in UML based Applications Pohl,Object-Oriented Programming Using C++, 2E Buckley/Pulsipher, The Art of ClearCase®Deployment Pollice et al. Software Development for Small Teams: A RUP-Centric Carlson,Modeling XML Applications with UML: Practical Approach e-Business Applications Quatrani,Visual Modeling with Rational Rose 2002 and UML Clarke/Baniassad, Aspect-Oriented Analysis and Design Rector/Sells,ATLInternals Collins,Designing Object-Oriented User Interfaces Reed,Developing Applications with Visual Basic and UML Conallen,Building Web Applications with UML, 2E Rosenberg/Scott, Applying Use Case Driven Object Modeling with Denney, Succeeding with Use Cases UML: An Annotated e-Commerce Example D’Souza/Wills,Objects, Components, and Frameworks with UML: The Rosenberg/Scott, Use Case Driven Object Modeling with UML: Catalysis(SM) Approach A Practical Approach Douglass,Doing Hard Time: Developing Real-Time Systems with UML, Royce, Software Project Management:A Unified Framework Objects, Frameworks, and Patterns Rumbaugh/Jacobson/Booch,The Unified Modeling Language Reference Douglass,Real-Time Design Patterns: Robust Scalable Architecture for Manual Real-Time Systems Schneider/Winters, Applying Use Cases, 2E:A Practical Guide Douglass,Real Time UML, 3E: Advances in The UML for Real-Time Smith,IBM Smalltalk Systems Smith/Williams, Performance Solutions: A Practical Guide to Creating Eeles et al., Building J2EE™Applications with the Rational Unified Process Responsive, Scalable Software Fowler, Analysis Patterns: Reusable Object Models Tkach/Fang/So, Visual Modeling Technique Fowler, UML Distilled, 3E: ABrief Guide to the Standard Object Tkach/Puttick,Object Technology in Application Development, Second Modeling Language Edition Fowler et al., Refactoring: Improving the Design of Existing Code Unhelkar, Process Quality Assurance for UML-Based Projects Gomaa,Designing Concurrent, Distributed, and Real-Time Applications Warmer/Kleppe, The Object Constraint Language, 2E: Getting Your with UML Models Ready for MDA Gomaa,Designing Software Product Lines with UML White,Software Configuration Management Strategies and Rational Heinckiens,Building Scalable Database Applications: Object-Oriented ClearCase®:APractical Introduction Design, Architectures, and Implementations The Component Software Series Hofmeister/Nord/Dilip,Applied Software Architecture Clemens Szyperski, Series Editor Jacobson/Booch/Rumbaugh,The Unified Software Development Process For more information, check out the series web site at Jacobson/Ng,Aspect-Oriented Software Development with Use Cases www.awprofessional.com/csseries. Jordan,C++ Object Databases: Programming with the ODMG Standard Cheesman/Daniels,UML Components: A Simple Process for Specifying Component-Based Software Kleppe/Warmer/Bast,MDA Explained: The Model Driven Architecture™: Practice and Promise Szyperski,Component Software, 2E: Beyond Object-Oriented Programming Kroll/Kruchten,The Rational Unified Process Made Easy: A Practitioner’s Guide to the RUP Object-Oriented Analysis and Design with Applications Third Edition Grady Booch Robert A. Maksimchuk Michael W. Engle Bobbi J. Young, Ph.D. Jim Conallen Kelli A. Houston Upper Saddle River, NJ • Boston • Indianapolis • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 [email protected] For sales outside the United States please contact: International Sales [email protected] This Book Is Safari Enabled The Safari® Enabled icon on the cover of your favorite technology book means the book is available through Safari Bookshelf. When you buy this book, you get free access to the online edition for 45 days. Safari Bookshelf is an electronic reference library that lets you easily search thousands of technical books, find code samples, download chapters, and access technical information whenever and wherever you need it. To gain 45-day Safari Enabled access to this book: • Go to http://www.awprofessional.com/safarienabled • Complete the brief registration form • Enter the coupon code A7LL-9MZM-SGNL-UNMB-SJX7 If you have difficulty registering on Safari Bookshelf or accessing the online edition, please e-mail [email protected]. Visit us on the Web: www.awprofessional.com Library of Congress Cataloging-in-Publication Data Object-oriented analysis and design with applications / Grady Booch...[et al.]. — 3rd ed. p. cm. Rev. ed. of: Object-oriented analysis and design with applications / Grady Booch, 2nd ed. Includes bibliographical references and index. ISBN 0-201-89551-X (hardback : alk. paper) 1. Object-oriented programming (Computer science) I. Booch, Grady. II. Booch, Grady. Object-oriented analysis and design with applications. QA76.64.B66 2007 005.1'17—dc22 2007002589 Copyright © 2007 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: Pearson Education, Inc. Rights and Contracts Department 75 Arlington Street, Suite 300 Boston, MA 02116 Fax: (617) 848-7047 ISBN 0-201-89551-X Text printed in the United States on recycled paper at Courier in Westford, Massachusetts. First printing, April 2007 To Jan my friend, my lover, my wife —Grady This page intentionally left blank Contents Sidebars xi Preface xiii Acknowledgments xix About the Authors xxi Section I Concepts 1 Chapter 1 Complexity 3 1.1 The Structure of Complex Systems 4 1.2 The Inherent Complexity of Software 7 1.3 The Five Attributes of a Complex System 12 1.4 Organized and Disorganized Complexity 14 1.5 Bringing Order to Chaos 18 1.6 On Designing Complex Systems 24 Chapter 2 The Object Model 29 2.1 The Evolution of the Object Model 29 2.2 Foundations of the Object Model 37 2.3 Elements of the Object Model 43 2.4 Applying the Object Model 71 vii viii CONTENTS Chapter 3 Classes and Objects 75 3.1 The Nature of an Object 75 3.2 Relationships among Objects 88 3.3 The Nature of a Class 92 3.4 Relationships among Classes 96 3.5 The Interplay of Classes and Objects 111 3.6 On Building Quality Classes and Objects 112 Chapter 4 Classification 121 4.1 The Importance of Proper Classification 121 4.2 Identifying Classes and Objects 126 4.3 Key Abstractions and Mechanisms 138 Section II Method 145 Chapter 5 Notation 147 5.1 The Unified Modeling Language 147 5.2 Package Diagrams 155 5.3 Component Diagrams 163 5.4 Deployment Diagrams 171 5.5 Use Case Diagrams 175 5.6 Activity Diagrams 185 5.7 Class Diagrams 192 5.8 Sequence Diagrams 206 5.9 Interaction Overview Diagrams 213 5.10 Composite Structure Diagrams 215 5.11 State Machine Diagrams 218 5.12 Timing Diagrams 231 5.13 Object Diagrams 235 5.14 Communication Diagrams 238 Chapter 6 Process 247 6.1 First Principles 248 6.2 The Macro Process: The Software Development Lifecycle 256 6.3 The Micro Process: The Analysis and Design Process 272 Chapter 7 Pragmatics 303 7.1 Management and Planning 304 7.2 Staffing 308 7.3 Release Management 312 7.4 Reuse 314 7.5 Quality Assurance and Metrics 316 CONTENTS ix 7.6 Documentation 320 7.7 Tools 322 7.8 Special Topics 324 7.9 The Benefits and Risks of Object-Oriented Development 326 Section III Applications 331 Chapter 8 System Architecture: Satellite-Based Navigation 333 8.1 Inception 334 8.2 Elaboration 347 8.3 Construction 370 8.4 Post-Transition 371 Chapter 9 Control System: Traffic Management 375 9.1 Inception 376 9.2 Elaboration 385 9.3 Construction 396 9.4 Post-Transition 411 Chapter 10 Artificial Intelligence: Cryptanalysis 413 10.1 Inception 414 10.2 Elaboration 421 10.3 Construction 427 10.4 Post-Transition 446 Chapter 11 Data Acquisition: Weather Monitoring Station 449 11.1 Inception 450 11.2 Elaboration 463 11.3 Construction 474 11.4 Post-Transition 487 Chapter 12 Web Application: Vacation Tracking System 489 12.1 Inception 490 12.2 Elaboration 494 12.3 Construction 506 12.4 Transition and Post-Transition 534