图书目录

Ä¿  Â¼£º

1 Introduction to UML 1

Models and modelling 1

Methodologies 5

The Unified Modeling language 7

Design models and code 11

The software development process 12

Summary 12

Exercises 13

2 Modelling with Objects 14

The object model 14

Classes and objects 16

Object properties 19

Avoiding data replication 21

Links 21

Associations 24

Message passing 25

Polymorphism 27

Dynamic binding 32

The applicability of the object model 33

Summary 35

Exercises 36

3 Software Development Processes 39

The waterfall model 39

Alternatives to the waterfall model 43

The Unified Process 46

The role of models in development 47

The use of UML in the Unified Process 49

Summary 51

Exercises 52

4 Restaurant System: Business Modelling 53

Informal requirements 53

Use case modelling 55

Describing use cases 58

Structuring the use case model 61

Completing the use case model 65

Domain Modelling 67

Glossaries 71

Summary 71

Exercises 72

5 Restaurant System: Analysis 75

The purpose of analysis 75

Object design 77

Software Architecture 78

Use case realization 82

Recording new bookings 88

Cancelling bookings 90

Updating bookings 92

Completing The Analysis Model 94

Summary 94

Exercises 96

6 Restaurant System: Design 98

Receiving input from the user 98

Producing output 101

Persistent data storage 104

The Design Model 109

Detailed class design 109

Dynamic modelling of behaviour 111

A statechart for the booking system 113

A statechart for reservations 117

Summary 119

Exercises 119

7 Restaurant System: Implementation 121

Implementation diagrams 121

Implementation strategies 124

Application frameworks 125

The Java AWT framework 128

Implementation of classes 130

Implementation of associations 134

Implementation of operations 137

Summary 139

Exercises 140

8 Class and Object Diagrams 141

Data types 142

Classes 144

Describing objects with classes 145

Associations 150

Generalization and specialization 156

Inheritance of attributes and operations 160

Aggregation 164

Composition 166

Association classes 168

N-ary associations 171

Qualified associations 172

Interfaces 175

Templates 176

Summary 177

Exercises 178

9 Interaction Diagrams 187

Collaborations 187

Classifier roles 189

Association roles 190

Interaction diagrams 192

Object creation 195

Object destruction 196

Role multiplicity and iterated messages 197

Multiobjects 198

Conditional messages 200

Messages to self 203

Summary 204

Exercises 205

10 Statecharts 208

State-dependent behaviour 209

States, events and transitions 210

Initial and final states 211

Guard conditions 212

Actions 214

Activities 216

Composite states 218

History states 221

Summary of the CD player 222

Dynamic modelling in practice 223

Time events 228

Activity states 228

Summary of the ticket machine 229

Summary 229

Exercises 231

11 Component Diagrams 235

Dependencies 236

Components and Artefacts 237

Component Diagrams 239

Some common physical relationships 239

Compilation dependencies 241

Components and Interfaces 245

Summary 246

Exercises 246

12 Constraints 248

Standard constraints 249

The Object Constraint Language 250

The context of a constraint 251

Navigation expressions 253

OCL data types and operations 256

Constraints 260

Stereotyped constraints 263

Constraints and generalization 266

Summary 267

Exercises 268

13 Implementation Strategies 270

CONTENTS ix

Implementing associations 271

Unidirectional implementations 272

Bidirectional implementations 275

Implementing qualified associations 282

Implementing association classes 283

Implementing constraints 285

Implementing statecharts 286

Reverse Engineering 289

Summary 293

Exercises 294

14 Principles and Patterns 298

The open¨Cclosed principle 299

No concrete superclasses 303

Decouple the interface hierarchy 305

The Liskov substitution principle 307

Interactions determine structure 308

Design patterns 310

Recursive structures 312

The State and Strategy patterns 316

MVC, document/view and Observer 317

Applying visitor to the stock control program 320

Summary 324

Exercises 324

A UML Notation Summary 326

General concepts 326

Model structure 329

Use case diagrams 330

Object diagrams 330

Collaborations 331

Messages 332

Collaboration diagrams 333

Sequence diagrams 333

Class diagrams 335

Statechart diagrams 338

Component diagrams 339

Templates 340

B OCL Summary 341

Constraints 341

Expressions 341

Basic Types 342

Model Types 344

Collections 344

C A Template for use case descriptions 348

¡¡