Praise For UML Distilled

3y ago
45 Views
5 Downloads
3.58 MB
55 Pages
Last View : 15d ago
Last Download : 3m ago
Upload by : Amalia Wilborn
Transcription

Praise for UML Distilled“UML Distilled remains the best introduction to UML notation. Martin’s agileand pragmatic approach hits the sweet spot, and I wholeheartedly recommendit!”—Craig LarmanAuthor of Applying UML and Patterns“Fowler cuts through the complexity of UML to get users started quickly.”—Jim RumbaughAuthor and originator of UML“Martin Fowler’s UML Distilled is an excellent way to get started with UML.In fact for most users, UML Distilled contains all you need to apply UML successfully. As Martin points out, UML can be used in many ways, but the mostcommon is as a widely recognized notation for sketching designs. This bookdoes an excellent job of distilling the essence of UML. Highly recommended.”—Steve CookSoftware ArchitectMicrosoft Corporation“Short books on UML are better than long books on UML. This is still the bestshort book on UML. In fact, it’s the best short book on many subjects.”—Alistair CockburnAuthor and President, Humans and Technology“The book is immensely useful, readable, and—one of its great virtues—delightfully concise for the immense scope of its subject. If you only buy onebook on UML, this should be it.”—Andy CarmichaelBetterSoftwareFaster, Ltd.“If you’re using UML, this book should never be out of reach.”—John CrupiDistinguished Engineer, Sun MicrosystemsCoauthor of Core J2EE Patterns

“Anyone doing UML modeling, learning UML, reading UML, or buildingUML tools should have this latest edition. (I own all editions.) There is lots ofgood, useful information; generally, just enough to be useful, but not too muchto be dry. It’s a must-have reference for my bookshelf!”—Jon KernModeler“This is a great starting point for learning the fundamentals of the UML.”—Scott W. AmblerAuthor of Agile Modeling“An eminently sensible description of UML and its usage, with enough humor tohold one’s attention. ‘The swimming metaphor no longer holds water’ indeed!”—Stephen J. MellorCoauthor of Executable UML“This is the perfect book for those who want to use the UML but aren’t interested in reading thick UML reference books and research papers. MartinFowler selects all the critical techniques needed to use the UML for designsketches, freeing the reader from complex and rarely used UML features. Readers will find no shortage of suggestions for further reading. He gives the readeradvice based on experience. It’s a concise and readable book covering the essential aspects of the UML and related object-oriented concepts.”—Pavel HrubyMicrosoft Business Solutions“Like all good software developers, Fowler improves his product with each iteration. This is the only book I consider when teaching a class involving UML orif asked to recommend one that can be used to learn it.”—Charles AshbacherPresident/CEO, Charles Ashbacher Technologies“More books should be like UML Distilled—concise and readable. MartinFowler selects the parts of UML that you need, and presents them in an easy toread style. More valuable than a mere description of the modeling language,however, is the author’s insight and experience in how to use this technique tocommunicate and document design.”—Rob PurserPurser Consulting, LLC.

UML DistilledThird Edition

UML DistilledThird EditionA Brief Guide to the StandardObject Modeling LanguageMartin FowlerBoston San Francisco New York Toronto MontrealLondon Munich Paris MadridCapetown Sydney Tokyo Singapore Mexico City

Many of the designations used by manufacturers and sellers to distinguish their productsare claimed as trademarks. Where those designations appear in this book, and AddisonWesley was aware of a trademark claim, the designations have been printed with initialcapital letters or in all capitals.The author and publisher have taken care in the preparation of this book, but make noexpressed or implied warranty of any kind and assume no responsibility for errors oromissions. No liability is assumed for incidental or consequential damages in connectionwith or arising out of the use of the information or programs contained herein.For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particularto your business, training goals, marketing focus, or branding interests), please contactour corporate sales department at corpsales@pearsoned.com or (800) 382-3419.For government sales inquiries, please contact governmentsales@pearsoned.com.For questions about sales outside the U.S., please contact intlcs@pearson.com.Visit us on the Web: informit.com/awLibrary of Congress Cataloging-in-Publication DataFowler, Martin, 1963–UML distilled : a brief guide to the standard object modeling language / MartinFowler.—3rd ed.p. cm.Includes bibliographical references and index.ISBN 0-321-19368-7 (alk. paper)1. Object-oriented methods (Computer science) 2. Computer software—Development. 3. UML (Computer science) I. Title.QA76.9.O35F695 2003005.1'7—dc222003057759Copyright 2004 by Pearson Education, Inc.All rights reserved. Printed in the United States of America. This publication is protectedby copyright, and permission must be obtained from the publisher prior to any prohibitedreproduction, storage in a retrieval system, or transmission in any form or by any means,electronic, mechanical, photocopying, recording, or likewise. For information regardingpermissions, request forms and the appropriate contacts within the Pearson EducationGlobal Rights & Permissions Department, please visit www.pearsoned.com/permissions/.ISBN-13: 978-0-321-19368-1ISBN-10: 0-321-19368-722 17

For Cindy

This page intentionally left blank

ContentsList of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xviiForeword to the Third Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiForeword to the First Edition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiiiPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxvWhy Bother with the UML? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviStructure of the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxviiChanges for the Third Edition . . . . . . . . . . . . . . . . . . . . . . . . . . .xxviiAcknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxviiiChapter 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1What Is the UML? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1Ways of Using the UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2How We Got to the UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7Notations and Meta-Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9UML Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10What Is Legal UML? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13The Meaning of UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14UML Is Not Enough . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14Where to Start with the UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16Where to Find Out More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16Chapter 2: Development Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Iterative and Waterfall Processes . . . . . . . . . . . . . . . . . . . . . . . . . . .19Predictive and Adaptive Planning . . . . . . . . . . . . . . . . . . . . . . . . . . .23Agile Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24Rational Unified Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25xi

xiiC ONTENTSFitting a Process to a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26Fitting the UML into a Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29Requirements Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31Understanding Legacy Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32Choosing a Development Process . . . . . . . . . . . . . . . . . . . . . . . . . . .33Where to Find Out More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33Chapter 3: Class Diagrams: The Essentials . . . . . . . . . . . . . . . . . . . . . . . . . 35Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36Associations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37Multiplicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38Programming Interpretation of Properties . . . . . . . . . . . . . . . . . . . .39Bidirectional Associations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43Generalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45Notes and Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46Dependency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47Constraint Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49When to Use Class Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51Where to Find Out More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52Chapter 4: Sequence Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53Creating and Deleting Participants . . . . . . . . . . . . . . . . . . . . . . . . . .56Loops, Conditionals, and the Like . . . . . . . . . . . . . . . . . . . . . . . . . .57Synchronous and Asynchronous Calls . . . . . . . . . . . . . . . . . . . . . . .61When to Use Sequence Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . .61Chapter 5: Class Diagrams: Advanced Concepts . . . . . . . . . . . . . . . . . . . . . 65Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65Responsibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66Static Operations and Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . .66Aggregation and Composition . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67Derived Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68Interfaces and Abstract Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . .69Read-Only and Frozen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .72Reference Objects and Value Objects . . . . . . . . . . . . . . . . . . . . . . . .73

C ONTENTSQualified Associations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74Classification and Generalization . . . . . . . . . . . . . . . . . . . . . . . . . . .75Multiple and Dynamic Classification . . . . . . . . . . . . . . . . . . . . . . . .76Association Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78Template (Parameterized) Class . . . . . . . . . . . . . . . . . . . . . . . . . . . .81Enumerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82Active Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83Visibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84Chapter 6: Object Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87When to Use Object Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . .87Chapter 7: Package Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89Packages and Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91Package Aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93Implementing Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94When to Use Package Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . .95Where to Find Out More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95Chapter 8: Deployment Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97When to Use Deployment Diagrams . . . . . . . . . . . . . . . . . . . . . . . . .98Chapter 9: Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99Content of a Use Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .100Use Case Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .102Levels of Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103Use Cases and Features (or Stories) . . . . . . . . . . . . . . . . . . . . . . . .104When to Use Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104Where to Find Out More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105Chapter 10: State Machine Diagrams. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107Internal Activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109Activity States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .109Superstates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110Concurrent States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111Implementing State Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111When to Use State Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114Where to Find Out More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115xiii

xivC ONTENTSChapter 11: Activity Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117Decomposing an Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124Flows and Edges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124Pins and Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125Expansion Regions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126Flow Final . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127Join Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128And There’s More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129When to Use Activity Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . .129Where to Find Out More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130Chapter 12: Communication Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . 131When to Use Communication Diagrams . . . . . . . . . . . . . . . . . . . .133Chapter 13: Composite Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135When to Use Composite Structures . . . . . . . . . . . . . . . . . . . . . . . .137Chapter 14: Component Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139When to Use Component Diagrams . . . . . . . . . . . . . . . . . . . . . . . .141Chapter 15: Collaborations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143When to Use Collaborations . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146Chapter 16: Interaction Overview Diagrams . . . . . . . . . . . . . . . . . . . . . . . 147When to Use Interaction Overview Diagrams . . . . . . . . . . . . . . . . .147Chapter 17: Timing Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149When to Use Timing Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . .150Appendix: Changes between UML Versions . . . . . . . . . . . . . . . . . . . . . . . 151Revisions to the UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151Changes in UML Distilled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .152Changes from UML 1.0 to 1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . .153Type and Implementation Class . . . . . . . . . . . . . . . . . . . . . . . . .153Complete and Incomplete Discriminator Constraints . . . . . . . . .154Composition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154Immutability and Frozen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154

C ONTENTSReturns on Sequence Diagrams . . . . . . . . . . . . . . . . . . . . . . . . .154Use of the Term “Role” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155Changes from UML 1.2 (and 1.1) to 1.3 (and 1.5) . . . . . . . . . . . . .155Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155Activity Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156Changes from UML 1.3 to 1.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . .157Changes from UML 1.4. to 1.5 . . . . . . . . . . . . . . . . . . . . . . . . . . .157From UML 1.x to UML 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157Class Diagrams: The Essentials (Chapter 3) . . . . . . . . . . . . . . . .158Sequence Diagrams (Chapter 4) . . . . . . . . . . . . . . . . . . . . . . . . .158Class Diagrams: Concepts (Chapter 5) . . . . . . . . . . . . . . . . . . . .158State Machine Diagrams (Chapter 10) . . . . . . . . . . . . . . . . . . . .159Activity Diagrams (Chapter 11) . . . . . . . . . . . . . . . . . . . . . . . . .159Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .167xv

This page intentionally left blank

List of FiguresFigure 1.1:Figure 1.2:Figure 1.3:A small piece of the UML meta-model . . . . . . . . . . . . . . . . . . .10Classification of UML diagram types . . . . . . . . . . . . . . . . . . . .12An informal screen flow diagram for partof the wiki (http://c2.com/cgi/wiki) . . . . . . . . . . . . . . . . . . . . . .15Figure 3.1:Figure 3.2:Figure 3.3:Figure 3.4:Figure 3.5:Figure 3.6:Figure 3.7:A simple class diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36Showing properties of an order as attributes . . . . . . . . . . . . . .37Showing properties of an order as associations . . . . . . . . . . . . .38A bidirectional association . . . . . . . . . . . . . . . . . . . . . . . . . . . .42Using a verb phrase to name an association . . . . . . . . . . . . . . .42A note is used as a comment onone or more diagram elements . . . . . . . . . . . . . . . . . . . . . . . . .46Example dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47Figure 4.1:Figure 4.2:Figure 4.3:Figure 4.4:Figure 4.5:Figure 4.6:A sequence diagram for centralized control . . . . . . . . .

Praise for UML Distilled “UML Distilled remains the best introduction to UML notation. Martin’s agile and pragmatic approach hits the sweet spot, and I wholeheartedly recommend it!” —Craig Larman Author of Applying UML and Patterns “Fowler cuts through the complexity of UML to get users started quickly.”

Related Documents:

Song of Praise Knut Nystedt Praise the Lord! Praise the Lord from the heavens. Praise the Lord! Praise the Lord in the heights. Praise him all his angels, praise him all his hosts. Praise him sun and moon, praise him all you shining stars! Praise him you highest heavens, and the waters above the heavens.

Bruksanvisning för bilstereo . Bruksanvisning for bilstereo . Instrukcja obsługi samochodowego odtwarzacza stereo . Operating Instructions for Car Stereo . 610-104 . SV . Bruksanvisning i original

I UML Distilled (2nd Edition) by Martin Fowler I Software Engineering (4th Edition) by Ian Sommerville I Developing Applications with Java and UML by Paul R and Reed Jr I Practical Software Engineering by Leszek A Maciaszek and Bruc Lee Liong. Introduction to UML Course Information UML

to Design Patterns Part III Modeling Behavior: State Machines etc. Literature on UML §Official standard documents by OMG: www.omg.org, www.uml.org §Current version is UML 2.0 (2004/2005) §OMG documents: UML Infrastructure, UML Superstructure §Books: Pfleeger: Software Engineering 3rd ed., 2005 (mostly Chapter 6) Rumbaugh, Jacobson, Booch:

OOAD with UML Object Oriented Analysis and Design Using the UML . 2 UML Applied - Object Oriented Analysis and Design using the UML . . Objects 23 Terminology 24 The Object Oriented Strategy 24 Summary 25 AN OVERVIEW OF THE UML 26 The Use Case Diagram 27 The Class Diagram 28

UML unifies a number of visual design methodologies in software engineering, business modeling and management, database design, and others. UML Class diagrams are a subset of UML that is suitable for conceptual modeling of classes and databases Most used type of UML diagrams UML is also a graphic language for modeling dynamic aspects of a

18/12/06 Introduction à UML 4 Le méta-modèle UML UML : langage permettant de créer des modèles, UML : modélisation des modèles, un méta-modèle. Le méta-modèle UML est en 4 couches: (M3) métamétamodèle : (concept de métaclasse) Définit le langage pour la spécification des metamodèles, (M2) métamodèle : (concept de classe)

Second Grade – English/Language Arts Kentucky Core Academic Standards with Targets Student Friendly Targets Pacing Guide . Page 2 of 40 Revised 2/28/2012 College and Career Readiness Anchor Standards for Reading The K-5 standards on the following pages define what students should understand and be able to do by the end of each grade. They correspond to ten broad College and Career Readiness .