UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Table of Contents | Index
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Table of Contents | Index
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 Copyright © 2005 O'Reilly Media, Inc. All rights reserved. ISBN:0-596-00795-7 Pages:234
by Dan Pilone with Neil Pitman
Printed in the United States of America.
Published by O'Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. Table of Contents | Index
O'Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (safari.oreilly.com). For more information, contact System developers have used languages
[email protected]. specify, visualize, our corporate/institutional salesmodeling department: (800) for 998-9938 construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language systems. Essentially, it enables you to Editor: that applies to a multitude of different Jonathan Gennick communicate solutions in a consistent, tool-supported language. Production Editor: Mary Anne Weeks Mayo Today, UML has become the standard method for modeling software systems, which means Cover Designer: Ellie Volckhausen you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams Interior Designer: Davidyourself, Futato you'll still need to interpret diagrams written by others. Printing History:
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like June 2005: First Edition. you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. Nutshell Handbook, the Nutshell logo, and the O'Reilly logoto are This comprehensive new edition Handbook not only provides a quick-reference allregistered UML 2.0 diagram trademarks of explains O'Reilly Media, Inc. The a Nutshell series to designations, UML 2.0 in a with types, it also key concepts in In a way that appeals readers already familiar Nutshell the image of a programming chimpanzee, and related trade dress are trademarks of O'Reilly UML or ,object-oriented concepts. Media, Inc. Topics include: Unified Modeling Language, UML, Model Driven Architecture, MDA, Common Object Request Broker Architecture, and CORBA are all trademarks of Object Management Group. The role and value of UML in projects Many of the designations used by manufacturers and sellers to distinguish their products are The paradigm its relationappear to the in UML claimed asobject-oriented trademarks. Where thoseand designations this book, and O'Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. An integrated approach to UML diagrams
Object, has Usebeen Case,taken Sequence, Activity, Component, While Class every and precaution in the Collaboration, preparation of Statechart, this book, the publisher and and Deployment Diagrams for errors or omissions, or for damages resulting from the authors assume no responsibility use of the information contained herein. Extension Mechanisms ISBN: 0-596-00795-7 The Object Constraint Language (OCL) [M] If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman
Dedication
............................................... Publisher:O'Reilly Pub Date: June 2005 For my family: the reason I wrote this book and the reason I was able to ISBN:0-596-00795-7 Pages:234
.
Dan Pilone
For Laurie Ann:
Table of Contents | Index
Giorraíonn beirt bóthar/Two people shorten the road
.
System developers have used modeling languages for decades to specify, visualize, Neil Pitman construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman
Preface
............................................... Publisher:O'Reilly Pub Date: June 2005 About ThisISBN: Book0-596-00795-7 Pages:234
How to Use This Book
Typographic Conventions
Table of Contents | Index
Safari Enabled
System developers used modeling languages for decades to specify, visualize, Comments andhave Questions construct, and document systems. The Unified Modeling Language (UML) is one of those Acknowledgments languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman About This Book ............................................... Publisher:O'Reilly Pub Date: June 2005 Welcome to UMLISBN: 2.0 0-596-00795-7 in a Nutshell . The Unified Modeling Language (UML) has expanded quite Pages:234 a bit since its inception and can be applied to many different domains, however it still has its
roots in software development. We have tried to make this book applicable to as broad an audience as possible, but it's helpful to have at least a cursory knowledge of Object Oriented Table of Contents | (OOP) Index Programming because UML draws much of its terminology from that domain. Before going any further we'd like to clarify how this book refers to the Unified Modeling Language. Grammatically speaking, "the languages UML" is correct. However, it sounds weird. This book System developers have used modeling for decades to specify, visualize, uses the more colloquial "UML". construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common UML 2.0 in that a Nutshell reference for the UML 2.0 Superstructure, fromyou a user's language appliesistoa adetailed multitude of different systems. Essentially, it enables to perspective. Whenever it would be helpful to clarify a UML concept with a concrete example, communicate solutions in a consistent, tool-supported language. we will present Java code.
Today, UML has become the standard method for modeling software systems, which means In general we assume that you are familiar with OOP and the type of constructs that go with you're probably confronting this rich and expressive language more than ever before. And it (classes, methods, inheritance, etc.). However, we make no assumptions about what you even though you may not write UML diagrams yourself, you'll still need to interpret know about UML. Each chapter starts with a top-to-bottom discussion of the chapter's topic. diagrams written by others. This will be fast paced and thorough, meant for those who understand the basics and want to know the "nitty-gritty" of a piece of UML. Subsequent sections are kinder, gentler discussions UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like of the topic. This includes examples that show how the topic may be applied to typical you who must read, create, and understand system artifacts expressed using UML. problems, help you further refine your models to eliminate ambiguity, capture details that Furthermore, it's been fully revised to cover version 2.0 of the language. might otherwise be lost, or add information to your model that aids in tool-based development. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with A brief word of warning: UML has a strict terminology for just about every aspect of modeling. UML or object-oriented programming concepts. This is necessary to reduce ambiguity and confusion as much as possible. However, in everyday use some terms are used interchangeably with others that have completely different Topics include: meanings in UML. A classic example of this is operation and method. These are frequently treated as being synonymous in a software development environment but have different meanings used in the context of UML. We will make a point to use the correct UML term The when role and value of UML in projects even if it may not be the most colloquial name. The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman How to Use This Book ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:based 0-596-00795-7 This book is divided on UML diagram type. Obviously there is some crossover, as some Pages: 234 diagrams build on concepts from others. Chapter 1, Fundamentals of UML, covers the basics
of UML and presents some background information that will help you understand the context for the rest of the book. If you are familiar with previous versions of UML, you can probably Table ofthis Contents | Index If you don't have a strong background in UML, you should definitely start skim chapter. here. The next developers set of chapters is called static modeling in UML. Static visualize, modeling captures System havecover used what modeling languages for decades to specify, the physical structure of a piece of software (as much as software has a "physical" construct, and document systems. The Unified Modeling Language (UML) is one of structure). those For example:UML what operations and attributes a class contains, what interfaces a class realizes, languages. makes it possible for team members to collaborate by providing a common or what packages contain this mess. staticsystems. modelingEssentially, chapters include: language that applies to aall multitude of The different it enables you to communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means Chapter 2, Class Diagrams you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret This chapter introduces the class diagram. It discusses the various elements that can be diagrams written by others. used on a class diagram, what they represent, and how to extend them. Because class diagrams are often a centerpiece of a UML model, you should know this chapter inside UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like and out. The last part of the chapter discusses how class diagrams fit into the overall you who must read, create, and understand system artifacts expressed using UML. UML model and how the diagrams are typically mapped to code. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram Chapter 3, Package Diagrams types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming This chapter introduces packagesconcepts. and grouping within a UML model. Topics include: Chapter 4, Composite Structures The role and introduces value of UML projects This chapter theinnew UML 2.0 concept of composite structures. Composite structures are specifically designed to represent patterns and are a major new The object-oriented paradigm and its relation to the UML component to the modeling language. An integrated approach to UML diagrams Chapter 5, Component Diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams This chapter introduces components and the component diagram. Topics such as the stereotypes used in component diagrams, relationships between components, and Extension Mechanisms component metainformation are discussed. The latter part of this chapter discusses how components are typically realized in a programming language. The Object Constraint Language (OCL) Chapter 6, Deployment Diagrams
If you're new to UML, a tutorial with realistic examples has even been included to help you This chapter introduces the concept of capturing system deployment using deployment quickly familiarize yourself with the system. diagrams. Deployment fundamentals such as nodes, node stereotypes, and relationships to components are explained. This chapter also includes a discussion on modeling a distributed system using deployment diagrams. The next set of chapters cover the second half of UMLbehavioral modeling. Behavioral modeling captures how the various elements of a system interact during execution. Diagrams
such as the use case diagram can capture requirements from an external actor's perspective, and sequence diagrams can show how objects interact to implement a particular use case. The behavioral modeling chapters include: UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ...............................................
Chapter 7, Use Publisher: Case Diagrams O'Reilly
Pub Date: June 2005
This chapter introduces use cases, actors, and system boundaries. It goes slightly ISBN: 0-596-00795-7 beyond pure UML in that the chapter touches on common practices regarding use cases, Pages:234 such as use case scoping, use case documents, and use case realizations. Table of Contents | Index
Chapter 8, Statechart Diagrams This chapter introduces state machine modeling using states, actions, and transitions. System developers have used modeling languages for decades to specify, visualize, Statecharts can be used to model a simple algorithm all the way up to a complex construct, and document systems. The Unified Modeling Language (UML) is one of those system. languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Chapter 9, Activity Diagrams
Today, UML has become the standard methodtofor software systems, whichdiagram. means This chapter introduces a close relative themodeling statechart diagram, the activity you'reActivity probably confronting this rich and expressive language thanused evertobefore. diagrams resemble old-school flowcharts and aremore typically model And an even algorithm though you not write UML diagrams yourself, you'll still need to interpret ormay use case realization. diagrams written by others. UML 2.010, in aInteraction Nutshell from O'Reilly feels your pain. It's been crafted for professionals like Chapter Diagrams you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover 2.0 of the language. This chapter introduces the large set of version interaction diagrams supported by UML 2.0. The two best-known diagrams are sequence and collaboration diagrams. This chapter also This comprehensive newtiming-centric edition not only providesdiagram. a quick-reference to all UML 2.0 diagram discusses the new interaction types, it also explains key concepts in a way that appeals to readers already familiar with The part of the bookprogramming covers extension and applications of UML 2.0: UMLfinal or object-oriented concepts. Topics include: Chapter 11, Tagged Values, Stereotypes, and UML Profiles The role and value of UML in projects This chapter discusses how UML 2.0 may be extended and refined. The object-oriented paradigm and its relation to the UML Chapter Effectiveapproach Diagramming An12, integrated to UML diagrams This departs theSequence, specification side of UMLStatechart, 2.0 and offers real-world advice Classchapter and Object, Usefrom Case, Collaboration, Activity, Component, on what parts of UML 2.0 to use when, and how to effectively convey the andmodeling, Deployment Diagrams right information. Extension Mechanisms
The A, Object Language (OCL) Appendix MDA:Constraint Model-Driven Architecture This appendix introduces the Model-Driven Architecture (MDA). While MDA isn't a new idea, UML 2.0 has MDA in mind in several places, and next-generation tools may be If you're to UML, a tutorial with realistic examples has even been included to help you ablenew to make MDA a reality. quickly familiarize yourself with the system. Appendix B, The Object Constraint Language This appendix describes the Object Constraint Language (OCL), a simple language defined to express constraints on UML diagrams. It can be applied in countless ways
and is introduced here in its basic form. If you're familiar with the fundamental UML concepts, you can read this book's chapters in UML 2.0 in a Nutshell nearly any order. However, there is always a certain amount of overlap between chapters because some elements can ByDan Pilone, Neilappear Pitman on many diagrams. Instead of repeating the information in each chapter,............................................... we fully define elements (and their associated stereotypes, attributes, etc.) the first time they are encountered, and in subsequent chapters, we provide detailed cross Publisher: O'Reilly Date: June 2005 references backPub to the original definition, when needed. ISBN:0-596-00795-7 Pages:234
Table of Contents | Index
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman Typographic Conventions ............................................... Publisher:O'Reilly Pub Date: June 2005 The following typographic conventions are used in this book: ISBN:0-596-00795-7 Pages:234
Constant width Table of Contents | Index
Used in the text to refer to class names, stereotypes, and other elements taken from UML diagrams.
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those Constant width italic languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to Used in UML diagrams to indicate text that would be replaced by the user. communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means Italic you're probably confronting this rich and expressive language more than ever before. And even Used though you new mayterms not write diagrams still references. need to interpret when are UML introduced, andyourself, for URLsyou'll and file diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like ... you who must read, create, and understand system artifacts expressed using UML. Ellipses indicate has 2.0 been from a diagram for the Furthermore, it's beennonessential fully revisedmaterial to coverthat version ofomitted the language. sake of readability. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented concepts. Indicates programming a tip, suggestion, or general note. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML Indicates an aspect of UML that you must be particularly careful about using. An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Note that UML makes frequent use of curly braces ({}) and guillemots («»). When these are used in a syntax Mechanisms definition, they are required by UML. Extension NearlyThe everything in UML notation is optional, Object Constraint Language (OCL) so there is no specific notation to indicate an optional field. If a particular piece of syntax is required, it is noted in the text.
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman Safari Enabled ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
When you see a Safari® Enabled icon on the cover of your favorite technology book, it means the book is available online through the O'Reilly Network Safari Bookshelf. Table of Contents | Index
Safari offers a solution that's better than e-books. It's a virtual library that lets you easily search thousands of top tech books, cut and paste code samples, download chapters, and find quick answers when have you need most accurate, current information. Try itvisualize, for free at System developers usedthe modeling languages for decades to specify, http://safari.oreilly.com. construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman Comments and Questions ............................................... Publisher:O'Reilly Pub Date: June Please address comments and2005 questions concerning this book to the publisher: ISBN:0-596-00795-7 Pages:Inc. 234 O'Reilly Media, 1005 Gravenstein Highway North Sebastopol, CA 95472 Table of Contents | Index 800-998-9938 (in the United States or Canada) 707-829-0515 (international/local) 707-829-0104 (fax) System developers have used modeling languages for decades to specify, visualize, There is a web for this book that errata, examples, or any(UML) additional information. construct, and page document systems. Thelists Unified Modeling Language is one of those You can access pageitat: languages. UMLthis makes possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to http://www.oreilly.com/catalog/umlnut2 communicate solutions in a consistent, tool-supported language.
To comment or ask technical questions about this book, send email to: Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And
[email protected] even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. For more information about books, conferences, Resource Centers, and the O'Reilly Network, see the O'Reilly web site at: UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. http://www.oreilly.com Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman Acknowledgments ...............................................
From Dan
Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
This book was truly a team effort. Without support, emails, comments, harassment, and Table of Contents from | Indexfriends, family, and colleagues, this book would not have happened. First I'd suggestions like to thank my editor, Jonathan Gennick, for his astonishing amount of patience. He is fantastic to work with and helped keep this book on track. System developers have used modeling languages for decades to specify, visualize, Next, I'd like to document thank the systems. technical The reviewers were never short(UML) on suggestions or construct, and Unifiedwho Modeling Language is one of those comments. times I felt this was the fourth edition of the book,by after working in all their languages. At UML makes it like possible for team members to collaborate providing a common ideas. The that techapplies reviewers Stephen Mellor, Michael Chonoles, Mike Bernie language to awere: multitude of different systems. Essentially, it Hudson, enables you to Thuman, Kimberly Hamilton, Russ Miles,tool-supported and Julie Webster. communicate solutions in a consistent, language. Finally, like to become thank my my method parents for for modeling supporting me from the startwhich and setting Today, I'd UML has thefamily: standard software systems, means an example that has driven me both myexpressive professional and personal life, and wife, And you're probably confronting thisinrich and language more than evermy before. Tracey, for somehow hold everything together while wrotetothis book. even though you maymanaging not writeto UML diagrams yourself, you'll stillI need interpret Compared to the magic she has been working, writing this book was a piece of cake. Last but diagrams written by others. not least, I'd like to thank my son Vinny: now we can head to the park!
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, From Neil it's been fully revised to cover version 2.0 of the language. This comprehensive new edition only provides quick-reference to UML 2.0 diagram I'd like to thank Ron Wheeler andnot Jacques Hamel ofaArtifact-Software forall allowing the use of types, it also explains key concepts in a way that appeals to readers already familiar with XML examples. Thanks also to Derek McKee of Mindset Corporation for the use of LamMDA UML or object-oriented examples. Finally, I'd likeprogramming to especially concepts. thank Jonathan Gennick for his depth of patience. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman
Chapter 1. Fundamentals of UML
............................................... Publisher:O'Reilly Pub Date: June 2005 On the surface, ISBN: the Unified Modeling Language (UML) is a visual language for capturing 0-596-00795-7 software designs and patterns. Dig a little deeper, though, and you'll find that UML can be Pages:234
applied to quite a few different areas and can capture and communicate everything from company organization to business processes to distributed enterprise software. It is intended to beof aContents common way of capturing and expressing relationships, behaviors, and high-level Table | Index ideas in a notation that's easy to learn and efficient to write. UML is visual; just about everything in it has a graphical representation. Throughout this book we'll discuss the meaning behind the various UML elements as well as their representations. System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 1.1. Getting Started ............................................... Publisher:O'Reilly Date: June 2005be sure to read this chapter all the way through to get If you're new toPub UML, you should 0-596-00795-7 acquainted withISBN: the basic terminology used throughout the book. If you are a developer, class Pages: 234simplest diagrams to start with because they map closely to code. diagrams tend to be the Pick a program or domain you know well, and try to capture the entities involved using classes. Once you're convinced you've modeled the relationships between your entities Table of Contents correctly, pick| Index a piece of functionality and try to model that using a sequence diagram and your classes.
IfSystem you're developers more of a process person (business or otherwise), you to may be more comfortable have used modeling languages for decades specify, visualize, starting with andocument activity diagram. Chapter 9 shows examples of modeling construct, and systems. The Unified Modeling Language (UML) business is one of processes those with different groups (Human Resources, IT,members etc.) and to progresses to by modeling parallel languages. UML makes it possible for team collaborate providing a common processes different language over that applies togeographic a multituderegions. of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 1.2. Background ............................................... Publisher:O'Reilly Pub Date: UML has become the de June facto 2005 standard for modeling software applications and is growing in ISBN:0-596-00795-7 popularity in modeling other domains. Its roots go back to three distinct methods: the Booch Pages: 234 the Object Modeling Technique coauthored by James Rumbaugh, and Method by Grady Booch, Objectory by Ivar Jacobson. Known as the Three Amigos, Booch, Rumbaugh, and Jacobson kicked off what became the first version of UML, in 1994. In 1997, UML was accepted by the Table of Contents | Index Object Management Group (OMG) and released as UML v1.1.
Since then, UML has gone through several revisions and refinements leading up to the current 2.0 release. Each revision has tried to address problems and shortcomings identified in the System developers have used modeling languages for decades to specify, visualize, previous versions, leading systems. to an interesting expansion andLanguage contraction of the language. UML construct, and document The Unified Modeling (UML) is one of those 2.0 is by far UML the largest specification in members terms of page count (theby superstructure alone is languages. makes UML it possible for team to collaborate providing a common over 600 pages), but itto represents theofcleanest, compact version it ofenables UML yet. language that applies a multitude differentmost systems. Essentially, you to communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell Dan Pilone,Neil Pitman 1.3. UML By Basics ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN: First and foremost, it0-596-00795-7 is important to understand that UML is a language . This means it has 234 both syntax andPages: semantics. When you model a concept in UML, there are rules regarding how
the elements can be put together and what it means when they are organized in a certain way. UML is intended not only to be a pictorial representation of a concept, but also to tell you Table of Contents | Index something about its context. How does widget 1 relate to widget 2? When a customer orders something from you, how should the transaction be handled? How does the system support fault tolerance and security? System developers have used modeling languages for decades to specify, visualize, You can apply in any systems. number ofThe ways, but common include: construct, andUML document Unified Modeling uses Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to Designing software communicate solutions in a consistent, tool-supported language. Communicating software or business processes Today, UML has become the standard method for modeling software systems, which means you're probablydetails confronting rich and language more than ever before. And Capturing about this a system for expressive requirements or analysis even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by Documenting anothers. existing system, process, or organization
UML has 2.0 been in a Nutshell from O'Reillydomains, feels yourincluding: pain. It's been crafted for professionals like UML applied to countless you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. Banking and investment sectors This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram Health care types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Defense Topics include: Distributed computing Embedded systems The role and value of UML in projects Retail sales and supply The object-oriented paradigm and its relation to the UML The basic building block of UML is a diagram. There are several types, some with very specific An integrated approach to UML diagrams purposes (timing diagrams) and some with more generic uses (class diagrams). The following sections touch some of the major ways UML has been employed. TheActivity, diagrams mentioned Class andon Object, Use Case, Sequence, Collaboration, Statechart, Component, in each section are by no means confined to that section. If a particular diagram helps you and Deployment Diagrams convey your message you should use it; this is one of the basic tenants of UML modeling. Extension Mechanisms
Object Constraint Language (OCL) 1.3.1.The Designing Software Because UML grew out of the software development domain, it's not surprising that's where it still finds its greatest When with applied to software, UML attempts to bridge thetogap between If you're new to UML,use. a tutorial realistic examples has even been included help you the original idea foryourself a piece with of software and its implementation. UML provides a way to quickly familiarize the system. capture and discuss requirements at the requirements level (use case diagrams), sometimes a novel concept for developers. There are diagrams to capture what parts of the software realize certain requirements (collaboration diagrams). There are diagrams to capture exactly how those parts of the system realize their requirements (sequence and statechart diagrams). Finally there are diagrams to show how everything fits together and executes (component and
deployment diagrams). Books describing previous versions of UML made a point to emphasize that UML was not a UML 2.0 in a Nutshell visual programming language; you couldn't execute your model. However, UML 2.0 changes the rules somewhat. the major motivations for the move from UML 1.5 to UML 2.0 was ByDan One Pilone,of Neil Pitman to add the ability for modelers to capture more system behavior and increase tool ............................................... automation. A relatively new technique called Model Driven Architecture (MDA) offers the Publisher:O'Reilly Pub Date: June 2005 potential to develop executable models that tools can link together and to raise the level of ISBN: 0-596-00795-7 abstraction above traditional programming languages. UML 2.0 is central to the MDA effort. Pages:234
It is important to realize the UML is not a software process. It is meant to be used within a software process and has facets clearly intended to be part of an iterative development Table of Contents | Index approach. While UML was designed to accommodate automated design tools, it wasn't intended only for tools. Professional were kept in mind for when UML was designed, so the language System developerswhiteboarders have used modeling languages decades to specify, visualize, lends itself to quick sketches and capturing "back of the napkin" type designs. construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. 1.3.2. Business Process Modeling Today, UML has become the standard method for modeling software systems, which means you're confronting this rich and expressive language more than before. And UML hasprobably an extensive vocabulary for capturing behavior and process flow.ever Activity diagrams even though you may not write UML diagrams yourself, you'll still need to interpret and statecharts can be used to capture business processes involving individuals, internal diagrams by others. groups, or written even entire organizations. UML 2.0 has notation that helps model geographic boundaries (activity partitions), worker responsibilities (swim lanes), and complex UML 2.0 in a (statechart Nutshell from O'Reilly feels your pain. It's been crafted for professionals like transactions diagrams). you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell Dan Pilone,Neil Pitman 1.4. UML By Specifications ............................................... Publisher:O'Reilly June 2005 Physically, UML Pub is aDate: set of specifications from the OMG. UML 2.0 is distributed as four ISBN: 0-596-00795-7 specifications: the Diagram Interchange Specification, the UML Infrastructure, the UML 234Object Constraint Language (OCL). All of these specifications are Superstructure,Pages: and the available from the OMG web site, http://www.omg.org. Table of Contents |Interchange Index The Diagram Specification was written to provide a way to share UML models between different modeling tools. Previous versions of UML defined an XML schema for capturing what elements were used in a UML diagram, but did not capture any information about how a diagramhave was used laid out. To address this, for the decades Diagramto Interchange Specification System developers modeling languages specify, visualize, was developed with systems. a mapping from a new XML schema to a Scalable construct, and along document The Unified Modeling Language (UML) is Vector one of Graphics those (SVG) representation. Typically thefor Diagram Interchange Specification used only by tool languages. UML makes it possible team members to collaborate byisproviding a common vendors, the OMG an effort to include "whiteboard tools." languagethough that applies to amakes multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. The UML Infrastructure defines the fundamental, low-level, core, bottom-most concepts in UML; theUML infrastructure is the a metamodel that is used to produce the rest of UML.which The means Today, has become standard method for modeling software systems, infrastructure isn't typically used by an end user, but language it providesmore the foundation for the And UML you're probably confronting this rich and expressive than ever before. Superstructure. even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. The UML Superstructure is the formal definition of the elements of UML, and it weighs in at over pages. This isfrom the authority on all thatpain. is UML, least as farfor as professionals the OMG is like UML 600 2.0 in a Nutshell O'Reilly feels your It's at been crafted concerned. The read, superstructure documentation is typically usedexpressed by tool vendors and those you who must create, and understand system artifacts using UML. writing books on some effort hasversion been made make it human readable. Furthermore, it'sUML, beenthough fully revised to cover 2.0 oftothe language.
The OCL specification defines a simple language for writing constraints and expressions for This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram elements in a model. The OCL is often brought into play when you specify UML for a particular types, it also explains key concepts in a way that appeals to readers already familiar with domain and need to restrict the allowable values for a parameter or object. Appendix B is an UML or object-oriented programming concepts. overview of the OCL.
Topics include: It is important to realize that while the specification is the definitive source of the formal definition of UML, it is by no means the be-all and end-all of UML. UML is designed to be extended depending on the domain, user, and specific application. There is The and role interpreted and value of UML in projects enough wiggle room in the specification to fit a data center through it... this is intentional. For example, are typically two or more ways to represent a UML concept depending on what The there object-oriented paradigm and its relation to the UML looks best in your diagram or what part of a concept you wish to emphasize. You may choose to represent a particular element using an in-house notation; this is perfectly acceptable as An integrated approach to UML diagrams far as UML is concerned. However, you must be careful when using nonstandard notation Class Object, Usefor Case, Sequence, Collaboration, Activity, Component, because partand of the reason using UML in the first place is Statechart, to have a common and Deployment Diagrams with other users. representation when collaborating Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 1.5. Putting UML to Work ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 A UML model provides a view of a systemoften just one of many views needed to actually Pages: build or document the234 complete system. Users new to UML can fall into the trap of trying to
model everything about their system with a single diagram and end up missing critical information. Or, at the other extreme, they may try to incorporate every possible UML Table of Contents Index model, thereby overcomplicating things and creating a maintenance diagram into |their nightmare. Becoming proficient have with UML understanding what each diagram hasvisualize, to offer and System developers usedmeans modeling languages for decades to specify, knowing when to apply it. There will be many times when a concept could be expressed construct, and document systems. The Unified Modeling Language (UML) is one of thoseusing any number UML of diagrams; the one(s) that will mean most to by your users. a common languages. makes it pick possible for team members to the collaborate providing language that applies to a multitude of different systems. Essentially, it enables you to Each chapter ofsolutions this book a type of diagram and gives examples of its use. There communicate indescribes a consistent, tool-supported language. are times when you may need to have more than one diagram to capture all the relevant details a single part of the your system.method For example, you may need asystems, statechart diagram to Today,for UML has become standard for modeling software which means show how an embedded controller processes input from a user more as well as aever timing diagram you're probably confronting this rich and expressive language than before. And to show the you controller interacts withdiagrams the rest of the system a result of that input. even how though may not write UML yourself, you'llasstill need to interpret
diagrams written by others. You should also consider your audience when creating models. A test engineer may not care about the low-level implementation (sequence diagram) of a component, only the external UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like interfaces it offers (component diagram). Be sure to consider who will be using each diagram you who must read, create, and understand system artifacts expressed using UML. you produce and make it meaningful to that person. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, itUML also explains key concepts in a way that appeals to readers already familiar with 1.5.1. Profiles UML or object-oriented programming concepts.
Topics include: In addition to a variety of diagram types, UML is designed to be extended. You can informally extend UML by adding constraints, stereotypes, tagged values, and notes to your models, or you can use the formal UML extension and define a full UML profile . A UML profile is a The of role and value and of UML in projects collection stereotypes constraints on elements that map the otherwise generic UML to a specific problem domain or implementation. For example, there are profiles for CORBA, The object-oriented paradigm and its relation to the UML Enterprise Application Integration (EAI), fault tolerance, database modeling, and testing. See Chapter for moreapproach information on UML 2.0 Profiles. An11 integrated to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 1.6. Modeling ............................................... Publisher:O'Reilly Pub Date: June 2005 It should go without saying that the focus of UML is modeling. However, what that means, 0-596-00795-7 exactly, can be ISBN: an open-ended question. Modeling is a means to capture ideas, relationships, Pages:234 decisions, and requirements in a well-defined notation that can be applied to many different domains. Modeling not only means different things to different people, but also it can use different pieces of UML depending on what you are trying to convey. Table of Contents | Index
In general a UML model is made up of one or more diagrams . A diagram graphically represents things, and the relationships between these things. These things can be representations of real-world pure softwarefor constructs, or specify, a description of the System developers have usedobjects, modeling languages decades to visualize, behavior of and some other object. It is The common forModeling an individual thing (UML) to show construct, document systems. Unified Language is up oneon ofmultiple those diagrams; a particular interest, or view , of by theproviding thing being modeled. languages.each UMLdiagram makes itrepresents possible for team members to collaborate a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language.
1.6.1. Diagrams
Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret UML 2.0 divides diagrams into two categories: structural diagrams and behavioral diagrams . diagrams written by others. Structural diagrams are used to capture the physical organization of the things in your systemi.e., how one object relates to another. There are several structural diagrams in UML UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like 2.0: you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram Class diagrams types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented concepts. to capture details about the entities that Class diagrams useprogramming classes and interfaces make up your system and the static relationships between them. Class diagrams are Topicsone include: of the most commonly used UML diagrams, and they vary in detail from fully fleshed-out and able to generate source code to quick sketches on whiteboards and napkins. Class diagrams are discussed in Chapter 2. The role and value of UML in projects The object-oriented paradigm and its relation to the UML Component diagrams An integrated approach to UML Component diagrams show the diagrams organization and dependencies involved in the implementation of a system. They can group smaller elements, such as classes, into Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, larger, deployable pieces. How much detail you use in component diagrams varies and Deployment Diagrams depending on what you are trying to show. Some people simply show the final, deployable version of a system, and others show what functionality is provided by a Extension Mechanisms particular component and how it realizes its functionality internally. Component diagrams discussedLanguage in Chapter 5. The Objectare Constraint (OCL) Composite structure diagrams If you're new to UML, a tutorial with realistic examples has even been included to help you Composite structure new to UML 2.0. As systems become more complex, quickly familiarize yourselfdiagrams with the are system. the relationships between elements grow in complexity as well. Conceptually, composite structure diagrams link class diagrams and component diagrams; they don't emphasize the design detail that class diagrams do or the implementation detail that composite structures do. Instead, composite structures show how elements in the system combine to realize complex patterns. Composite structures are discussed in Chapter 4.
Deployment diagrams UML 2.0 in a Nutshell
Deployment diagrams ByDan Pilone,Neilshow Pitmanhow your system is actually executed and assigned to various pieces of hardware. You typically use deployment diagrams to show how ............................................... components are configured at runtime. Deployment diagrams are discussed in Chapter Publisher: O'Reilly 6. Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Package diagrams Package diagrams Table of Contents | Index
are really special types of class diagrams. They use the same notation but their focus is on how classes and interfaces are grouped together. Package diagrams are discussed in Chapter 3.
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those Object diagrams languages. UML makes it possible for team members to collaborate by providing a common language that applies to a the multitude of different systems. Essentially, it enables youinstances to Object diagrams use same syntax as class diagrams and show how actual communicate solutions in a consistent, tool-supported language. of classes are related at a specific instance of time. You use object diagrams to show snapshots of the relationships in your system at runtime. Object diagrams are discussed Today, become the standard method asUML parthas of class diagrams in Chapter 2. for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not on write diagrams yourself,inyou'll still need interpret Behavioral diagrams focus theUML behavior of elements a system. For to example, you can use diagrams written by others. behavioral diagrams to capture requirements, operations, and internal state changes for elements. The behavioral diagrams are: UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. Activity diagrams This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram capture the flow one appeals behaviortoorreaders activity already , to the familiar next. They types,Activity it also diagrams explains key concepts in a from way that withare similar in concept to a classic flowchart, but are much more expressive. Activity UML or object-oriented programming concepts. diagrams are discussed in Chapter 9. Topics include: Communication diagrams The role and value of UML in projects Communication diagrams are a type of interaction diagram that focuses on the The object-oriented andbehavior its relation the messages UML elements involved inparadigm a particular andtowhat they pass back and forth. Communication diagrams emphasize the objects involved more than the order An integrated approach to UML diagramsCommunication diagrams are discussed as part and nature of the messages exchanged. of interaction diagrams in Chapter 10. Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Interaction overview diagrams Extension Mechanisms Interaction overview diagrams are simplified versions of activity diagrams. Instead of The Object Constraint Language emphasizing the activity at each (OCL) step, interaction overview diagrams emphasize which element or elements are involved in performing that activity. The UML specification describes interaction diagrams as emphasizing who has the focus of control throughout the execution of a system. Interaction overview diagrams are discussed as part of If you're new to UML, a tutorial with realistic examples has even been included to help you interaction diagrams in Chapter 10. quickly familiarize yourself with the system. Sequence diagrams Sequence diagrams are a type of interaction diagram that emphasize the type and order of messages passed between elements during execution. Sequence diagrams are
the most common type of interaction diagram and are very intuitive to new users of UML. Sequence diagrams are discussed as part of interaction diagrams in Chapter 10. UML 2.0 in a Nutshell
State machine diagrams ByDan Pilone,Neil Pitman ...............................................
State machine diagrams Publisher: O'Reillycapture the internal state transitions of an element. The element could be as small as a single class or as large as the entire system. State Pub Date: June 2005 machine diagrams are commonly used to model embedded systems and protocol ISBN:0-596-00795-7 Pages: specifications or234 implementations. State machine diagrams are discussed in Chapter 8.
Timing diagrams Table of Contents | Index Timing diagrams are a type of interaction diagram that emphasize detailed timing specifications messages. They are often used to modelto real-time System developers for have used modeling languages for decades specify, systems visualize,such as satellite communication or hardware handshaking. They have specific to construct, and document systems. The Unified Modeling Language (UML) is notation one of those indicate how long a process or respond to messages, and howa external languages. UML makes it system possiblehas for to team members to collaborate by providing common interruptions are to factored into execution. diagrams are discussed asyou parttoof language that applies a multitude of differentTiming systems. Essentially, it enables interaction diagrams in Chapter 10. communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means Use case diagrams you're probably confronting this rich and expressive language more than ever before. And even Use though may not write UML diagrams yourself, you'll needThey to interpret caseyou diagrams capture functional requirements for a still system. provide an diagrams written by others. implementation-independent view of what a system is supposed to do and allow the modeler to focus on user needs rather than realization details. Use case diagrams are UML 2.0 in a Nutshell from7. O'Reilly feels your pain. It's been crafted for professionals like discussed in Chapter you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language.
1.6.2. Views This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. While not strictly part of UML itself, the concept of views of a system helps the modeler choose Topics diagrams include: that help convey the correct information depending on his goals. Specifically, models are often divided into what is called the 4+1 views of a system. The 4+1 notation represents four distinct views of a system and one overview of how everything fits The The rolefour and views value are: of UML in projects together. The object-oriented paradigm and its relation to the UML integrated approach to UML diagrams DesignAn view Classdesign and Object, Use Case, Collaboration, Statechart, The view captures theSequence, classes, interfaces, and patterns thatActivity, describeComponent, the and Deployment representation of Diagrams the problem domain and how the software will be built to address it. The design view almost always uses class diagrams, object diagrams, activity diagrams, Extension Mechanisms composite structure diagrams, and sequence diagrams to convey the design of a system. The design view typically doesn't address how the system will be implemented The Object Constraint Language (OCL) or executed.
Deployment view If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system. The deployment view captures how a system is configured, installed, and executed. It often consists of component diagrams, deployment diagrams, and interaction diagrams. The deployment view captures how the physical layout of the hardware communicates to execute the system, and can be used to show failover, redundancy, and network topology.
Implementation view The implementation view emphasizes the components, files, and resources used by a UML 2.0 in a Nutshell system. Typically the implementation view focuses on the configuration management of ByDan Pilone,Neil Pitman a system; what components depend on what, what source files implement what classes, ............................................... etc. Implementation views almost always use one or more component diagrams and Publisher:O'Reilly may include diagrams, statechart diagrams, and composite structure Pub interaction Date: June 2005 diagrams.ISBN:0-596-00795-7 Pages:234
Process view Table of Contents | Index
The process view of a system is intended to capture concurrency, performance, and scalability information. Process views often use some form of interaction diagrams and activity diagrams to show how a system actually behaves at runtime. System developers have used modeling languages for decades to specify, visualize, construct, and document Thebrought Unified Modeling Language (UML) is one of those The four distinct views of asystems. system are together with the final view: languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Use case view Today, UML has become the standard method for modeling software systems, which means use case view captures the and functionality required by the end users. concept you'reThe probably confronting this rich expressive language more than everThe before. Andof users is may deliberately broad the use yourself, case view; theystill include primary even end though you not write UML in diagrams you'll need the to interpret stakeholders, system administrator, the testers, and potentially the developers diagrams written bythe others. themselves. The use case view is often broken down into collaborations that link a use case one or from moreO'Reilly of the four Thebeen use case view use case UML 2.0 in with a Nutshell feelsbasic yourviews. pain. It's crafted forincludes professionals like diagrams and typically usesunderstand several interaction diagramsexpressed to show use case details. you who must read, create, and system artifacts using UML. Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram 1.6.3. Notes types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts.
UML provides a catchall element, or note, for adding information to your diagram. The note Topics include: symbol is a dog-eared rectangle with an optional dashed line to link it to some element. Figure 1-1 shows a simple note.
The role and value of UML in projects The object-oriented paradigm and its relation to the UML
Figure 1-1. A simple note An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you In general, you canyourself use notes to the capture just about anything in your diagram. Notes are often quickly familiarize with system. used to express additional information that either doesn't have its own notation or would clutter a diagram if you drew it right on the element. Some tools allow you to embed URL links in notes, providing an easy way to navigate from one diagram to the next, or to HTML documents, etc.
1.6.4. Classifiers and Adornments UML 2.0 in a Nutshell The basic modeling element in UML is the classifier . A classifier represents a group of things with common properties. at the level of classifier, we are discussing UML itself, ByDan Pilone,Remember, Neil Pitman not a particular ............................................... system. So, when we say a class is a classifier, we mean that classes are things that havePublisher: common properties: methods, attributes, exceptions, visibility, etc. A specific O'Reilly class, such as Automobile , isn't a UML classifier; it's an instance of a classifier, or a class. Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Table of Contents
For the truly self-abusing, this is a glimpse into the UML meta-model . The full metamodel is quite complex and begins with the UML | Index infrastructure specification.
System developers have used modeling languages for decades to specify, visualize, document systems. The Unified Language is one of to those Aconstruct, classifier'sand generic notation is a rectangle thatModeling can be divided into (UML) compartments show languages. UML makes it possible team members to collaborate providingHowever, a common classifier-specific information, such for as operations, attributes, or stateby activities. language appliessuch to aas multitude of different systems. Essentially, it enables youtotohelp many UML that classifiers states, activities, objects, etc., have custom notations communicate solutions in a consistent, tool-supported language. distinguish them visually. AToday, classifier can have several of extra information attached to it via a UML which mechanism UML has become thetypes standard method for modeling software systems, means called adornments . For example, can have restrictions placed onever the values you're probably confronting this classifiers rich and expressive language more than before.aAnd feature of the you classifier canwrite take.UML In general, constraints written neartothe classifier or in an even though may not diagrams yourself, are you'll still need interpret attached Seeby the specific diagram types for details on what notation to use for a diagramsnote. written others. constraint when writing it near the classifier. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like Another of read, adornment a stereotype . Just as you would expressed expect, a stereotype you whotype must create,isand understand system artifacts using UML.is intended to give the reader a general of what a particular classifier Furthermore, it's been fully idea revised to cover version 2.0 of therepresents. language. Stereotypes are usually associated with implementation concepts, such as «TRansactional» or «singleton», though that isn't required by the UML specification. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram
types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell Dan Pilone,Neil Pitman 1.7. UML By Rules of Thumb ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:a0-596-00795-7 While UML provides common language for capturing functionality and design information, it Pages:234 to allow for the flexibility needed to model different domains. is deliberately open-ended
There are several rules of thumb to keep in mind when using UML: Table of Contents | Index
Nearly everything in UML is optional
System developers have used modeling languages for decades to specify, visualize, UML provides a language to capture information that varies greatly depending on the construct, and document systems. The Unified Modeling Language (UML) is one of those domain of the problem. In doing that, there are often parts of UML that either don't languages. UML makes it possible for team members to collaborate by providing a common apply to your particular problem or may not lend anything to the particular view you are language that applies to a multitude of different systems. Essentially, it enables you to trying to convey. It is important to realize that you don't need to use every part of UML communicate solutions in a consistent, tool-supported language. in every model you create. Possibly even more importantly, you don't need to use every allowable symbol for a diagram type in every diagram you create. Show only what helps Today, UML has become the standard method for modeling software systems, which means clarify the message you are trying to convey, and leave off what you don't need. At you're probably confronting this rich and expressive language more than ever before. And times there is more than one way to convey the same information; use what is familiar even though you may not write UML diagrams yourself, you'll still need to interpret to your audience. diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like UML models are rarely complete you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised tobeing coveroptional, version 2.0 the language. As a consequence of everything it isofcommon for a UML model to be missing some details about a system. The trick is to not miss key details that could This comprehensive new edition only provides a key quick-reference all UML 2.0information diagram impact your system design.not Knowing what is a detail versustoextraneous types,comes it alsowith explains key concepts in a way that appeals to readers already familiar experience; however, using an iterative process and revisiting your with model UML or object-oriented programming helps to flesh out what needs to concepts. be there. As UML moves closer to tool automation with practices like MDA and Software Factories, the models often become more and more Topicsdetailed include: and therefore complete. The difference is the tool support that helps vary the level of abstraction depending on your needs.
The role and value of UML in projects UML is designed to be open to interpretation The object-oriented paradigm and its relation to the UML While the UML specification does a good job of laying down the groundwork for a An integrated approach to UML diagrams modeling language, it is critical that within an organization or group of users you establish and Use when to use a language feature. ForStatechart, example, some organizations Class andhow Object, Case, Sequence, Collaboration, Activity, Component, use aggregation relationship to indicate a C++ pointer and a composition and an Deployment Diagrams relationship to indicate a C++ reference. There is nothing inherently wrong with this distinction, but it's something that isn't going to be immediately obvious to someone Extension Mechanisms not familiar with that organization's modeling technique. It is a good practice to put together a document modeling guidelines; it helps novice users get up to speed The Object Constrainton Language (OCL) quicker and helps experienced users really think about how they represent something and consider a potentially better notation.
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize with the system. UML is intended toyourself be extended UML includes several mechanisms to allow customization and refinement of the language. Such mechanisms as adornments, constraints, and stereotypes provide ways to capture specific details that aren't easily expressed using classifiers and relationships. Typically these are grouped into what are known as UML profiles . For
example, you can put together a Java 2 Enterprise Edition (J2EE) profile that includes stereotypes for sessionbean or javadataobject. If you are modeling a complex domain, consider putting together a UML profile that lets you easily identify elements as UML 2.0 in a Nutshellsuch as mutualfund or securitymonitor. concepts in your domain, ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Table of Contents | Index
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman
Chapter 2. Class Diagrams
............................................... Publisher:O'Reilly Pub Date: June 2005 Class diagrams ISBN: are one of the most fundamental diagram types in UML. They are used to 0-596-00795-7 capture the static relationships of your software; in other words, how things are put together. Pages:234
When writing software you are constantly making design decisions: what classes hold references to other classes, which class "owns" some other class, and so on. Class diagrams Table of Contents | Index provide a way to capture this "physical" structure of a system.
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 2.1. Classes ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN: A class represents a 0-596-00795-7 group of things that have common state and behavior. You can think of a Pages: 234 class as a blueprint for an object in an object-oriented system. In UML speak, a class is a kind
ofclassifier . For example, Volkswagen, Toyota, and Ford are all cars, so you can represent them using a class named Car. Each specific type of car is an instance of that class, or an Table of Contents | Index object . A class may represent a tangible and concrete concept, such as an invoice; it may be abstract, such as a document or a vehicle (as opposed to an invoice, or a motorcycle greater than 1000 cc), or it may represent an intangible concept such as a high-risk investment strategy. System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those You represent a class with a rectangular boxmembers divided into compartments . A compartment is languages. UML makes it possible for team to collaborate by providing a common simply an area in the rectangle to write The first compartment holdsyou the to name of language that applies to a multitude of information. different systems. Essentially, it enables the class, the second holds (see "Attributes"),language. and the third is used for operations communicate solutions in aattributes consistent, tool-supported (see "Operations"). You can hide any compartment of the class if that increases the readability of has yourbecome diagram. reading a diagram, you can make no assumptions Today, UML theWhen standard method for modeling software systems, which about meansa missing compartment; it doesn't it isexpressive empty. You may add compartments to a class you're probably confronting this mean rich and language more than ever before. Andto show information, suchUML as exceptions or events, though of the typical even additional though you may not write diagrams yourself, you'll still this needistooutside interpret notation. diagrams written by others. UML that the from class O'Reilly name: feels your pain. It's been crafted for professionals like UML suggests 2.0 in a Nutshell you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. Start with a capital letter
This Be comprehensive newtop edition not only provides a quick-reference to all UML 2.0 diagram centered in the compartment types, it also explains key concepts in a way that appeals to readers already familiar with UML Be or object-oriented programming concepts. written in a boldface font Topics Beinclude: written in italics if the class is abstract (see "Abstract Classes") Figure 2-1 shows a simple class. The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
Figure 2-1. Simple class representation
An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
2.1.1. Objects
An object is an instance of a class. For example, you may have several instances of a class namedCar: one two-door red car, one four-door blue car, and one hatchback green car. Each
instance of Car is an object and may be given its own name, though it is common to see unnamed, or anonymous, objects on object diagrams. Typically you show the name of the object followed by a colon followed by its type (i.e., class). You show that this is an instance UML 2.0 in athe Nutshell of a class by underlining name and type. Figure 2-2 shows an instance of a class Car ByDanthat Pilone, Pitman namedToyota. Note inNeil this figure, we have hidden the empty compartments. ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Figure 2-2. An Pages:234
instance of Car
Table of Contents | Index
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 2.2. Attributes ............................................... Publisher:O'Reilly Pub Date: June Details of a class (the color of2005 a car, the number of sides in a shape, etc.) are represented as ISBN:0-596-00795-7 attributes . Attributes can be simple primitive types (integers, floating-point numbers, etc.) or relationships to Pages: other,234 complex objects (see "Relationships").
An attribute can be shown using two different notations: inlined or relationships between Table of Contents | Index classes. In addition, notation is available to show such things as multiplicity, uniqueness, and ordering. This section introduces both notations, and then describes the details of the attribute specification. System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common 2.2.1. Inlined Attributes language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. You can list a class's attributes right in rectangle notation; these are typically called inlined Today, UML has become the standard method for modeling software systems, which means attributes . There is no semantic difference between inlined attributes and attributes by you're probably confronting this rich and expressive language more than ever before. And relationship; it's simply a matter of how much detail you want to present (or, in the case of even though you may not write UML diagrams yourself, you'll still need to interpret primitives like integers, how much detail you can present). diagrams written by others. To represent an attribute within the body of a class, place the attribute in the second UML 2.0 in a Nutshell fromUML O'Reilly feels your pain. It's been crafted for professionals compartment of the class. refers to inlined attributes as attribute notation . Inlinedlike you who must read, create,notation: and understand system artifacts expressed using UML. attributes use the following Furthermore, it's been fully revised to cover version 2.0 of the language. visibility / name new : type multiplicity = default This comprehensive edition not only provides a quick-reference to all UML 2.0 diagram {property constraints } that appeals to readers already familiar with types, it also strings explains and key concepts in a way UML or object-oriented programming concepts. visibility ::= {+|-|#|~} Topics include: multiplicity ::= [lower ..upper ]
The role and value of UML in projects paradigm and its relation to theaspects UML of attribute notation. FigureThe 2-3 object-oriented lists several attributes, demonstrating various An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, Figure 2-3. Example attributes and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
The syntax elements are:
visibility
Indicates the visibility of the attribute. Use the following symbols: +, -, #, or ~ for UML 2.0 in a Nutshell public,private ,protected , or package, respectively (see "Visibility" in Chapter 3). ByDan Pilone,Neil Pitman
/
............................................... Publisher:O'Reilly Pub Date: June 2005 Indicates ISBN: the attribute is derived . A derived attribute is simply one that can be 0-596-00795-7 computedPages: from 234 other attributes of the class. See "Derived Attributes."
name Table of Contents
| Index
Is a noun or short phrase naming the attribute. Typically the first letter is lowercase, anddevelopers the first letter eachmodeling subsequent word isfor capitalized. System haveofused languages decades to specify, visualize,
construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common type language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Is the type of the attribute as another classifier, typically a class, interface, or built-in type like int . Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret multiplicity diagrams written by others. Specifies how many instances of the attribute's type are referenced by this attribute. UML 2.0 a Nutshell from O'Reilly feels your pain. It's been crafted professionals Caninbe absent (meaning multiplicity of 1), a single integer, or afor range of values like you who must between read, create, andbrackets understand systembyartifacts expressed using UML. to specified square separated "..". Use * as the upperbound Furthermore, been fully revised to cover version 2.0zero of the representit's the upper limit or * on its own to mean or language. more. See "Multiplicity."
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram default types, it also explains key concepts in a way that appeals to readers already familiar with
UML or object-oriented programming concepts. Is the default value of the attribute. Topics include: property strings
The role and value of UML in projects Is a collection of properties, or tags, that can be attached to attributes. These are The object-oriented paradigm and itssuch relation to the UML typically context-specific and denote things as ordering or uniqueness. They are surrounded by {} and separated by commas. See "Properties." An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, constraints and Deployment Diagrams Are one or more restrictions placed on an attribute. They may be natural language or Extension Mechanisms use a formal grammar such as the OCL. See "Constraints." The Object Constraint Language (OCL)
2.2.2. Attributes by Relationship If you're new to UML, a tutorial with realistic examples has even been included to help you quickly yourself with the system. You mayfamiliarize also represent attributes using the relationship notation. The relationship notation results in a larger class diagram, but it can provide greater detail for complex attribute types. The relationship notation also conveys exactly how the attribute is contained within a class (see "Relationships" for information on the types of relationships). For example, if you are modeling a Car, you can show that a car contains an Engine much more clearly using relationships than you can just by listing an attribute in the Car's rectangle. However, showing
theCar's name by relationship is probably overkill because it is likely just a string. To represent an attribute using relationships you use one of the association relationships UMLcontaining 2.0 in a Nutshell between the class the attribute and the class that represents the attribute, as shown in FigureBy 2-4, whichNeil shows Dan Pilone, Pitmanthat the relationship between a car and its engine has a multiplicity of 1;............................................... a car has one engine. Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234 Figure 2-4. Attribute
using relationship notation
Table of Contents | Index
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been revised cover version 2.0 cars of the language. Yes, yes,fully as my editortopointed out, some like the Toyota Prius have two engines. Work with me here. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts.
Topics include: Relationship notation supports the same syntax as inlined notation, though the layout is slightly different. The attribute's visibility and name are placed near the relationship line. Don't use square brackets for multiplicity, but do place the multiplicity specification near the The role and value of UML in projects attribute's classifier. The object-oriented paradigm and its relation to the UML Like multiplicity, you can place constraints on attributes (see "Constraints"). In relationship notation, you write constraints attribute's classifier along the relationship line. UML An integrated approach tonear UMLthe diagrams allows relationship notation to also express constraints between attributes, as shown in Figure 2-5. Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms
Figure 2-5. Relationship notation using constraints The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Table of Contents | Index
InFigure 2-5, the standard UML constraint xor shows that only automaticTransmission or manualTransmission can be set at any given time (exclusive or). You need to express this constraint in a note ifhave the used inlined attributelanguages notation was used. to specify, visualize, System developers modeling for decades construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to 2.2.3. Derived Attributes communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means The derived notation, which is the leading forward slash (/), can be used as an indicator to you're probably confronting this rich and expressive language more than ever before. And the implementer that the attribute may not be strictly necessary. For example, let's say you even though you may not write UML diagrams yourself, you'll still need to interpret modeled a bank account with a simple class named Account. This class stores the current diagrams written by others. balance as a floating-point number named balance. To keep track of whether this account is overdrawn, you add a boolean named overdrawn. Whether the account is overdrawn is really UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like based on whether the balance is positive, not the boolean you added. You can indicate this to you who must read, create, and understand system artifacts expressed using UML. the developer by showing that overdrawn is a derived attribute, with its state based on Furthermore, it's been fully revised to cover version 2.0 of the language. balance.Figure 2-6 shows how balance and overdrawn can be represented using a note to convey the relationship. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include:
Figure 2-6. Derived attribute
The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The UML specification notes that a derived attribute is typically readOnly, meaning a user may not modify the value. However, if a user is permitted to modify the value, the class is The Object Constraint Language (OCL) expected to update the source of the derived information appropriately.
If you're new to UML, a tutorial with realistic examples has even been included to help you 2.2.4. Attribute Multiplicity quickly familiarize yourself with the system.
The multiplicity of an attribute specifies how many instances of the attribute's type are created when the owning class is instantiated. For example, our Car class will likely have four wheels, so the multiplicity of the wheel attribute is 4. If no multiplicity is specified, 1 is implied. Multiplicity can be a single integer, a list of integers separated by commas, or a range of values. When specifying a range of values, an infinite upper bound can be
represented as an *; if no lower bound is specified, an * means zero or more. The multiplicity value is shown between square brackets as a single integer or as two integers separated by two dots (..).Figure 2-7 shows the various ways to represent an attribute's multiplicity. UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Figure 2-7. Multiplicity Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
examples
Table of Contents | Index
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to 2.2.4.1. Ordering communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means An attribute with confronting a multiplicity greater than 1 can be language specified to be ordered . If before. the attribute you're probably this rich and expressive more than ever And iseven ordered, theyou elements must beUML stored sequentially. Foryou'll example, you can specify that a list though may not write diagrams yourself, still need to interpret of names be storedbyalphabetically by marking the list as ordered. Exactly what it means for diagrams written others. attributes to be stored sequentially typically depends on the attribute type. By default, attributes not ordered. mark feels an attribute as ordered, ordered UML 2.0 inare a Nutshell fromTo O'Reilly your pain. It's beenspecify craftedthe forproperty professionals likeafter the in read, braces, as shown in Figure 2-8. youattribute who must create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram Ordered multiplicity types, it also explains keyFigure concepts2-8. in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams 2.2.4.2. Uniqueness Extension Mechanisms In addition to being ordered, an attribute with multiplicity greater than 1 may be required to beunique If an attribute is required to (OCL) be unique, each element of this attribute must be The. Object Constraint Language unique. By default, attributes with multiplicity greater than 1 are unique , meaning there can be no duplicates in the elements this attribute holds. For example, if a class held a list of voters and each person was allowed to vote only once, each element in the list would be unique. Tonew make an attribute unique, place the keywordhas unique the attribute braces, If you're to UML, a tutorial with realistic examples evenafter been included to in help you as shownfamiliarize in Figure yourself 2-9. To allow an attribute quickly with the system. to hold duplicates of an object, simply use the propertynotunique.
Figure 2-9. Unique multiplicity
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
2.2.4.3. Collection types Table of Contents | Index
The UML specification specifies a set of mappings from the various ordered and uniqueness System developers have used modeling languages for mappings decades tofrom specify, visualize, properties to UML collection types. Table 2-1 shows the attribute properties to construct, and document systems. Thecollection Unified Modeling Language (UML) is one of mappings those the UML collection type. Note that the types shown in Table 2-1 are UML languages. it to possible members to collaborate by providing a common and may notUML mapmakes directly classesfor inteam a target language. language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And Table 2-1. Collection types for attributes even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. Order Uniqueness Associated collection type UML 2.0False in a Nutshell Bag from O'Reilly feels your pain. It's been crafted for professionals like False you who must read, create, and understand system artifacts expressed using UML. True True OrderedSet Furthermore, it's been fully revised to cover version 2.0 of the language. False True Set This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram True False Sequence types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. For example, to show that a bank's clients should be represented using an OrderedSet, you Topics include: can model the clients attribute as shown in Figure 2-10.
The role and value of UML in projects TheFigure object-oriented andattribute its relation to the UML 2-10. paradigm Example stored in
an OrderedSet
An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you
2.2.5. Properties quickly Attribute familiarize yourself with the system.
In addition to the properties associated with multiplicity, an attribute may have a number of properties set to convey additional information to the reader of the diagram. The common properties defined by UML are:
readOnly UML 2.0 in a Nutshell
Specifies that attribute may not be modified once the initial value is set. This ByDanthe Pilone, Neil Pitman typically maps to a constant in a development language. UML doesn't specify when the ............................................... initial value must be set, though if you specify the default value for an attribute it is Publisher: O'Reilly considered the initial value Pub Date: June 2005and may not be changed. ISBN:0-596-00795-7 Pages:234
union Specifies that Table of Contents | Index
the attribute type is a union of the possible values for this attribute. Frequently this is used with the derived property to indicate that an attribute is a derived union of another set of attributes.
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those subsets languages. UML makes it possible for team members to collaborate by providing a common language that applies a multitude enables you to Specifies that thistoattribute typeofisdifferent a subsetsystems. of all theEssentially, valid valuesitfor the given communicate solutions in a consistent, tool-supported language. attribute. This isn't a common property, but if used, it is typically associated with subclasses of an attribute type. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret redefines diagrams written by others. Specifies that this attribute acts as an alias for the given attribute. Though uncommon, UML 2.0 a Nutshell O'Reilly feelsthat youra pain. It's been crafted for professionals thisinattribute canfrom be used to show subclass has an attribute that is an aliaslike for a you who must read, create, and understand system artifacts expressed using UML. superclass's attribute. Furthermore, it's been fully revised to cover version 2.0 of the language.
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram composite types, it also explains key concepts in a way that appeals to readers already familiar with Specifies that this programming attribute is part of a whole-part relationship with the classifier. See UML or object-oriented concepts. "Relationships" for more information on composition. Topics include:
2.2.6.The Constraints role and value of UML in projects The object-oriented paradigm and its relation to the UML Constraints represent restrictions placed on an element. They may be natural language or use a formal as theto OCL; An grammar integratedsuch approach UMLhowever, diagramsthey must evaluate to a boolean expression. You typically show constraints between curly braces ({}) after the element they restrict, Usein Case, Sequence, Collaboration, Statechart, Activity,line. Component, thoughClass theyand mayObject, be placed a note and linked to the element using a dashed and Deployment Diagrams You can name a constraint by specifying the name followed by a colon (:) before the boolean Extension expression. This Mechanisms is frequently used to identify constraints on an operation (see "Operation Constraints"). The Object Constraint Language (OCL) Figure 2-11 shows several constraints on attributes and operations. If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize the system. Figureyourself 2-11. with Examples of inlined and note constraints
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Table of Contents | Index
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common 2.2.7. Static Attributes language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Static attributes are attributes of the class rather than of an instance of the class. For example, youhas canbecome initializethe constant values for afor class and share themsystems, between which all instances Today, UML standard method modeling software means of the class. You confronting represent static attributes by underlining theirmore specification in before. both inlined you're probably this rich and expressive language than ever And and relationship-based presentations, as shownyourself, in Figureyou'll 2-12.still need to interpret even though you may not write UML diagrams diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like 2-12. system Staticartifacts attribute you who must read, create,Figure and understand expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 2.3. Operations ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Operations are features of classes that specify how to invoke a particular behavior. For example, a classPages: may234 offer an operation to draw a rectangle on the screen or count the
number of items selected in a list. UML makes a clear distinction between the specification of how to invoke a behavior (an operation) and the actual implementation of that behavior (a Table of Contents method). See| Index "Methods" for more information. You place operations in a separate compartment with the following syntax: System developers have used modeling languages for decades to specify, visualize, construct, and document systems. Unified Modeling Language (UML) is one of those visibility name ( parameters ) :The return-type {properties} languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. where parameters are written as: Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And direction parameter_name : type [ multiplicity ] even though you may not write UML diagrams yourself, you'll still need to interpret = default_value properties } diagrams written by{others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Figure 2-13 shows several example operations on a class. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with Figure 2-13. Example operations on a class UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams The syntax elements are: Extension Mechanisms The Object Constraint Language (OCL) visibility
Indicates the visibility of the operation. Use the following symbols: +, -, #, or ~ for If you're new to UML, a tutorial, with realistic examples has even been included to help public ,private ,protected or package , respectively (see "Visibility" in Chapter 3). you quickly familiarize yourself with the system. name
Is a short phrase naming the operation. Operations are usually verb phrases representing actions the classifier should perform on behalf of the caller. The UML
specification recommends that the first letter of an operation be lowercase, with all of the following words starting with a capital letter and running together. See Figure 2-13 for an example. UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman
return-type
............................................... Publisher:O'Reilly Is the type ofDate: information the operation will return, if any. If no information is returned Pub June 2005 from the operation (called a subroutine in some development languages), the return ISBN:0-596-00795-7 Pages: 234 . If the operation does return a value (called a function in some type should be void
development languages), you should show the type of the returned value, such as another classifier, a primitive type, or a collection. The UML specification states that the Table of Contents | Indexis optional. If it's left off, you can't assume anything about the return value return type of the operation, or even if one exists.
System developers have used modeling languages for decades to specify, visualize, properties construct, and document systems. The Unified Modeling Language (UML) is one of those
languages. UML makes it possible for team members to collaborate by providing a common Specifies constraints properties associated with an operation.it These areyou optional; if language that applies to a and multitude of different systems. Essentially, enables to you don't use properties you don't show the curly braces. See "Operation Constraints" communicate solutions in a consistent, tool-supported language. for more information. Today, UML has become the standard method for modeling software systems, which means Parameter syntax elements are: you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. direction
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, understand system artifacts expressed using An optional partcreate, of the and syntax that indicates how a parameter is used by UML. an operation. Furthermore, it's been fully revised to cover version 2.0 of the language. It is one of in,inout,out, or return.in states that the parameter is passed to the operation by the caller. inout states that the parameter is passed by the caller and is This comprehensive new edition notoperation only provides a quick-reference to all UMLthat 2.0 the diagram then possibly modified by the and passed back out. out states types,parameter it also explains keybyconcepts in but a way that appeals to operation readers already with isn't set the caller is modified by the and is familiar passed back UML or object-oriented programming concepts. out. return indicates that the value set by the caller is passed back out as a return value. Topics include: parameter_name
The role and value of UML in projects Is a noun or noun phrase naming the parameter. Typically the parameter name starts The object-oriented paradigm andsubsequent its relation words to the starting UML with a lowercase letter, with any with a capital letter. An integrated approach to UML diagrams type
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Is the type of theDiagrams parameter. This is typically another class, interface, collection, or primitive type. Extension Mechanisms
The Object Constraint Language (OCL) multiplicity Specifies how many instances of the parameter's type are present. Can be absent (meaning multiplicity of 1), a single integer, a list of integers separated by commas, or If you're new to UML, a tutorial with realistic examples has even been included to help you a range of values specified between square brackets separated by "..". An infinite upper quickly familiarize yourself with the system. bound can be represented as an *; if no lower bound specified, an * means zero or more. See "Multiplicity."
default_value
Specifies the default value of this parameter. The default value is optional. If it isn't present, you don't show the equals sign. Note that UML doesn't specify if a parameter with a default value may be left out when invoking an operation (e.g., C++'s default 2.0 in a Nutshell parameterUML value implementation). The actual syntax for invoking an operation is ByDan Pilone,Neil Pitman language-dependent. ............................................... Publisher:O'Reilly properties Pub Date: June 2005 ISBN:0-596-00795-7 Pages: 234 Specifies any parameter-related properties and is specified between curly braces. These
are typically defined within the context of a specific model, with a few exceptions: ordered,readOnly, and unique. See "Multiplicity" and "Properties" for more information. Table of Contents | Index Properties are optional for parameters; if they aren't used, don't show the curly braces.
SystemOperation developers have used modeling languages for decades to specify, visualize, 2.3.1. Constraints
construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to An operation may have several constraints associated with it that help define how the communicate solutions in a consistent, tool-supported language. operation interacts with the rest of the system. Together, constraints on an operation establish a contract that an implementation of the operation must obey. Today, UML has become the standard method for modeling software systems, which means you're probably this rich expressive language thanplaced ever before. Constraints on anconfronting operation follow theand usual constraint notationmore and are either And even though you may not write UML diagrams yourself, you'll still need to interpret immediately after the operation signature or in a note attached with a dashed line. See diagrams written by others. "Constraints" for more information. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. 2.3.1.1. Preconditions Furthermore, it's been fully revised to cover version 2.0 of the language. Preconditions capturenew what the state theprovides system amust be before antooperation candiagram be This comprehensive edition not of only quick-reference all UML 2.0 invoked. Practically speaking, you really can't express the state of the entire system. types, it also explains key concepts in a way that appeals to readers already familiar Instead, with preconditions typically express the valid values for parameters, the state of the class owning UML or object-oriented programming concepts. the operation, or a few key attributes of the system. Topics include: The specification explicitly states that the operation doesn't need to check the preconditions in the body of the operation before executing; theoretically the operation will not even be invoked if the aren't In practice, few languages offer such protection. If The role preconditions and value of UML in met. projects someone took the time to express them, it is usually in your best interest to verify the The object-oriented paradigm and its relation to the UML preconditions are correct when implementing an operation.
An integrated approach offer to UML diagrams As a developer, preconditions you one of the few chances to "cover your butt" and say exactly how you expect things to be when your implementation is invoked; use them. Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, Deployment Diagrams Figureand 2-14 shows several examples of preconditions. Extension Mechanisms The Object Constraint Language (OCL) Figure 2-14. Preconditions
for operations
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
2.3.1.2. Postconditions UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman
Postconditions capture guarantees about the state of the system after an operation has ............................................... executed. Like preconditions, postconditions typically express the state of one or more key Publisher:O'Reilly attributes of thePub system, or some Date: June 2005guarantee about the state of the class owning the ISBN:0-596-00795-7 operation. Pages:234
Figure 2-15 shows example postconditions linked to an operation. Table of Contents | Index
Figure 2-15. Postconditions for operations System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like 2.3.1.3. Body conditions you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language.
An operation may have a bodyCondition that constrains the return value. The bodyCondition This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram is separate from the postcondition because the bodyCondition may be replaced by methods of types, it also explains key concepts in a way that appeals to readers already familiar with subclasses of the owning class. (See "Generalization" for more information on subclasses.) For UML or object-oriented programming concepts. example, a class named Window may specify a body condition for a method named getSize( ) that requires the length and width of a window be nonzero. A subclass named SquareWindow Topics include: may provide its own body condition stating that the width must equal the height. The bodyCondition is similar to the pre- and postconditions in that the constraint may be expressed in natural language orin inprojects OCL. See "Constraints" for more information. Figure 2-16 The role and value of UML shows an example of a bodyCondition on an operation. The object-oriented paradigm and its relation to the UML
An integrated approach to UML diagrams
Figure 2-16. Body conditions for operations
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
2.3.1.4. Query operations An operation may as a query operation if the implementation of the operation UMLbe 2.0declared in a Nutshell doesn't modify the owning class in any way. In practice, modelers often use the query ByDan Pilone,Neil Pitman property to indicate a method that doesn't change any meaningful attribute of an object. For ............................................... example, there Publisher: may be internal cache attributes that are updated as a result of a query. The O'Reilly important thing Pub is that the state of the system, from an external perspective, isn't changed by Date: June 2005 the query method; there can be no ISBN:0-596-00795-7 side effects to calling the method. Pages:234
You indicate a query method by placing the query constraint after the operation signature. For example, an operation named getAge( ) that simply returns an integer without changing any internal value| Index of the owning class would be considered a query method. In C++, this typically Table of Contents maps to a const method. Figure 2-17 shows several query methods on a class.
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those Figure 2-17. query operations languages. UML makes it possible for Example team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language.
2.3.1.5. Exceptions
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented concepts. While they're technically programming not constraints, you may express exceptions thrown by an operation using similar notation. Exceptions are typically other classes (often stereotyped with the Topics include: keyword «exception», though this is simply by convention) that are thrown by an operation in the event of an error. You can list thrown exceptions in a note attached to an operation using a dashed line. Figure 2-18 shows an example of an operation that throws several exceptions. The role and value of UML in projects
The object-oriented paradigm and its relation to the UML
Figure 2-18. A to method that An integrated approach UML diagrams
throws several exceptions
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
2.3.2. Static Operations Operations typically specify behavior for an instance of a class. However, UML allows for an UML 2.0 in a Nutshell operation to specify behavior for the class itself . These operations are called static operations ByDan Pilone,Neil Pitman and are invoked............................................... directly on the class, not on an instance. Static operations are frequently used as utility operations that don't need to use the attributes of the owning class. UML Publisher:O'Reilly doesn't formallyPub discuss of these operations, but it is typical to see them Date: the Junenotation 2005 represented with the0-596-00795-7 same convention as static attributes. You indicate an operation is static ISBN: by underlining the operation signature. Figure 2-19 shows an example of a static operation. Pages: 234
Table of Contents | Index
Figure 2-19. A class with a static operation System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 2.4. Methods ............................................... Publisher:O'Reilly Pub Date: June 2005 Amethod is an implementation of an operation. Each class typically provides an 0-596-00795-7 implementation ISBN: for its operations or inherits them from its superclass (see "Generalization"). Pages: 234 an implementation for an operation, and one isn't provided by its If a class doesn't provide superclass, the operation is considered abstract . See "Abstract Classes" for more information. Because methods are implementations of operations, there is no notation for a method; Table of Contents | Index simply show an operation on a class.
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 2.5. Abstract Classes ............................................... Publisher:O'Reilly Pub Date: June 2005 0-596-00795-7 Anabstract classISBN: is typically a class that provides an operation signature, but no 234 you can have an abstract class that has no operations at all. An implementation;Pages: however,
abstract class is useful for identifying common functionality across several types of objects. For example, you can have an abstract class named Movable. A Movable object has a current Table of Contents | Index position and the ability to move somewhere else using an operation named move( ). There can be several specializations of this abstract classa Car, a Grasshopper, and a Person, each of which provides a different implementation of move( ). Because the base class Movable doesn't have an implementation move( ), the languages class is said todecades be abstract. System developers havefor used modeling for to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those You show a class is abstract by writing its name in italics. Show eachby abstract operation in languages. UML makes it possible for team members to collaborate providing a common italics as well. an example of the abstract class Movable. it enables you to language that Figure applies2-20 to a ismultitude of different systems. Essentially, communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means 2-20. Abstract class you're probably confronting Figure this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. An abstract class can't be instantiated; it must be subclassed and then a subclass which does Topics include: provide the operation implementation can be instantiated. See "Relationships" for more information on subclasses. The role and value of UML in projects
The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 2.6. Relationships ............................................... Publisher:O'Reilly Pub Date: Classes in isolation wouldJune not 2005 provide much insight into how a system is designed. UML 0-596-00795-7 provides severalISBN: ways of representing relationships between classes. Each of UML relationship Pages:234 represents a different type of connection between classes and has subtleties that aren't fully captured in the UML specification. When modeling in the real world, be sure that your intended viewers understand what you are conveying with your various relationships. We say Table of Contents this both as a| Index warning to the modeler and as a slight disclaimer that the following explanations are our interpretation of the UML specification. For example, the debate over when to use aggregation versus composition is ongoing. To help determine which relationship developers have useda modeling languages decades to specify, visualize, isSystem most appropriate, we offer short phrase for eachfor type that may help make the distinction. construct, and document The Unified Modeling (UML) is one of those Again, the important thingsystems. is to be consistent within your Language model. languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language.
2.6.1. Dependency
Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And The weakest classes is a dependency relationship. even thoughrelationship you may notbetween write UML diagrams yourself, you'll still need Dependency to interpret between classes means that one class uses, or has knowledge of, another class. It is typically a diagrams written by others. transient relationship, meaning a dependent class briefly interacts with the target class but typically retain from a relationship withyour it forpain. any real lengthcrafted of time. UML 2.0 doesn't in a Nutshell O'Reilly feels It's been for professionals like you who must read, create, and understand system artifacts expressed using UML. Dependencies are typically read as "...uses a...". For example, if you have a class named Furthermore, it's been fully revised to cover version 2.0 of the language. Window that sends out a class named WindowClosingEvent when it is about to be closed, you would say "Window uses a WindowClosingEvent." This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appealsline to readers already familiarfrom withthe You show a dependency between classes using a dashed with an arrow pointing UML or object-oriented programming concepts. dependent class to the class that is used. Figure 2-21 shows a dependency between a class namedWindow and a class named WindowClosingEvent. Topics include:
The role and value of UML in projects
Figure 2-21. Window's dependency on WindowClosingEvent
The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL) You can likely assume from Figure 2-21 that Window doesn't retain a relationship with a WindowClosingEvent foraany real length of time. It simplyhas uses them when needed If you're new to UML, tutorial with realistic examples even been included to and helpthen you forgets about them. quickly familiarize yourself with the system.
2.6.2. Association Associations are stronger than dependencies and typically indicate that one class retains a
relationship to another class over an extended period of time. The lifelines of two objects linked by associations are probably not tied together (meaning one can be destroyed without necessarily destroying the other). UML 2.0 in a Nutshell
Associations areBytypically as "...has a...". For example, if you have a class named Window Dan Pilone,read Neil Pitman that has a reference to the current mouse cursor, you would say "Window has a Cursor". Note ............................................... that there is a fine line between Publisher: O'Reilly "...has a..." and "...owns a..." (see "Aggregation" later in this Date: June 2005 section). In thisPub case, Window doesn't own the Cursor;Cursor is shared between all ISBN: 0-596-00795-7 applications in the system. However, Window has a reference to it so that the Window can hide Pages:etc. 234 You show an association using a solid line between the classes it, change its shape, participating in the relationship. Figure 2-22 shows an association between Window and Cursor. Table of Contents | Index
Figure 2-22. Association showing Window "has a" Cursor System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like
2.6.2.1. you whoNavigability must read, create, and understand system artifacts expressed using UML.
Furthermore, it's been fully revised to cover version 2.0 of the language. Associations have explicit notation to express navigability. If you can navigate from one class to another, you shownew an arrow in not the only direction of the class you can navigate to. 2.0 If you can This comprehensive edition provides a quick-reference to all UML diagram navigate both directions, it is common practice not show any arrows at all, but aswith the types, it in also explains key concepts in a way that to appeals to readers already familiar UML points programming out, if you suppress all arrows you can't distinguish nonnavigable UMLspecification or object-oriented concepts. associations from two-way associations. However, it is extremely rare to use a nonnavigable association in the real world, so this is unlikely to be a problem. Topics include: You can explicitly forbid navigation from one class to another by placing a small X on the The role value projects association lineand at the endofofUML the in class you can't navigate to. Figure 2-23 shows an association between a class named Window and a class named Cursor. Because you can't navigate from an Theofobject-oriented paradigm and its, relation to theshow UMLthe navigability arrow and an X instance Cursor to an instance of Window we explicitly where appropriate. An integrated approach to UML diagrams
Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams
Figure 2-23. Association between Window and Cursor showing you can't navigate from Cursor to Window Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
2.6.2.2. Naming an association UML 2.0 in a Nutshell
Associations may be adorned with several symbols to add information to your model. The ByDan Pilone,Neil Pitman simplest is a solid arrowhead showing the direction in which the viewer should read the association. It is............................................... common to include a short phrase along with the arrowhead to provide some Publisher:O'Reilly context for the association. The phrase used with the association doesn't typically generate Pub Date: June 2005 into any form of code representation; it is purely for modeling purposes. Figure 2-24 shows ISBN:0-596-00795-7 the solid arrowhead on the Window to Cursor association. Pages:234
Table of Contents | Index
Figure 2-24. Shows how to read the association between Window and Cursor
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 Multiplicity in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like 2.6.2.3.
you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. Because associations typically represent lasting relationships, they are often used to indicate attributes of a class. As mentioned in the "Attributes by Relationship" section, you can This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram express how many instances of a particular class are involved in a relationship. If you don't types, it also explains key concepts in a way that appeals to readers already familiar with specify a value, a multiplicity of 1 is assumed. To show a different value, simply place the UML or object-oriented programming concepts. multiplicity specification near the owned class. See "Attribute Multiplicity" for the allowable multiplicity types. Note that when you use multiplicity with an association, you don't use Topics include: square brackets around the values. Figure 2-25 shows an association with explicit multiplicity. The role and value of UML in projects
Figure A simple association showing four Buttons in a Window The 2-25. object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
The properties related multiplicity be applied to associations as included well. Seeto "Properties" If you're new to UML, to a tutorial with may realistic examples has even been help you for the names and definitions of allowed properties. quickly familiarize yourself with the system.
2.6.3. Aggregation
Aggregation is a stronger version of association. Unlike association, aggregation typically implies ownership and may imply a relationship between lifelines. Aggregations are usually read as "...owns a...". For example, if you had a classed named Window that stored its position UML 2.0 inclass, a Nutshell and size in a Rectangle you would say the "Window owns a Rectangle." The rectangle ByDanother Pilone,Neil Pitmanbut the Window has an intimate relationship with the may be shared with classes, Rectangle. This ............................................... is subtly different from a basic association; it has a stronger connotation. Publisher: O'Reilly relationship you can have between classes. If the relationship However, it's not the strongest Pub part Date:(class June 2005 is more of a whole A "...is part of..." class B), you should look at composition . ISBN:0-596-00795-7 Pages:234 with a diamond shape next to the owning class and a solid line You show an aggregation pointing to the owned class. Figure 2-26 shows an example aggregation between a class namedWindow and a class named Rectangle. Table of Contents | Index
System developersFigure have used modeling languages for decades to specify, visualize, 2-26. Window "owns a" Rectangle construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. As with the association relationship, you can show navigability and multiplicity on an Furthermore, it's been fully revised to cover version 2.0 of the language. aggregation line. See "Association" for examples. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with 2.6.4. Composition UML or object-oriented programming concepts. Composition represents a very strong relationship between classes, to the point of Topics include: containment. Composition is used to capture a whole-part relationship. The "part" piece of the relationship can be involved in only one composition relationship at any given time. The The and value of UML in projects relationships is almost always linked; if the lifetime of role instances involved in composition larger, owning instance is destroyed, it almost always destroys the part piece. UML does allow The paradigm and its relation to the UML the part toobject-oriented be associated with a different owner before destruction, thus preserving its existence, but this is typically an exception rather than the rule. An integrated approach to UML diagrams A composition relationship is usually read as "...is part of...", which means you need to read Class and Object, Case, Sequence, Collaboration, Statechart, Component, the composition from theUse part to the whole. For example, if you say thatActivity, a window in your and Deployment Diagrams system must have a titlebar, you can represent this with a class named Titlebar that "...is part of..." a class named Window. Extension Mechanisms You show a composition relationship using a filled diamond next to the owning class and a The Object Constraint Language (OCL) solid line pointing to the owned class. Figure 2-27 shows an example composition relationship between a class named Window and a class named Titlebar.
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
Figure 2-27. Titlebar "is a part of" Window
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
As with the association relationship, you can show navigability and multiplicity on a composition line. See "Association" for examples. Table of Contents | Index
2.6.5. Generalization System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common Ageneralization relationship conveys that the target of the relationship is a general, or less language that applies to a multitude of different systems. Essentially, it enables you to specific, version of the source class or interface. Generalization relationships are often used to communicate solutions in a consistent, tool-supported language. pull out commonality between difference classifiers. For example, if you had a class named Cat and a class named Dog, you can create a generalization of both of those classes called Today, UML has become the standard method for modeling software systems, which means Animal. A full discussion of how and when to use generalization (especially versus interface you're probably confronting this rich and expressive language more than ever before. And realization) is the subject for an object-oriented analysis and design book and isn't covered even though you may not write UML diagrams yourself, you'll still need to interpret here. diagrams written by others. Generalizations are usually read as "...is a...", starting from the more specific class and UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like reading toward the general class. Going back to the Cat and Dog example, you would say "a you who must read, create, and understand system artifacts expressed using UML. Cat...is a...Animal" (grammar aside). Furthermore, it's been fully revised to cover version 2.0 of the language. You show a generalization relationship with a solid line with a closed arrow, pointing from the This comprehensive new edition only2-28 provides a quick-reference to all 2.0 diagram specific class to the general class.not Figure shows an example of the CatUML to Animal types, it also explains key concepts in a way that appeals to readers already familiar with relationship. UML or object-oriented programming concepts.
Topics include:
Figure 2-28. Cat specializes the Animal base class The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you Unlike associations, generalization relationships are typically not named and don't have any quickly familiarize yourself with the system. kind of multiplicity. UML allows for multiple inheritance, meaning a class can have more than one generalization with each representing an aspect of the decedent class. However, some modern languages (e.g., Java and C#) don't support multiple inheritance; interfaces and interface realization are used instead.
2.6.6. Association Classes UML 2.0 in a Nutshell
Often the relationship between two elements isn't a simple structural connection. For ByDan Pilone,Neil Pitman example, a football player may be associated with a league by virtue of being on a team. If ............................................... the association between two elements is complex, you can represent the connection using an Publisher:O'Reilly association classPub . An association class is an association that has a name and attributes, like a Date: June 2005 normal class. You show an association class like a regular class with a dashed line connecting ISBN:0-596-00795-7 it to the association it represents. Figure 2-29 shows a football player's relationships to a Pages:234 league. Table of Contents | Index
Figure 2-29. Example association class System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive not onlywith provides a quick-reference all UML 2.0 diagram When translated into new code,edition relationships association classes oftentoresult in three classes: types, it also explains key concepts in a way that appeals to readers already familiar one for each end of the association and one for the association class itself. There may with or may UML programming concepts. not beora object-oriented direct link between the association ends; the implementation may require you to traverse through the association class to get to the opposite end of the link. In other words, Topics include: may not have a direct reference to FootballLeague but may have a reference FootballPlayer toFootballTeam instead. FootballTeam would then have a reference to FootballLeague. How the relationships are constructed is a matter of implementation choices; however, the The role and value of UML in projects fundamental concept of an association class is unchanged. The object-oriented paradigm and its relation to the UML integrated approach to UML diagrams 2.6.7.AnAssociation Qualifiers Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, Relationships between elements and Deployment Diagramsare often keyed, or indexed, by some other value. For example, a bank patron may be identified by her account number, or a tax payer by his Social Security number.Mechanisms UML provides association qualifiers to capture such information. A qualifier Extension is typically an attribute of the target element, though this isn't required. You show a qualifier by placing a smallConstraint rectangle Language between the association and the source element. Draw the name The Object (OCL) of the qualifier (usually the name of an attribute) in the rectangle. Figure 2-30 shows the relationship between the IRS and a taxpayer qualified by the taxpayer's Social Security number. If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
Figure 2-30. An association qualifier
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Table of Contents | Index
System developers have used modeling languages for decades to specify, visualize, Notice that and the multiplicity between The the Unified association qualifier and TaxPayer is one 1. Obviously construct, document systems. Modeling Language (UML) is of those the IRS is associated with more than one , but by to using qualifiers, indicate that a languages. UML makes it possible forTaxPayer team members collaborate by you providing a common socialSecurityNumber uniquely identifies a single TaxPayer within the IRS . language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 2.7. Interfaces ............................................... Publisher:O'Reilly Pub Date: June 2005 0-596-00795-7 Aninterface is a ISBN: classifier that has declarations of properties and methods but no Pages: implementations. You234 can use interfaces to group common elements between classifiers and
provide a contract a classifier that provides an implementation of an interface must obey. For example, you can create an interface named Sortable that has one operation named Table of Contents | Index comesBefore(...) . Any class that realizes the Sortable interface must provide an implementation of comesBefore(...). Some modern languages, such modeling as C++, don't support concept interfaces; UML System developers have used languages forthe decades to of specify, visualize, interfaces are typically represented as pure abstract classes. Other languages, such as Java, construct, and document systems. The Unified Modeling Language (UML) is one of those do support interfaces butit don't allow have properties. The moral is that you should be languages. UML makes possible forthem teamtomembers to collaborate by providing a common aware of how model going to be implemented whenEssentially, modeling your system. language thatyour applies to aismultitude of different systems. it enables you to communicate solutions in a consistent, tool-supported language. There are two representations for an interface; which one you should use depends on what you're to show. Thethe first representation the standard UML classifier notation the Today,trying UML has become standard method isfor modeling software systems, which with means stereotype «interface» .Figurethis 2-31 shows the Sortable interface. you're probably confronting rich and expressive language more than ever before. And
even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others.
Figure 2-31. interface UML 2.0 in a Nutshell from O'Reilly feelsThe your Sortable pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The second representation of an interface is the ball-and-socket notation. This representation paradigm and its relation to thefor UML showsThe lessobject-oriented detail for the interface but is more convenient showing relationships to classes. The interface is simply shown as a ball with the name of the interface written below it. Classes An integrated approach toshown UML diagrams dependent on this interface are attached to a socket matching the interface. Figure 232 shows the Sortable interface using the ball-and-socket notation. Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms
Figure 2-32. Examples of providing and requiring interfaces
The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Table of Contents | Index
Because an interface specifies the contract only for a set of features, you can't instantiate an interface directly. Instead, a class is said to realize an interface if it provides an implementation for the operations and properties. realization using a dashed line System developers have used modeling languagesYou for show decades to specify, visualize, starting at the classifier and leading to Modeling the interface, with a(UML) closedis arrowhead at the construct, andrealizing document systems. The Unified Language one of those end. ClassesUML thatmakes are dependent onfor theteam interface are shown using a dashed line with an open languages. it possible members to collaborate by providing a common arrow (dependency). 2-33 shows a class that realizes the Sortable interface and language that appliesFigure to a multitude of different systems. Essentially, it enables you to a class that is dependent it.consistent, tool-supported language. communicate solutions on in a
Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret Figure 2-33. Person realizes the Sortable interface and Alphabetizer diagrams written by others. depends on it UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms Providing implementation of an operation The an Object Constraint Language (OCL) is straightforward. You must provide an implementation on a realizing classifier with the same signature as the operation on the interface. Typically there are semantic constraints associated with an operation that must be honored by any implementation. Realizing a property is more subtle. A property on an If you're states new tothat UML, a tutorial with realistic even been to helpby you interface any class that realizes theexamples interfacehas must store theincluded data specified the quickly familiarize yourself with the system. propertyin some way . A property on an interface doesn't necessarily mean there will be an associated property on a realizing classifier. However, the classifier must be able to store the data represented by the property and provide a means to manipulate it.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 2.8. Templates ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN: 0-596-00795-7 Just as interfaces allow you to provide specifications for objects your class will interact with, 234 abstractions for the type of class your class may interact with. For UML allows you Pages: to provide
example, you can write a List class that can hold any type of object (in C++ this would probably be a void*, in Java and C# it would probably be an Object). However, while you Table of Contents | Indexclass to be able to support any type of object, you want all of the objects in wanted your List a given list to be of the same type. UML allows you to create and specify these kinds of abstractions using templates . System developers have used modeling languages for decades to specify, visualize, You can indicate that a class is a templated (also called parameterized ) class by drawing construct, and document systems. The Unified Modeling Language (UML) is one of those a dashed rectangle in the upper-right corner the class.toFor each element you would like to languages. UML makes it possible for teamofmembers collaborate by providing a common template, to specify a nameof todifferent act as a systems. placeholder for the actual type. you Write language you thatneed applies to a multitude Essentially, it enables to the placeholder name in the in rectangle. Figure 2-34 shows an example of a List class that can communicate solutions a consistent, tool-supported language. support any type. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret Figure 2-34. A templated List class diagrams written by others.
UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects This example uses ElementType as the name of the templated type for clarity. In practice, is its often abbreviated to just T. The object-oriented paradigmthis and relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, You can have multiple templated and Deployment Diagrams types within a single class; just separate the type names with a comma (,). If you need to restrict the types the user may substitute, show that with a colon (Extension :) followed by the type name. Figure 2-35 shows a more complicated version of the Mechanisms List class that requires a Sorter along with the type of object to store in the list. The Object Constraint Language (OCL)
Figure 2-35. A templated class with type restrictions
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Specifying restrictions on a type that may be used is functionally similar to specifying an interface for a templated member, except that the user may be able to further restrict an Table of Contents | Index instance of your class by specifying a subclass of your type. When a user creates an instance of a List, she needs to specify the actual type to use in place of ElementType . Thisused is called binding a type tofor a template. You show visualize, binding with the System developers have modeling languages decades to specify, keyword «bind» , followed by a type specification using the following syntax: construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common that applies to a multitude of different systems. Essentially, it enables you to RealType > communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means you're confronting thiswhenever rich and expressive moreclass thantoever before. You canprobably use the binding syntax you refer tolanguage a templated indicate youAnd want even though you may not write UML diagrams yourself, you'll still need to interpret to use a bound version of that class. This is called explicit binding . For example, Figure 2-36 diagrams written of byList others. shows a subclass called EmployeeList that binds the ElementType of List to a class namedEmployee. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language.
Figure 2-36. Explicit template binding
This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL) Thebind keyword also indicates what types should be used with an instance of a template. This is called implicit binding and is shown in Figure 2-37. If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
Figure 2-37. Implicit template binding
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages:234
Table of Contents | Index
System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutions in a consistent, tool-supported language. Today, UML has become the standard method for modeling software systems, which means you're probably confronting this rich and expressive language more than ever before. And even though you may not write UML diagrams yourself, you'll still need to interpret diagrams written by others. UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like you who must read, create, and understand system artifacts expressed using UML. Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented programming concepts. Topics include: The role and value of UML in projects The object-oriented paradigm and its relation to the UML An integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms The Object Constraint Language (OCL)
If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman 2.9. Variations on Class Diagrams ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Because class diagrams model structures well, they can be used to capture well-defined, Pages:234Class diagrams have been used to capture XML and database hierarchical information.
schemas with some degree of success. In the interest of full disclosure, people who deal with XML and database schemas extensively have reservations about using class diagrams to Table of Contents | Index capture the information, specifically because class diagrams are so generic. Each domain has its own notation that may be better suited to capturing complex relationships or domainspecific information. However, UML has the benefit of being a common language that is understood by thosehave outside the XML andlanguages database for domains. System developers used modeling decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that Schemas applies to a multitude of different systems. Essentially, it enables you to 2.9.1. XML communicate solutions in a consistent, tool-supported language.
Today, UML has become the standard method for modeling software systems, which means The structural design of an XML document can be captured in an XML schema. XML schemas you're probably confronting this rich and expressive language more than ever before. And are to XML documents as classes are to objects; XML documents are instances of a schema. even though you may not write UML diagrams yourself, you'll still need to interpret Therefore, it's not a giant leap to realize that class diagrams can be used to model XML diagrams written by others. schemas. XML schemas are described using the XML Structure Definition Language (XSDL). XSDL is a text language (as opposed to the graphical nature of UML) and can be verbose; UML 2.0 in a Nutshell from O'Reilly feels your pain. It's been crafted for professionals like mapping XSDL to UML can make it much easier to digest a schema document. you who must read, create, and understand system artifacts expressed using UML. Furthermore, it'selements been fullyofrevised to cover version 2.0 of the language. The fundamental XSDL are XML elements, which are connected in sequences, choices, and complex structures. Each element may have extra information attached to it This comprehensive new edition not only providestypically a quick-reference to allelements UML 2.0 as diagram using (conveniently enough) attributes. Modelers represent XML classes types, it also explains key concepts in a way that appeals to readers already familiar with and XSDL attributes as UML attributes. Each element is linked to the next using composition UML or Multiplicity object-oriented programming concepts. arrows. specifications on the relationships show how many times one element appears within another. Example 2-1 is a sample XML document that describes a piece of Topics include: equipment.
The role and value of UML in projects
Example 2-1. A sample XML document The object-oriented paradigm and its relation to the UML integrated approach to UML diagrams Class and Object, Use Case, Sequence, Collaboration, Statechart, Activity, Component, and Deployment Diagrams Extension Mechanisms lang="en">Hammer Furthermore, it's been fully revised to cover version 2.0 of the language. This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-oriented concepts. Topics include: The role and value of UML in projects The~Class: object-oriented paradigm ~~~~~~~~~~~~~~~~~~~~~~~~~~~ and its relation to the UML An integrated approach to UML diagrams Class and Deployment Diagrams Extension Mechanisms > lang~~~~~~~~~~~~ --> The~Class: Object Constraint Language (OCL) If you're new to UML, a tutorial with realistic examples has even been included to help you quickly familiarize yourself with the system.
UML 2.0 in a Nutshell ByDan Pilone,Neil Pitman ............................................... Publisher:O'Reilly Pub Date: June 2005 ISBN:0-596-00795-7 Pages: 234 Table of Contents | Index System developers have used modeling languages for decades to specify, visualize, construct, and document systems. The Unified Modeling Language (UML) is one of those languages. UML makes it possible for team members to collaborate by providing a common language that applies to a multitude of different systems. Essentially, it enables you to communicate solutionsname="technicalcontact"> in a consistent, tool-supported language.