Table Of ContentG
hassan GoMaa
o
M
this book tells you all you need to know for modeling and design of software a
a Software
applications from use cases to software architectures in UMl, and shows
how to apply the CoMet UMl-based modeling and design method to real-
world problems. the author describes architectural patterns for various ar-
chitectures, such as layered patterns for software product line architectures, s Modeling
and addresses software quality attributes including maintainability, modifiabil- o
f
ity, testability, traceability, scalability, reusability, performance, availability, and
t
security.
w & deSign
a
Complete case studies illustrate design issues for different software architec-
r
tures: a banking system for client/server architectures, an emergency moni-
e
toring system for component based software architecture, an online shopping
system for service-oriented architecture, and an automated guided vehicle for M
real-time software architecture. o
d
organized as an introduction followed by several short, self-contained chap- e
ters, the book is perfect for senior undergraduate or graduate courses in L
i
software engineering and for experienced software engineers wanting a quick n
reference at each stage of the analysis, design and development of large- G
scale software systems.
a
n
Hassan gomaa is Professor and Chair of the department of Computer
d
Science at george Mason University. gomaa has more than thirty years
experience in software engineering, both in industry and academia. He has d
e
published over 150 technical papers is the author of three previous books,
s
designing Software Product lines with UMl, designing Concurrent, distrib-
i
uted, and real-time applications with UMl, and Software design Methods for G
n
Concurrent and real-time Systems.
UML, Use Cases, Patterns,
& software arChiteCtUres
Cover design by aliCe SolowaY
Software Modeling and Design
Thisbookprovidesallyouneedtoknowformodelinganddesignofsoft-
ware applications, from use cases to software architectures in UML. It
shows you how to apply the COMET UML-based modeling and design
method to real-world problems. The author describes architectural pat-
ternsforvariousarchitectures,suchasbroker,discovery,andtransaction
patternsforservice-orientedarchitectures,andlayeredpatternsforsoft-
wareproductlinearchitectures,andaddressessoftwarequalityattributes,
including maintainability, modifiability, testability, traceability, scalabil-
ity,reusability,performance,availability,andsecurity.
Complete case studies illustrate design issues for different software
architectures:abankingsystemforclient/serverarchitectures,anonline
shoppingsystemforservice-orientedarchitectures,anemergencymoni-
toringsystemforcomponent-basedsoftwarearchitectures,andanauto-
matedguidedvehiclesystemforreal-timesoftwarearchitectures.
Organizedasanintroductionfollowedbyseveralself-containedchap-
ters,thebookisperfectforseniorundergraduateorgraduatecoursesin
softwareengineeringandforexperiencedsoftwareengineerswhowanta
quickreferenceateachstageoftheanalysis,design,anddevelopmentof
large-scalesoftwaresystems.
Hassan Gomaa is Professor of Computer Science and Software Engi-
neeringatGeorgeMasonUniversity.Gomaahasmorethanthirtyyears’
experience in software engineering, in both industry and academia. He
haspublishedmorethan170technicalpapersandistheauthorofthree
books:DesigningSoftwareProductLineswithUML;DesigningConcur-
rent, Distributed, and Real-Time Applications with UML; and Software
DesignMethodsforConcurrentandReal-TimeSystems.
SOFTWARE MODELING
AND DESIGN
UML, Use Cases, Patterns, and
Software Architectures
Hassan Gomaa
GeorgeMasonUniversity,Fairfax,Virginia
cambridgeuniversitypress
Cambridge,NewYork,Melbourne,Madrid,CapeTown,
Singapore,Sa˜oPaulo,Delhi,Tokyo,MexicoCity
CambridgeUniversityPress
32AvenueoftheAmericas,NewYork,NY10013-2473,USA
www.cambridge.org
Informationonthistitle:www.cambridge.org/9780521764148
(cid:2)C HassanGomaa2011
Thispublicationisincopyright.Subjecttostatutoryexception
andtotheprovisionsofrelevantcollectivelicensingagreements,
noreproductionofanypartmaytakeplacewithoutthewritten
permissionofCambridgeUniversityPress.
Firstpublished2011
PrintedintheUnitedStatesofAmerica
AcatalogrecordforthispublicationisavailablefromtheBritishLibrary.
LibraryofCongressCataloginginPublicationdata
Gomaa,Hassan.
Softwaremodelinganddesign:UML,usecases,patterns,andsoftwarearchitectures/
HassanGomaa.
p. cm.
Includesbibliographicalreferencesandindex.
ISBN978-0-521-76414-8(hardback)
1.Computersoftware–Development. 2.Softwarearchitecture. 3.Computersimulation. I.Title.
QA76.76.D47G6522 2011
003(cid:3).3–dc22 2010049584
ISBN978-0-521-76414-8Hardback
CambridgeUniversityPresshasnoresponsibilityforthepersistenceoraccuracyofURLsforexternal
orthird-partyinternetwebsitesreferredtointhispublicationanddoesnotguaranteethatanycontent
onsuchwebsitesis,orwillremain,accurateorappropriate.
ToGill,WilliamandNeela,Alex,
AmandaandNeil,andEdward
Contents
Preface pagexv
AnnotatedTableofContents xix
Acknowledgments xxv
PART I Overview
1 Introduction 3
1.1 SoftwareModeling 3
1.2 Object-OrientedMethodsandtheUnifiedModeling
Language 3
1.3 SoftwareArchitecturalDesign 5
1.4 MethodandNotation 5
1.5 COMET:AUML-BasedSoftwareModelingandDesign
MethodforSoftwareApplications 6
1.6 UMLasaStandard 6
1.7 MultipleViewsofSoftwareArchitecture 7
1.8 EvolutionofSoftwareModelingandDesignMethods 8
1.9 EvolutionofObject-OrientedAnalysisandDesignMethods 9
1.10 SurveyofConcurrent,Distributed,andReal-Time
DesignMethods 11
1.11 Summary 12
Exercises 12
2 Overview of the UML Notation 14
2.1 UMLDiagrams 14
2.2 UseCaseDiagrams 15
2.3 ClassesandObjects 15
2.4 ClassDiagrams 16
2.5 InteractionDiagrams 18
2.6 StateMachineDiagrams 19
2.7 Packages 21
vii
viii Contents
2.8 ConcurrentCommunicationDiagrams 21
2.9 DeploymentDiagrams 23
2.10 UMLExtensionMechanisms 23
2.11 ConventionsUsedinThisBook 25
2.12 Summary 27
Exercises 28
3 Software Life Cycle Models and Processes 29
3.1 SoftwareLifeCycleModels 29
3.2 DesignVerificationandValidation 40
3.3 SoftwareLifeCycleActivities 41
3.4 SoftwareTesting 42
3.5 Summary 43
Exercises 43
4 Software Design and Architecture Concepts 45
4.1 Object-OrientedConcepts 45
4.2 InformationHiding 48
4.3 InheritanceandGeneralization/Specialization 51
4.4 ConcurrentProcessing 53
4.5 DesignPatterns 57
4.6 SoftwareArchitectureandComponents 58
4.7 SoftwareQualityAttributes 59
4.8 Summary 59
Exercises 60
5 Overview of Software Modeling and Design Method 61
5.1 COMETUseCase–BasedSoftwareLifeCycle 61
5.2 ComparisonoftheCOMETLifeCyclewithOther
SoftwareProcesses 64
5.3 Requirements,Analysis,andDesignModeling 65
5.4 DesigningSoftwareArchitectures 67
5.5 Summary 68
Exercises 68
PART II Software Modeling
6 Use Case Modeling 71
6.1 RequirementsModeling 72
6.2 UseCases 74
6.3 Actors 76
6.4 IdentifyingUseCases 78
6.5 DocumentingUseCasesintheUseCaseModel 80
6.6 ExampleofUseCaseDescription 80
6.7 UseCaseRelationships 82
6.8 TheIncludeRelationship 82
6.9 TheExtendRelationship 85
6.10 UseCaseStructuringGuidelines 88
Contents ix
6.11 SpecifyingNonfunctionalRequirements 89
6.12 UseCasePackages 89
6.13 ActivityDiagrams 89
6.14 Summary 92
Exercises 92
7 Static Modeling 94
7.1 AssociationsbetweenClasses 95
7.2 CompositionandAggregationHierarchies 100
7.3 Generalization/SpecializationHierarchy 102
7.4 Constraints 103
7.5 StaticModelingandtheUML 103
7.6 StaticModelingoftheSystemContext 104
7.7 CategorizationofClassesUsingUMLStereotypes 106
7.8 ModelingExternalClasses 107
7.9 StaticModelingofEntityClasses 111
7.10 Summary 113
Exercises 114
8 Object and Class Structuring 115
8.1 ObjectandClassStructuringCriteria 116
8.2 ModelingApplicationClassesandObjects 116
8.3 ObjectandClassStructuringCategories 117
8.4 ExternalClassesandSoftwareBoundaryClasses 118
8.5 BoundaryClassesandObjects 119
8.6 EntityClassesandObjects 123
8.7 ControlClassesandObjects 124
8.8 ApplicationLogicClassesandObjects 127
8.9 Summary 130
Exercises 130
9 Dynamic Interaction Modeling 132
9.1 ObjectInteractionModeling 133
9.2 MessageSequenceNumberingonInteraction
Diagrams 136
9.3 DynamicInteractionModeling 139
9.4 StatelessDynamicInteractionModeling 139
9.5 ExamplesofStatelessDynamicInteractionModeling 140
9.6 Summary 148
Exercises 148
10 Finite State Machines 151
10.1 FiniteStateMachinesandStateTransitions 151
10.2 ExamplesofStatecharts 153
10.3 EventsandGuardConditions 157
10.4 Actions 158
10.5 HierarchicalStatecharts 163
10.6 GuidelinesforDevelopingStatecharts 167