Teach Yourself UML in 24 Hours 3rd phần 1 doc

51 237 0
Teach Yourself UML in 24 Hours 3rd phần 1 doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

800 East 96th Street, Indianapolis, Indiana, 46240 USA Teach Yourself in 24 Hours Joseph Schmuller UML THIRD EDITION 01.067232640X.FM.qxd 2/20/04 10:28 AM Page i Sams Teach Yourself UML in 24 Hours, Third Edition Copyright © 2004 by Sams Publishing All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein. International Standard Book Number: 0-672-32640-X Library of Congress Catalog Card Number: 2003098381 Printed in the United States of America First Printing: March 2004 07 06 05 04 4321 Trademarks All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark. Warning and Disclaimer Every effort has been made to make this book as complete and as accu- rate as possible, but no warranty or fitness is implied. The information provided is on an “as is” basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book or from the use of the CD or programs accompanying it. Bulk Sales Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information, please contact U.S. Corporate and Government Sales 1-800-382-3419 corpsales@pearsontechgroup.com For sales outside of the U.S., please contact International Sales 1-317-428-3341 international@pearsontechgroup.com Associate Publisher Michael Stephens Acquisitions Editor Todd Green Development Editor Songlin Qiu Managing Editor Charlotte Clapp Senior Project Editor Matthew Purcell Copy Editor Publication Services, Inc. Indexer Publication Services, Inc. Proofreader Publication Services, Inc. Technical Editor Jeffrey Pajor Publishing Coordinator Cindy Teeters Multimedia Developer Dan Scherf Interior Designer Gary Adair Cover Designer Alan Clements Page Layout Publication Services, Inc. Graphics Laura Robbins 01.067232640X.FM.qxd 2/20/04 10:28 AM Page ii Contents at a Glance Introduction 1 Part I Getting Started HOUR 1 Introducing the UML 7 2 Understanding Object-Orientation 31 3 Working with Object-Orientation 47 4 Working with Relationships 61 5 Understanding Aggregations, Composites, Interfaces, and Realizations 79 6 Introducing Use Cases 91 7 Working with Use Case Diagrams 103 8 Working with State Diagrams 123 9 Working with Sequence Diagrams 135 10 Working with Communication Diagrams 157 11 Working with Activity Diagrams 173 12 Working with Component Diagrams 197 13 Working with Deployment Diagrams 213 14 Understanding Packages and Foundations 225 15 Fitting the UML into a Development Process 249 Part II A Case Study HOUR 16 Introducing the Case Study 267 17 Performing a Domain Analysis 285 18 Gathering System Requirements 307 19 Developing the Use Cases 325 20 Getting into Interactions 339 21 Designing Look, Feel, and Deployment 351 22 Understanding Design Patterns 367 01.067232640X.FM.qxd 2/20/04 10:28 AM Page iii Part III Looking Ahead HOUR 23 Modeling Embedded Systems 383 24 Shaping the Future of the UML 403 Part IV Appendices A Quiz Answers 421 B Working with a UML Modeling Tool 435 C A Summary in Pictures 457 Index 467 01.067232640X.FM.qxd 2/20/04 10:28 AM Page iv Table of Contents Introduction 1 What’s New in This Edition 1 Who Should Read This Book? 2 Organization of This Book 2 Conventions Used Throughout This Book 3 Part I Getting Started 5 HOUR 1: Introducing the UML 7 Adding a Method to the Madness 8 How the UML Came to Be 9 Components of the UML 10 Class Diagram 11 Object Diagram 12 Use Case Diagram 13 State Diagram 13 Sequence Diagram 14 Activity Diagram 16 Communication Diagram 16 Component Diagram 18 Deployment Diagram 19 Some Other Features 20 Notes 20 Keywords and Stereotypes 20 New Diagrams in UML 2.0 22 Composite Structure Diagram 22 Interaction Overview Diagram 23 Timing Diagram 24 Something Old, Something New—The Package Diagram 25 01.067232640X.FM.qxd 2/20/04 10:28 AM Page v Why So Many Diagrams? 26 But Isn’t It Just a Bunch of Pictures? 26 Summary 27 Q&A 28 Workshop 29 Quiz 29 Exercises 29 HOUR 2: Understanding Object-Orientation 31 Objects, Objects Everywhere 32 Some Object-Oriented Concepts 34 Abstraction 34 Inheritance 35 Polymorphism 36 Encapsulation 37 Message Sending 38 Associations 40 Aggregation 41 The Payoff 42 Summary 43 Q&A 45 Workshop 45 Quiz 45 HOUR 3: Working with Object-Orientation 47 Visualizing a Class 47 Attributes 48 Operations 50 Attributes, Operations, and Visualization 51 Responsibilities and Constraints 52 Attached Notes 54 Classes—What They Do and How to Find Them 54 Summary 57 vi Sams Teach Yourself UML in 24 Hours 01.067232640X.FM.qxd 2/20/04 10:28 AM Page vi Contents vii Q&A 58 Workshop 58 Quiz 58 Exercises 59 HOUR 4: Working with Relationships 61 Associations 61 Constraints on Associations 63 Association Classes 63 Links 64 Multiplicity 64 Qualified Associations 65 Reflexive Associations 67 Inheritance and Generalization 67 Discovering Inheritance 69 Abstract Classes 70 Dependencies 70 Class Diagrams and Object Diagrams 71 Summary 73 Q&A 75 Workshop 75 Quiz 76 Exercises 76 HOUR 5: Understanding Aggregations, Composites, Interfaces, and Realizations 79 Aggregations 79 Constraints on Aggregations 80 Composites 81 Composite Structure Diagram 81 Interfaces and Realizations 82 Interfaces and Ports 86 Visibility 87 Scope 87 01.067232640X.FM.qxd 2/20/04 10:28 AM Page vii viii Sams Teach Yourself UML in 24 Hours Summary 88 Q&A 89 Workshop 89 Quiz 89 Exercises 89 HOUR 6: Introducing Use Cases 91 Use Cases: What They Are 91 Use Cases: Why They’re Important 92 An Example: The Soda Machine 92 The “Buy Soda” Use Case 93 Additional Use Cases 94 Including a Use Case 96 Extending a Use Case 97 Starting a Use Case Analysis 98 Summary 98 Q&A 100 Workshop 100 Quiz 100 Exercises 101 HOUR 7: Working with Use Case Diagrams 103 Representing a Use Case Model 103 The Soda Machine Revisited 104 Tracking the Steps in the Scenarios 105 Visualizing Relationships Among Use Cases 106 Inclusion 106 Extension 107 Generalization 109 Grouping 110 Use Case Diagrams in the Analysis Process 110 Applying Use Case Models: An Example 111 Understanding the Domain 111 01.067232640X.FM.qxd 2/20/04 10:28 AM Page viii Contents ix Understanding the Users 111 Understanding the Use Cases 113 Drilling Down 113 Taking Stock of Where We Are 115 Structural Elements 116 Relationships 116 Grouping 117 Annotation 117 Extension 117 . . . And More 117 The Big Picture 117 Summary 117 Q&A 120 Workshop 120 Quiz 120 Exercises 121 HOUR 8: Working with State Diagrams 123 What Is a State Diagram? 123 The Fundamental Symbol Set 124 Adding Details to the State Icon 124 Adding Details to the Transitions: Events and Actions 125 Adding Details to the Transitions: Guard Conditions 127 Substates 127 Sequential Substates 128 Concurrent Substates 128 History States 129 New in UML 2.0 130 Why Are State Diagrams Important? 131 Building the Big Picture 131 Summary 131 Q&A 133 01.067232640X.FM.qxd 2/20/04 10:28 AM Page ix x Sams Teach Yourself UML in 24 Hours Workshop 133 Quiz 133 Exercises 134 HOUR 9: Working with Sequence Diagrams 135 What Is a Sequence Diagram? 135 Objects 136 Messages 136 Time 137 Cars and Car Keys 138 A Class Diagram 138 A Sequence Diagram 139 The Soda Machine 141 Sequence Diagrams: The Generic Sequence Diagram 144 Creating an Object in the Sequence 146 Framing a Sequence: Sequence Diagramming in UML 2.0 149 Interaction Occurrences 149 Combined Interaction Fragments 151 Building the Big Picture 153 Summary 153 Q&A 155 Workshop 155 Quiz 155 Exercises 156 HOUR 10: Working with Communication Diagrams 157 What Is a Communication Diagram? 158 Cars and Car Keys 159 Changing States and Nesting Messages 160 The Soda Machine 162 Creating an Object 163 One More Point About Numbering 164 01.067232640X.FM.qxd 2/20/04 10:28 AM Page x [...]... Diagrams 15 7 HOUR 11 Working with Activity Diagrams 17 3 03.067232640X.PartI.qxd 2/20/04 10 :44 AM Page 6 HOUR 12 Working with Component Diagrams 19 7 HOUR 13 Working with Deployment Diagrams 213 HOUR 14 Understanding Packages and Foundations 225 HOUR 15 Fitting the UML into a Development Process 249 04.067232640X.chap 01. qxd 2/20/04 10 :55 AM Page 7 HOUR 1 Introducing the UML What You’ll Learn in This Hour:... 1 Introducing the UML HOUR 2 Understanding Object-Orientation 31 HOUR 3 Working with Object-Orientation 47 HOUR 4 Working with Relationships 61 HOUR 5 Understanding Aggregations, Composites Interfaces, and Realizations 79 HOUR 6 Introducing Use Cases 91 HOUR 7 Working with Use Case Diagrams 10 3 HOUR 8 Working wih State Diagrams 12 3 HOUR 9 Working with Sequence Diagrams 13 5 7 HOUR 10 Working with Communication... 18 8 Building the Big Picture 19 1 Summary 19 1 Q&A 19 3 xi 01. 067232640X.FM.qxd xii 2/20/04 10 :28 AM Page xii Sams Teach Yourself UML in 24 Hours Workshop 19 4 Quiz 19 4 Exercises HOUR 12 : Working with... (and What Isn’t) a Component? 19 7 19 7 19 8 19 8 Components and Interfaces Reviewing Interfaces 19 4 Replacement and Reuse 19 9 What Is a Component Diagram? 200 Representing a Component in UML 1. x and UML 2.0 200 Representing Interfaces Boxes—Black and White 2 01 202 Applying Component Diagrams ... 18 0 New Concepts from UML 2.0 The Objects of an Activity Taking Exception 18 1 18 1 18 3 Deconstructing an Activity 18 4 Marking Time and Finishing a Flow 18 6 Special Effects 18 7 An Overview of an Interaction... the OMG, who adopted it in late 19 97 The OMG took over the maintenance of the UML and produced two more revisions in 19 98 The UML has become a de facto standard in the software industry, and it continues to evolve Versions 1. 3, 1. 4, and 1. 5 have come into being, and OMG recently put its stamp of approval on version 2.0 The earlier versions, referred to generically as version 1. x, have been the basis... the operations WashingMachine brandName modelName serialNumber capacity acceptClothes() acceptDetergent() turnOn() turnOff() FIGURE 1. 1 The UML class icon 04.067232640X.chap 01. qxd 12 2/20/04 10 :55 AM Page 12 Hour 1 Notice the spacing in the names of the class, the attributes, and the operations In UML, a multiword classname has initial capital letters for all the words and eliminates whitespace between... and that the UML provides ways for you to extend its diagrams 04.067232640X.chap 01. qxd 2/20/04 10 :55 AM Page 11 Introducing the UML Models The concept of a model is useful throughout the scientific and engineering fields In the most general sense, when you create a model you’re using something that you know a great deal about to help you understand something you know very little about In some fields,... Diagrams in the Big Picture 209 Summary 209 Q&A 211 Workshop 211 Quiz 211 Exercises HOUR 13 : Working with Deployment Diagrams 211 213 What Is a Deployment Diagram? 213 Applying Deployment Diagrams A Home System 216 ... www.samspublishing.com Type the ISBN (excluding hyphens) or the title of a book in the Search field to find the page you’re looking for 02.067232640X.Intro.qxd 2/20/04 10 :44 AM Page 1 Introduction It’s all about vision A complex system comes into being when someone has a vision of how technology can make things better Developers have to fully understand the vision and keep it firmly in mind as they create . Elements 11 6 Relationships 11 6 Grouping 11 7 Annotation 11 7 Extension 11 7 . . . And More 11 7 The Big Picture 11 7 Summary 11 7 Q&A 12 0 Workshop 12 0 Quiz 12 0 Exercises 12 1 HOUR 8: Working with. 11 1 Understanding the Domain 11 1 01. 067232640X.FM.qxd 2/20/04 10 :28 AM Page viii Contents ix Understanding the Users 11 1 Understanding the Use Cases 11 3 Drilling Down 11 3 Taking Stock of Where We Are 11 5 Structural. 18 7 An Overview of an Interaction 18 8 Building the Big Picture 19 1 Summary 19 1 Q&A 19 3 01. 067232640X.FM.qxd 2/20/04 10 :28 AM Page xi xii Sams Teach Yourself UML in 24 Hours Workshop 19 4 Quiz

Ngày đăng: 13/08/2014, 08:21

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan