Вы находитесь на странице: 1из 184

 

Books.Ru 
ISBN 593286060X,
UML. , 3  Books.Ru
 . 
, 
. 
, 
 (piracy@symbol.ru), .

UML Distilled
A Brief Guide to the Standard
Object Modeling Language
Third Edition

Martin Fowler

UML




2005

UML. , 3
.

.

.
.
.
.
.
.

M.
UML. , 3 . . . : , 2004. 192 .,
.
ISBN 593286060
UML. UML 2 
, . 
. , ,
UML.

UML 
. UML, ,

. , , , , 
, , , , , 
, , .

UML, , UML
.
.
ISBN 593286060
ISBN 0321193687 ()
, 2004
Original English language title: UML Distilled: A Brief Guide to the Standard Object
Modeling Language, Third Edition by Martin Fowler, Copyright 2004 by Pearson
Education, Inc. All Rights Reserved. Published by arrangement with the original pub
lisher, Pearson Education, Inc., publishing as ADDISON WESLEY.
, 
. 
, , .

. 199034, , 16 , 7,
. (812) 3245353, edit@symbol.ru. N 000054 25.12.98.

00593, 2; 953000 .
9.12.2004. 701001/16 . .
12 . . 2000 . N

199034, , 9 , 12.


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
UML? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
UML? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
. . . . . . . . . . . . . . . . . . . . . . . . . 49
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Rational . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

3. : . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
, . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
. . . . . . . . . . . . . . . . . . . 89

5. : . . . . . . . . . . . . . . . . . . . . . . 92
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
ReadOnly Frozen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
. . . . . . . . . . . . . . . . . . . . . 103
 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
( ) . . . . . . . . . . . . . . . . . . . . . . . . . . 108
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
. . . . . . . . . . . . . . . . . . . . . . . 122

9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
( ) . . . . . . . . . . . . . . . . . . . . . . . . . 128
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
. . . . . . . . . . . . . . . . . . . . . . . . . . . 137
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

11. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
. . . . . . . . . . . . . . . . . . . . . . . . 150
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
. . . . . . . . . . . . . . . . . . 154

13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

10

14. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
. . . . . . . . . . . . . . . . . . . . . . . . . 160

15. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163

16. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
. . . . . . . . . . . . . . . 164

17. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
. . . . . . . . . . . . . . . . . . . . . . . . . . . 167

A. UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180


. 1.1. UML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
. 1.2. UML . . . . . . . . . . . . . . . . . . . . . . . 39
. 1.3. . . . . . . . . . . . . . . . . . . . 42
. 3.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
. 3.2. . . . . . . . . . . . . . . 64
. 3.3. . . . . . . . . . . . . . 64
. 3.4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
. 3.5. . . . . . . . . . . . . . . . . . . 69
. 3.6.
. . . . . . . . . . . . . . . . . . . 73
. 3.7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
. 4.1.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
. 4.2.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
. 4.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
. 4.4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
. 4.5. . . . . . . . . . . . . . . . . . . . . 87
. 4.6. CRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
. 5.1. . . . . . . . . . . . 94
. 5.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
. 5.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
. 5.4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
. 5.5. . . . . . . . . . . . . . 96
. 5.6.
Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
. 5.7.  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
. 5.8.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
. 5.9.
. . . . . . . . . . . . 99

12
. 5.10. . . . . . . . . . . . . . . . . . . . . . . . . . 102
. 5.11. . . . . . . . . . . . . . . . . . . . . . . . . . . 104
. 5.12.  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
. 5.13.  . . . . . . . . . . . 105
. 5.14.  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
. 5.15. . . . . . . . . . . 107
. 5.16. temporal . . . . . . . . . . . . . . . . 107
. 5.17.  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
. 5.18. ( 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
. 5.19. ( 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
. 5.20. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
. 5.21. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
. 5.22. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
. 6.1. ,
Party. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
. 6.2.
Party. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
. 7.1. . . . . . . . . . . . . . . 115
. 7.2. . . . . . . . 117
. 7.3. . 7.2 . . . . . . . . . . . . . . . . . . . . . . . . . 118
. 7.4. , . . . . . . . . . . . . . . . . . . 119
. 7.5.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
. 8.1. . . . . . . . . . . . . . . . . . . . . . . . . 122
. 9.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
. 9.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
. 10.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
. 10.2. ,
. . . . . . . . . . . . . . . . . . . . . . . . . . . 132
. 10.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
. 10.4. . . . . . . . . . . . 134
. 10.5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
. 10.6. switch C#
. . . . . . . . . . . . . . . . . . . . . . . . 135
. 10.7. ,
. 10.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
. 11.1. . . . . . . . . . . . . . . . . . . . . . . . . . 140
. 11.2. . . . . . . . . . . . . . . . . . 142

13
. 11.3. . 11.1
. 11.2 . . . . . . . . . . . . . . . . . . . . . 142
. 11.4. . . . . . . . . . . . . 143
. 11.5. . . . . . . . . . . . . . . . . . . . . . . . 144
. 11.6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
. 11.7. . . . . . . . . . . . . . . . . . . . . . . 146
. 11.8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
. 11.9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
. 11.10.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
. 11.11. . . . . . . . . . . . . . . . . . . . . . . . . . 149
. 11.12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
. 12.1.
. . . . . . . . . . . . . . . . . . . . . . . . . . . 153
. 12.2.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
. 13.1. TV Viewer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
. 13.2. (,
) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
. 13.3. . . . . . . . . . . . . . . . . . . . . . . . 156
. 14.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
. 14.2. . . . . . . . . . . . . . . . . . . . . . . . . . 159
. 15.1. . . . . . . . . . . . . . . . . 161
. 15.2.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
. 15.3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
. 15.4. JUnit . . . 163
. 16.1. . . . . . . . . . . . . . . . . . . . . . . . . 165
. 17.1. ,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
. 17.2. ,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 167


UML Distilled UML.
, 
.
(Craig Larman),
Applying UML and Patterns
UML, 
UML.
(Jim Rambaugh),
UML
UML Distilled
UML.
UML. , UML 
, 
. 
UML. .
(Steve Cook), , Microsoft
UML , . 
UML.
.
(Alistair Cockburn),
Humans and Technology
,

. UML,
.
(Andy Carmichael),
BetterSoftwareFaster, Ltd.
UML, .
(John Crupi), Sun Microsystems,
Core J2EE Patterns

, UML, UML, 
UML UML,
( ). ,
. , , ,
, .
(Jon Kern),
UML.
. (Scott W. Ambler),
Agile Modeling
UML , 
, . 
, .
(Stephen J. Mellor),
Executable UML
, UML, 
UML . 
, UML
, 
UML.
. , .
, UML 
 .
(Pavel Hruby),
Microsoft Business Solutions
,
. ,
, UML, .
(Charles Ashbacher),
/CEO, Charles Ashbacher Technologies
, UML Distilled, 
. UML, , 
. 
, 
.
(Rob Purser), Purser Consulting, LLC.




. ,
( , ),
( ), :
, 
. 
, UNIX Small
talk .
, , 
, , 
. , ,
.
. 
,
UML (Unified Modeling Language 
). 
UML, . 

, UML 1.1 2.0,
.
UML ,

. ,
,
.
, UML 2.0,
,
UML? , .
, 
. 
, 
. , 
, 

17

UML . 
, , 20%
UML, 80% . 
!
, ,
, . 
, 
,

.
, ,
UML ,
. UML 
, 
, 
. 

.
. 

, UML 2.0.

UML 2.0, .
, , 
, , .


UML.

.

, ,
, , 
UML 
. , , , 

.
(Cris Kobryn)
Chair, U2 Partners UML 2.0 Submission Team
Chief Technologist, Telelogic




(Unified Modeling Language, UML), ,
, 

,
. , 


. UML 

.
UML 
, 
.
,
 
. UML, 
,
.

.
UML , 

, .
, 
UML, ,
, .

UML, ,
UML . 

, 12 
.

19

UML 
, 

.
, 
UML , 
.



; 
, , 
, 1997
.
 ()

(Unified Modeling Language, UML). UML 
, 
. , 
UML, 
.
, , ?
, . , 
UML, 
. 
. 
, . 
, .
, , 
,
. ( , 
; 
.)
, ,
UML. ,
. 
,
User Guide [6] Reference Manual [40].

UML. ,
UML .
.
, , . 
, . 

21

, , , ,
.
,
,
. ,
. (Craig Larman) [29].
, UML,
.
UML , 
.
UML , 
UML, ,
, , 
UML.
MDA (Model Driven Architecture)
, . ,
, UML, 
MDA. , MDA ,
, 
UML, , MDA.
UML,
, 
 , , 
CRC. UML , 
, , 
.
, , ,
UML , ,
. 

UML. Java C#, 
, .
, . 
Smalltalk!

UML?

. , 
. 
, 
. ,
.  
, 
. ,

22

, , 
.
,
.
, 
, , . 
UML 

,  .
UML 
 ,
.


1 UML: 
, ,
.
2 .
UML, , 
, , UML. 
, ,
.
UML 
. 3 4 UML
( ) 
. , , , 
, 
. UML , UML .
5 , 
. 6 8
, : 
, .
9 11
: , ( 
,
) . 12 17
,
, 
.

. ,
. ,
.

23


, ,
, ,
.

UML 2. , 
.
, 
. ,
,
( !),
.
, ,
,
, , UML
. , 
, .
, 
. UML ,
. UML 2,
2003 . ,
, 
, ,
UML 2 , . 
 http://mar'
tinfowler.com.

. 
(Carter Shanklin) 
(Kendall Scott). 
AddisonWesley, . 
,
.

, , 
AddisonWesley.
UML, .
.

,
.

24

, , UML
.
UML , .
, , ,
, .
, (Conrad Bock),
(Steve Cook), (Cris Kobryn), (Jim Odell),
(Guus Ramackers) (Jim Rumbaugh),
. 
.
(Grady Booch), (Ivar Jacobson)
(Jim Rumbaugh) .
,
. , 
.
, , 
.
(Simmi Kochhar Bhargava),
(Grady Booch), (Eric Evans), (Tom
Hadfield), (Ivar Jacobson),
(Ronald E. Jeffries), (Joshua Kerievsky),
(Helen Klein), (Jim Odell), (Jim Rum
baugh) (Vivek Salgar).
:
(Conrad Bock)
(Andy Carmichael)
(Alistair Cockburn)
(Steve Cook)
(Luke Hohmann)
(Pavel Hruby)
(Jon Kern)
(Cris Kobryn)
(Craig Larman)
(Steve Mellor)
(Jim Odell)
(Alan OCallaghan)
(Guus Ramackers)
(Jim Rumbaugh)
(Tim Seltzer)
,
.
. 
. , 
martinfowler.com.

25

, 
UML, (Don Baisley),
(Morgan Bjrkander), (Conrad Bock), (Steve
Cook), (Philippe Desfray), (Nathan
Dykman), (Anders Ek), (David Frankel),
(Eran Gery), (ystein Haugen),
(Sridhar Iyengar), (Cris Kobryn), 
(Birger MllerPedersen), (James Odell),
(Gunnar vergaard), (Karin Palmkvist),
(Guus Ramackers), (Jim Rumbaugh),
(Bran Selic), (Thomas Weigert)
(Larry Williams).  .
(Pavel Hruby) 
Visio, UML;
http://phruby.com.

. ,
.
SoftPro 
, ,
, ,
UML. , .
(Mike
Hendrickson). (Kim Arney Mulcahy) 
, . 
AddisonWesley ,
(Evelyn Pyle) (Rebecca Rider)
. .
, . 
.
.

,
http://martinfowler.com

UML?
(UML) 
, .
, 
, 
() .  . 
UML . 
,
, 
. 


UML .

.
, 
, 
.

,
.
UML.
UML , 
OMG (Object Management Group
), .
OMG , 
,
 . , OMG 
CORBA (Common Object Request Broker Architec
ture ).

28

1.

UML 
,
80 90 . 1997 , 
, 
.

UML
UML
, ,
.
,
UML.
, (Steve Mellor)

UML : ,
. , ,
, , 
UML . 
UML .

. (forward'engineering) 
, (re'
verse'engineering) ,
.
, , 
.
, , 
.

, . ,
, ,
,
, 
. : 10 

, .
, ,
. ,
,
, . 

, .
, 
, . 
,

UML

29


UML. UML, ,
, . 
, .
, UML 
. ,
,
, 
. 
, 
.
, , ,
,
.
, 
, 
.

 .
, 
, 
.

,
, 
.
, .
,
, 
, . 
CASE (computeraided software engineering 
)
, , 
. 

. 
, 
. ,
, ,
(round'trip).

, .

.
.

30

1.

, ,
,
, , 
,
.
, ,
.
UML,
, 
.
CASE , 
. ,
, UML
UML '
. 
, , UML 
. , UML
. ( , 
, UML
.)
, UML 
, . UML 2
: 
, .
. UML 
,
, .
UML 

.
UML
. UML

. , 
, UML, 
.
UML 
.
,
.
.
,
.
, UML 
. 
. UML ,

UML

31

, ,
UML
UML, MDA (Model Driven Ar
chitecture , ) [27]. 
, MDA
UML ; 
OMG, UML. 
, MDA,
, MDA 
.
MDA, UML, MDA 
UML . , 
, MDA, UML.
MDA . 
,
PIM (Platform Independent Model , 
). PIM UML,  
. PIM PSM
(Platform Specific Model , ). PSM
, 
. PSM
. PSM UML, 
.

MDA, PIM 
. 
J2EE .NET 

PSM .
PIM PSM 
,
UML . 
, UML 
.
(Steve Mellor) 
'
UML (Executable UML) [32]. UML
MDA, .
, , 
MDA PIM. 
(Model Compiler),
UML 
; PSM .
, .

32

1.


. (archetype) 
UML .

(J2EE .NET).
UML,
.
UML UML;
. 
UML , .
, ?
, . , 
: ,
. ; ,
, ,
.

UML . ,
UML ,
,
.
,
. UML ,
, 
. UML 
. ,
Smalltalk, 
, . 
Smalltalk 
, ,
. Smalltalk, UML
, .
(asset pool)
,
.

(specification) (implementa
tion). , 
, , 
.
, .
UML 
, UML 

UML

33

. UML
. , UML
, , 
. ,
, , 
(moron ).
UML.
, UML,
, UML . UML
,
UML. .
, UML
.
, , UML,
. 
, UML.
, .
UML . ,
UML , ,
, .
, 
, , 
. 
, 
,
.
, 
. ,
; 
, .
, UML
, ,  
. , 
,
, , 
.
,
, UML . ,
.
UML 
, 
, . 
UML,
, 

34

1.

. , ,
, .

UML
, .
. ,
. , , 
, UML,
.
80 
.
Smalltalk , 
; C++. 

.

1988 1992 . 
(Grady Booch) [5]; (Pe
ter Coad) [7], [8]; (Ivar Jacobson) (Objectory) [24];
(Jim Odell) [34]; (Jim Rumbaugh) (OMT) [38],
[39]; (Sally Shlaer) M (Steve Mellor) [41],
[42];  (Rebecca WirfsBrock) (Responsibility Driven
Design) [44].

, . 
, ,
.
,
.
, 
. OMG
, 
. ( . 
: ? : 
.)
, UML, 
GE Rational (
IBM). ,
/ 1 .
, ,
1

( ) , 
, .
. .

UML

35

, ,
Microsoft.
 .
OOPSLA 95
0.8
(Unified Method). 
, , Rational Software Objectory

. Rational , 0.8.
(
; , .)
. OMG, 
,
. Rational , 
. , OMG 
.
, OMG. 
, , , 
. , 
OMG. OMG 
. , 
, Rational,
. 
OMG
CASE. , 
OMG . 
UML, CASE
.
(Mary Loomis)
, .
, ,
, Rational.
1997
,
. Rational 
1.0
UML ,
(Unified Modeling Language).
, 
. OMG 
1.1 OMG. 
. 1.2 ,
1.3 . 1.4 
, 1.5
.

36

1.

UML,
, .
(Three Amigos),
. 
UML, ,
. UML 
/.
OMG. 
,
. , 
UML UML.


UML 
. 
, ; 
. , 
, ,
.
, 
, .
,

.

.

. 
. 
. 
, ,
,
.

; ,
.
. 
,  ,
.

, . 

( , ), .

37

. 1.1 UML, 
. ( 
,
. 
.)

0..1

{ordered}

. 1.1. UML

, 
? ,
, .
; 
. , UML 
,
.
, UML, 
, , 
UML . 
, , 
.
UML, ,
, .
UML .
.
.
, , , , 
.
.

38

1.

UML
UML 2 13 ,
. 1.1, . 1.2.

UML , UML 
. 
. 
. UML 
, 
, .
1.1. UML

11

UML 1

3, 5

UML 1

12

 
;
UML 1

14

UML 1

13

UML 2

UML 1

16

 UML 2


UML 1



UML 1

 UML 1
; 

10

UML 1

17

 UML 2
;

 UML 1

39

UML?

. 1.2. UML

UML?
, : UML
, .
.

40

1.

,
UML: . 
(prescriptive rules) ,
, ,
, 
. (descriptive rules) ,
,
. 
, 
, , 
, , 
.
UML , ,
. UML 
,
.
, 
; 
, . 
, , , 
, ; , 
. UML
, .
UML, 
, .
, , , 
UML. UML,
, .
,  
. , UML
UML, .
, UML
. UML
UML, . ,
UML 2,
, UML 1,
,
. UML ,
: , . 
, 
(conventional use), 
, , , , 
.  ,
(standard) (normative). (
, 

UML

41

, ,
. UML 
, 
UML.)
UML, ,
UML , 
.

 .
 .
UML , [1] 
, ,
, ,
.
, , 
, , 
.
UML, 
.
,
UML, UML, . ,
,
, UML.
(, UML 
, 
!)

UML
UML , 
UML,
, UML 
UML.
, UML 
. UML 
, .
. 
. 
, , , 
.

UML
UML 
, ,

42

1.

, , ,
.
, ,
UML, UML, .
(. 1.3)
.

, , 
. UML , 
.
WelcomeVisitors

RecentChanges

Find Page



SomeWikiPage


Visual Tour

Edit Page

. 1.3. wiki
(http://c2.com/cgi/wiki)

. 1.2 . 

. ,
, 
. 
,
. 1.2 : , 
, .

43

,
.
1.2.

$150

$100

$70

$50

$80

$60

.
,
. , . 
. ( , , UML.)


, UML, UML
. 
UML.
, , 
.
, , 

. ,
.
, 

. ,
. , 
.



UML, 
. ,
, , .

,
.
UML  .

44

1.

,
UML, . 2003 ,
, UML 2.0,
,  
. , 
, UML 2.
, 
[29].
, 
.
UML 
, ,

. 
[40].

,
[30].
,
. , ,
(. 54) 
.

2

, UML 
. 

,
.
, UML , 
, , 
.

UML .
UML. , 
. , 
,
. UML
, .
, , 
, UML. 
 ; 
,
, , .
UML RUP (Rational
Unified Process ,
Rational). RUP , , 
, UML. 
Rational 
, UML. UML
. RUP
; . 52.

46

2.



. 
, , 
, 
.
, 
.
,
. 
, , 
, , 
. , 
.

. ,
: ,
, . 
,
,
, , .

. .

:
, , . 
, 
. 
, , .
, ,
. ,
.

 ,
. 
, .
, , 
. , ,
. 

.

.

47

, 
, ,
.
.
,
, 
, ,
. 
, , ,
.
,
, 
. ,
; , 

. ,
, .
: , 
, .
,
,
.
.  [31] 
(staged delivery), 

, ,
. 
,
.

, 
, 
.
,
,  
.
. 
, ,
, , , 
. 
, , 
, , .

. , 

48

2.

, 
.
 
, , ,
, , 
UML, 
. , ,
.
: 
, ,
. :

, 

, 
, ,
, 
. ,
.
, ,
,
.

(time boxing). , 
. , 
, ,

, . 
, ,
, .
, 
. 
, 

.

.

. 
,
. 
, , 
.

49


, 
. 
, .
(automated regression
tests) ,
. xUnit

(unit tests). 
JUnit http://junit.org, 
(http://www.xprogramming.com/software.htm). 

, .
(refactoring)
[20].
, 
.
(http://www.refactoring.com).
(continuous integration)
, 
, [18].

, ,
. 
, , 
. 

, 
.

Extreme Programming [2],
( ) , ,
XP (eXtreme Programming)  .


, ,

. ,
.

, ,
. , ,
. 
(predictive planning)

50

2.

. ,
, , 
.
.
.
, , .
,
.
,
.
. 

. 
(requirements
churn): 
. . 
, 
, 
, 
.
.

. 
, .
,
, 
, 
. , 
, 
, , 
.
(adaptive planning) , 
.
, 
,
.
, 

; , .

, . 
, , 
, 
.
, . ,

51

;
, 
, .

.
, ,
. 
. 
, 
. , 
,
, 
.

.
, ,
. 
, 
.
, , 
, . 
.
1. ,
,
.
2. , 
, .

. 
. 
,
, .



. (agile) ,
, 
,
(Manifesto of Agile Software Development)
(http://agileManifesto.org). XP
(Extreme Programming ), Scrum
(), FDD (Feature Driven Development , 
), Crystal () DSDM (Dynamic Systems
Development Method ).

52

2.


.
. , 

.
, , 
.
,
, 
. ,
UML
. UML 
.
.

.
, 
.
(lightweight).
,
,
.

Rational
, Rational
(Rational Unified Process, RUP), UML, 
. ,
.
RUP ,
, 
. RUP 
(development case) , 
.
, ,
. 
,
RUP, , RUP 
. 
,
.
RUP 
. RUP,
, , 
, RUP.

53

RUP .
1. (inception).
. , 
.
2. (elaboration). 

, 
. 
,
. , 
.
3. (construction) 
, 
.
4. (transition) , 
.
,
.
,
. 
, 
.  , 
, ,
, .
RUP (Unified
Process, UP). , 
RUP,
Rational Software.
RUP Rational, UP,
RUP UP . ,
.


. ,
,
: , 
, , , 
, . 
, ,
.
, , 
. , 
,

54

2.

. ,
.
, , 
. 
. , 
. 
, , . 
. ,
, 
. , , ,
, ,  .

UML ,  .
, : .
, 
, ,
.
,
,
. ,

.
. , 
, , 
, 
. , 
; , .

.

. ,
. 
.

.

. 
, , ,
, 
. , 
; ,
, , ,
.

55

90 .
,
. 
.
,
, [21],
23 . 
, ,
; , 
, 
.
, .
. ,
.
, , , 
, , .
,
. 
, , 

. .
, ,
. , 
, ?
.
,
. [21], [36], [37],
[13], [35] , , [16] [19]. ,
: http://www.hill'
side.net/patterns.
, ,
, . 
,
.

(iteration retrospective), ,
, . 
, .
:
1. : , , 
.
2. : , .
3. : .

56

2.

, 
.
, ;
, . ,
, , 
.

(project retro
spective), ; 
http://www.retrospectives.com/ [26].
, 
.

UML

. ,
, ,
 , . 

. , 70 80
, .
, ,
, , .
, 
.
UML 
CASE.


,
. 
UML:
, ,
.
, 

.
, 
,
.
,
.

UML

57

, ,

, .

, , 
. 
, UML .

, . 
, .
, .
UML, 
. 
UML , , 
. 
, ;
.

.
.
:

.
.

. 

, CRC
,
.

, 
.

, 
.


. ,
,
.

()
. , 
 , 
. UML 
.

58

2.

UML
, .
,
. 
. ,
, , 
.


, . , 
, 
.
UML 
.
.

,
,
.
,
. 
, , ,
, .
. ,
,
. , ,
, ,
.
,
,
. , 
.
UML , , 
.

. , 
, 
. , 
, .


UML. ,
UML . 

UML

59

,
. [14]:

. 
, .
.
,
, , JavaDoc.
, 
. 
, 
.
, ,
, UML, 
. , 
, , ,
, .

. 
,
. (. 8), 
,
.
.
, 
,
.
.

,
. : ; , 
.

, 
( 10). 
, , , .
, 
.
, ( 11),
, .
, 
(. 54).

, . ,

60

2.


.


UML 
.

,
. 
.

. 
; 

. ,
, 
.


.
:
, .
,  , , 
.
,

. ,
(,
, ,
).
. , 
 
.
, , 
(Manifesto
for Agile Software Development) .

(Extreme Programming),
.

61



,
.
[31].

.
, 
, [9] [22].
UML [1].

XP (Extreme Programming ), 
 http://xprogramming.com http://
www.extremeprogramming.org. XP ,
.
[2].
[3] XP, 
.
XP,
, .
Rational Unified Process
[28] .

3
:
 :
UML?, ,
. UML, 
, . 

.
, 
.
: ( ) ( 5).

, .
,
, 
. UML (feature) 
, , .
. 3.1 , ,
.
:
( ), . . 3.1 
: .

. 
.
, ,
.
, 
: .
,
.

63

Order

dateReceived: Date[0..1]
isPrepaid: Boolean[1]
number: String [1]
price: Money

Customer
1

name [1]
address [0..1]
getCreditRating(): String

dispatch
close

{ Order.customer.getCreditRating
"poor", Order.isPrepaid
true}

lineItems

{ordered}

Order Line

Corporate Customer

Personal Customer

contactName
creditRating
creditLimit

creditCardNumber

billForMonth(Integer)
remind()

quantity: Integer
price: Money

{getCreditRating() == "poor"}

*
salesRep

0..1

Employee

Product

. 3.1.


. :
: = { }

:
 : String [1] = " " {readOnly}

.
, (+)
(public) () (private). 
. 110.

64

3. :

, 
.
.

. 65.


, .

{ }
. {readOnly},
. , , ,
.
.

. 
, , 
. . 3.2 3.3 , 
.
Order
+ dateReceived: Date [0..1]
+ isPrepaid: Boolean [1]
+ lineItems: OrderLine [*] {ordered}

. 3.2.

Date

0..1

Order

+ isPrepaid

+ dateReceived

Boolean

1
1

lineItems
{ordered}

OrderLine
. 3.3.

, 
. (
) .

65

, 
. ,
. , 
.
, :
?. , 
, 
, , (. 101),
, .

, 
.

,
. 
:
1 ( .)
0..1 ( , 
.)
* ( , 
. .)

, 2..4 .
, 
* ( 
). ,
; 1 1..1. 
, * 0..*.
, 
.
Optional () .
Mandatory () ,
1.
Singlevalued () 
1.
Multivalued () ,
1; *.
, 
.
,
, 

66

3. :

. ,
{ordered}.
, {nonunique}. (
, {un
ordered} {unique}.) unordered, non
unique, , {bag}.
UML 1 , 2,4 ( 2
4, , ).
, UML 2
.
[1]. 
, , 
, [1], 
. 
,
.


UML, 
. 
. ,
Order Line ( ), . 3.1,
Java :
public class OrderLine...
private int quantity;
private Money price;
private Order order;
private Product product

, C#, , 
:
public class OrderLine ...
public int Quantity;
public Money Price;
public Order Order;
public Product Product;

, (pub
lic) , ,
(private) , .

( ). 
( ) ( 
). , ,
.

67

, 
. , 
, 
, . Order Line
:
public class OrderLine...
private int quantity;
private Product product;
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public Money getPrice() {
return product.getPrice().multiply(quantity);
}

.
Order Line ,
. , ,
. 
.
,
. Order ()
Order Line.
(ordered), (
, List Java IList .NET). ,
, , ,
, 
.
, UML
, 
.
,
( Java):
class Order {
private Set lineItems = new HashSet();
public Set getLineItems() {
return Collections.unmodifiableSet(lineItems);
}
public void addLineItem (OrderItem arg) {
lineItems.add (arg);
}
public void removeLineItem (OrderItem arg) {
lineItems.remove(arg);
}

68

3. :


; (add)
(remove). Line
Items ( ),
; 
. , 
. 
. ,
,
.
,

. 
.
, ,
. 

,
.
, ,
, .
, UML 
, . 
, ,
.
,
, , 
.
, ,

.


. 

, , . 3.4.
, 
. Car ()

Person

owner
0..1

. 3.4.

Car

69

owner:Person[1], Person () cars:Car[*].


( ,
cars, , .)
, 
, , 
. , 
MG Midget, ,
, Midget,
.

, ,
(. 3.5), 
. ,
, 
. 
, 
.

. ,
. ,
has () is related to ( ).
. 3.4
. . 3.5 ; 
UML 
, .

.
Owns

Person
0..1

Car

. 3.5. (own )


, 
. C# 
:
class Car...
public Person Owner {
get {return__owner;}
set {
if (_owner != null) __owner.friendCars().Remove(this);
__owner = value;
if (_owner != null)__owner.friendCars().Add(this);

70

3. :
}
}
private Person _owner;
...
class Person ...
public IList Cars {
get {return ArrayList.ReadOnly(_cars);}
}
public void AddCar(Car arg) {
arg.Owner = this;
}
private IList _cars = new ArrayList();
internal IList friendCars() {
// Car.Owner
return _cars;
}
....

, ( 
) . 
(Person)
.
,
, 
. friend ()
C++, 
. , 
, ,

.
, 
 .

(operations) , 
. 
. 
, ,
.
UML 
:
( ) : { }

, (+)
(public) () (private); 
. 110.

71

, .

,
.

,
. :
: =

, , .

, (in), 
(out) (inout). 
, in.

, :
+ balanceOn (date: Date) : Money


.
, ,
, CRC (. 89).
, , 
, , . UML
,
, ; 
, . 
{query} (). 
, , ,
.
,
, [33]. 
, . ,
, , 
, .
, 

. , 
, ,
, , . [33] 
.
, 
, .
, ,
(getting methods)

72

3. :

(setting methods). 
( ). 
(
). , 

. 
.
.
, 
, . 
, .
,
,
.

, .

(generalization) 
.
, .
Customer (, ),
Personal Customer ( ) Corpo
rate Customer ( ) .

. 
, 
, 
. ,

. : ,
(, , ),
.

:
. 

.

.
,
, .
, ,
, .

73


, ,
. ( 
Liskov Substitution Principle (LSP) (
) [30]).
,
, 
. :
Java 
Vector (),  
. ,
Vector, , 
.

. 
, , ,
. , 
, , 
. 
.
, 
.
(. 96)
[21].


.

, (. 3.6). 
.

Car

. 3.6.


.

. 
,
: .

74

3. :

, (de
pendency), ()
(). 
: 
;
;
. , 
, , .

.  
, , 
.
,  .
UML .
, ,
.
. 3.7 , 
. Benefits Window ( )
, ,
Employee (). Employee
, ,
. , Employee
, , , Benefits Window
.

Employee
Data Gateway

Benefits
Window

Employee

Benefits
Data Gateway

. 3.7.

,
.
, ,
Benefits Window, Employee
. ,
, 
, , ,
.

75

: 
Data Gateway ( ) Benefits Window.
, , ,
Employee. Employee,
, .
UML , 
. ,
, , ,
. ,
(. 3.1).
3.1.

call ()

create ()

derive ()

instantiate
( )

. (
, ,
;
)

permit ()

realize ()


, (. 96)

refine ()


; ,
, 

substitute ()

(. 72)

trace ()

, ,


use ()

. 

. , ,
, , 
, . ,
, , 

, . 3.7.

76

3. :

UML .
Order Customer , Order Customer.
, .
,
. 
, ,
.
.
,
, .
;
, .
,
, . 
,
(. 114).

, , 
. 
parameter (), local () global
().
UML 1, ,
. UML 2.
, , 
. 

UML.



. . 3.1 , 
(Order)
(Customer). , Line
Item ( ) :
40 , 40 40 , 120 
. , 
, .
,
, ,
.
 ,
.

77

UML
. : 
({}).
, 
UML (Object Constraint Language, OCL) [43],
. 

.
 OCL .
, 
, .
, ,
: { :
}.


UML, 
.
, 
5.
, , ,
, 
. .

.
, : , , 
, . 
, 5, 
.

,
. 
,
.

,
.
,
,
.

, , 
, 
. , 
, , 
 .
, , .

78

3. :


(Design by Contract) 
, Eiffel.
, [33]. 

Eiffel, 
.

. (assertion) ,

. 

.
, .

: , .
. 
,
. ,
,
input = result * result, result
, input . 
, ,
, . ,
.
,
. 

input >= 0. , 

.
,
,

. : 
.
, 
.

( , 
), (
).
, ,
, , 

79

.
. ,
, , 
.
, 
.
, ,

.
.
, Account () ,
, balance == sum(entries.amount()). 
. 
,
.
,
,
.
, 
.

. , 
, 
.
. 
. 
, . ,
, .
,
. 

,
. 
, , , 
.


1 UML
. 
.
[30].

4

(interaction diagrams) 
. UML
,
.
.
,
(use case).
, .
, ,
. (Order) 
(Line Items)
,
(Order Line). , 
, 
.
. 4.1 , 
. 
,
(lifeline),
; .

, . ,
getQuantity
getProduct. , 
getDiscountInfo 
.
.
getQuantity, getProduct, getPricingDetails calculateBasePrice
,
calculateDiscounts . 

81

an Order
calculatePrice

an Order Line

aCustomer

getQuantity
getProduct

aProduct

aProduct

getPricingDetails

calculateBasePrice

calculateDiscounts
getDiscountInfo

. 4.1.

, 
, .

, UML 1.
UML 2 ,
. (partici
pants), UML. UML
1 , 
, UML 2 , 
.
,
anOrder. . 
: : , , ,
, . (
. 4.4.)
,
. 
.
UML , 

82

4.

. 
, 
.

. ,
getProduct aProduct, , 
, , aProduct, 
getPricingDetails. ,

. ,
,
; .
, ,
.
, ,
. 
(found message).
. 4.2.
,
. 
(Price). 
(Product); , 
.
(Customer). 

,
.
an Order

an Order Line

aProduct

aCustomer

calculatePrice
calculatePrice

getPrice(quantity: number)

getDiscountedValue (an Order)


getBaseValue

discountedValue
. 4.2.

83
, , 

. 
. ,
, 

, .
, ,
. . 4.1 
(centralized control),
, .
. 4.2 (distributed control),
,
.
.
,  
, 
. , 
; ,
.
, , 
. 
.
, , . 

 .
, 
,
.
, 
(Product)
.
, 
, 
, 
. , 
; 
(paradigm shift) .
. , 

 . 
, ,
. ,
, .

84

4.



(. 4.3).
, 
. 
, ,
new . 
, ,
.
(X). 
, X, , 
; X , 
.
,
, X ,
.
, , .

a Handler

new

a Query
Command
new

a Database
Statement

. 4.3.

85

,
,
.
, 
.
. 

, .
, .
, (inter
action frames),
. . 4.4 ,
.
foreach (lineitem)
if (product.value > $10K)
careful.dispatch
else
regular.dispatch
end if

careful :
Distributor

:Order

regular :
Distributor

:Messenger

dispatch
loop

[ ]
alt

[ > $10000]
dispatch

[else]
dispatch

opt

[needsConfirmation]

. 4.4.

86

4.
end for
if (needsConfirmation) messenger.confirm
end procedure


, .
, . ( . 4.1
.)
loop
, . 
alt
. ,
. opt.
4.1.

alt

(alternative); 
, (. 4.4)

opt

(optional) ; ,
. alt (. 4.4)

par

(parallel); 

loop

(loop); , 
(. 4.4)

region

(critical region);
,

neg

(negative) ; 

ref

(reference); ,
. ,
, . 

sd

(sequence diagram);
,

UML 2. , 
UML 2, ; ,

. . 4.5
.
UML 1 .
(iteration marker) *,
.
. (guard) 

87

, ,
, .
UML 2, 
.

, . 
, , 
, . 4.5. 
,

.

, 
(pseudomessage)
. . 4.5
; 
, ,
. 
.
, .
careful :
Distributor

an Order
dispatch

regular :
Distributor

:Messenger

* [
]

[ > $10000] ( UML 1.4 )


dispatch

[else]

dispatch


( UML 1.3 )

[needsConfirmation]

. 4.5.

88

4.

, 
dispatch (), 
,
. , 
. 4.5, 
.
UML
; 
.

,
UML.
, 
, 
,  ,
, . , 
, 
, .


, , 
. 
UML 2.
,
.
(synchro
nous message), ,
, .
(asynchronous message),
.

, .

, .
; 
. , ,
UML 1.4, ,
,
. 4.5.
, .

, . 
,

89

, , 
.

, 

. 
, 
.

, ( 10).

, ( 11).

, CRC, 
. 
CRC ,

, .

, , 
, .

CRC
, 
, ,
, 
, . CRC (ClassResponsibilityCol
laboration, ),
(Ward Cunningham) 80 ,

(. 4.6). UML,

.
CRC 
.
, ,
, ,
.
, ;
, ,
, .

90

4.

Order

Order Line

Customer

. 4.6. CRC'

CRC 
. (responsibility)
, : ,
, , ,
 , .
, 
.
.
C ( CRC) (collaboration):
,
. 
, .
CRC ,

.
, ,
, ,
. , 

. CRC
, .
.

.
, 

. 
, ,
, .

91

, 

. . 
. ,

, .
, 

. , , 
, .
CRC , , 
. CRC
, (Kent Beck) [4]. 
CRC [44].

5
:

4
. 
, 90%
.

. 
, 
. 
, .
, 
. : 
.


, ,
.
, , 
. UML
, .
, UML,
,
UML, , ,
.
. (interface) UML
(. 96) ,
. Java, COM (Component
Object Module) CORBA. ,
inter

93

face. , 
().
, 
.
, {abstract}, 
. , 
, . , 
, UML.
.
,
: interface I,
{abstract} {A}. , 
, .
,
.
UML 1 . UML
2 , ,
, , . 
 UML 1
, .
. (profile) 
UML 
, .
.
,
. ,
, ,
, , 
, .

(. 90)
. ,
(. 5.1).
, 
, .


UML ,
, , .
C . 
(. 5.2).

94

5. :

View
Model

--

--

Input Controller
--

. 5.1.

Order

getNumber
getNextNewNumber

. 5.2.


UML 
.
: (aggregation)
. , 
. ,

.
UML 
.
,
. 
, .
UML (. 5.3) 
. (Jim Rumbaugh): 
[40].
UML
(composition). . 5.4 Point ()
, 
, .

95

Club

Person

. 5.3.

Polygon

{ordered}
3..*

Point

Circle

. 5.4.

,
, 
.
,
.
, 5.4 . 
, , 0..1. 
1, 
, .

. , 
(Polygon), (Points),
.
, 
,  (. 100) ,

.
; 
. ,
, . 
.


(derived properties) 
. (. 5.5),
: , 
. , 
, .

. 

. , . 5.5,

96

5. :

Date Range

start: Date
end: Date
/length: Integer

{length = start - end}

. 5.5.

, (start) (end) ,
(length) .
, , 
DateRange ( ).
. 
,
, , .
, 
, ,
. 
.

. /.


(abstract class) , 
. .

. (abstract operation) ;
,
.

UML 
. , 
.
, : {abstract}.
, , 
. 
C# Java 
. interface.
: 
. ,
. Java .NET ,
. C++ 
, .

97

, 
. , .
. 5.6 
, Java.
Order (), (Line Items).
, Order
List (). , equals, add get.
Order 
ArrayList, , 
, 
List.
ArrayList AbstractList. AbstractList
, 
List. , get . ArrayList
get, 
AbstractList. add,
equals.
interface
Collection

equals
add

Abstract List

interface
List

Order
Line Items [*]

equals
get
add

get

(
)

(
)

ArrayList
get
add

. 5.6. Java

98

5. :

Order 
ArrayList? 
,
.

. , 
, , 
List.
, ,
.
. 
,
, , :
private List lineItems = new ArrayList();

, Order
ArrayList. ,
. lineItems 
List, Order Array
List.
.
, 
.
. 5.6 
. . 5.7 . ,
ArrayList List Collection, , 
. , Order 
List, .
.
UML , 
UML 2. ( , 
.) , 
, , . 5.8, 
.
.
,
. , 
Order

List
ArrayList

Line Items [*]


Collection
. 5.7. '

99

Order

List
ArrayList

Line Items [*]

Collection
. 5.8.

,
, . .
, 
, . 
,
. 
, ,
. 5.9. , , 
Salesman, Bonus Calculator
, Pay Period Salesman
Employee. ( 
.)

a scenario

march : Pay
Period

Bruce: Salesman

a Bonus
Calculator

addToPayList (Bruce)
calculatePayroll
calculate Pay
!

employee

. 5.9.

100

5. :

ReadOnly Frozen
. 64 {readOnly} ( ).
,
, . , 
{frozen} () UML 1. 
frozen,
; 
(immutable). UML 2, frozen
, .
, frozen 
,
frozen. ( , 
frozen .)

 
, 
(identity). ,
, . ,
,
.
 (reference objects) , Customer
(). ,

. , 
Customer, 
. , 
Customer, 
. , , Customer,
.
Customer
, 
, .
; , , , 
, 
. , 
.
 (value objects) , Date ().
, 
. ,
, 1
2004 . .
.

101

, ,
, 
. , 
, 
, ( 
). , 1 2004
, , 
.
 . ,
 1
2004 2 2004 . 
2 2004
. 
: , 

. (aliasing).
 
.  
. 
,
.
UML , 
. ,
,
.  
, . 
Java , ,
. ,
 
. ;
, value struct.


UML
,
(associative arrays), (maps), (hashes)
(dictionaries). 5.10 
Order () Order Line ( ),
. ,
(Product)
.

:

102

5. :

0..1
Order

Order Line
amount:Number

Product
line item

. 5.10.
class Order ...
public OrderLine getLineItem(Product aProduct);
public void addLineItem(Number amount, Product forProduct);

,
, 
, , .

. . 5.10
(Line Items), 
. ,
0..1 . , 1,
,
. * , 
, 
.

, 

.



( []). 
. 
,
.
.
1. .
2.  .
3. .
4.  .
5. .
. 
;
 

103

. .
, . 
: .

. .
, 
? ,
(Shep) 
 (Border Collie), 

(Dog). , .
, , 
, .
, 
. 

.
: 

.
UML .
,
instantiate.



.
, .
UML .
(single classification)
,
. (multiple classifica
tion) , 
.

. 
, .

, .
Person (), 
Male () Female (), Doctor (
) Nurse (), Patient ()
(. 5.11).

104

5. :

,

.
,
, , 
. UML 2 
.

, UML 1 
. 
.
: 

.
, 
, . 5.11.
.

: (Female, Patient, Nurse); (Male, Physiothera
pist ()); (Female, Patient) (Female, Doctor, Surgeon (
)). (Patient, Doctor, Nurse) , 
role ().
: ?
, , 
. , 
, .

Surgeon

Doctor
Family
Doctor

Female
role
Person

Nurse

sex
Male

patient
Physiotherapist
Patient

. 5.11.

105

(dynamic classification) 
,
(static classification) .
, 
.

? , 
. 
.
UML 
, .


 (association classes) 
, ,
. 5.12. , Person (
) (Meeting).
 ,
; ,
attentiveness ().

Person

2..*

Meeting

*
#
Attendance
attentiveness

. 5.12. '

. 5.13 
: Attendance ().
, .
Attendance
Person

attentiveness

2..*

Meeting

. 5.13. '

106

5. :

 

?  
, 

. , .
, . 5.14.
. 
(Company), (Role)
(Contract), (Person), 
(Skill);
, , .
UML . 

. . 5.14
.
, Role , 
. 5.13.

Company

Contract

*
Role
description

Person

Skill

Competency
level

. 5.14. ' ( Role, ,


')

 . :
 , ,
, , 
. , 
. 5.12, Per
son:

107

7
class Person
List getAttendances()
List getMeetings()

, Person 
; ,
(Attendance). ,
, Person (
) Meeting ()
Attendance ().
, 
(., , . 5.15). ,
 
,
.

Person

Employment

period : dateRange

Company

. 5.15.

,
temporal () (. 5.16). 
,
.
. , 
:
class Person ...
Company getEmployer();
//
Company getEmployer(Date);
//
void changeEmployer(Company newEmployer,Date changeDate);
void leaveEmployer (Date changeDate);

temporal UML, 
. , 
. , 
,
UML. 
http://martinfowler.com/ap2/timeNarrative.html.

Person

employer
temporal

Company

0..1
. 5.16. temporal

108

5. :

( )
, C++, 
(parameterized class) (template).
( Java C# 
.)

.
,
Set ().
class Set <T> {
void insert (T newElement);
void remove (T anElement);


:
Set <Employee> employeeSet;

 UML ,
. 5.17. T
. (
.)
T
Set

insert(T)
remove(T)

. 5.17. '

, Set<Employee>, 
(derivation). 
.
C++ (. 5.18). 
<parametername::parameter
value>. , 
. (. 5.19)
.

Set <T::Employee>

. 5.18. ( 1)

109

T
Set

insert(T)
remove(T)

bind
<T::Employee>

EmployeeSet

. 5.19. ( 2)

bind ()
. , EmployeeSet (
) Set. 
EmployeeSet Set.
, 
.

. 
;
, .
, .

(. 5.20) 
, 
.
enumeration.
enumeration
Color
red
white
blue
. 5.20.

110

5. :


(active class) ,
. 

. ,
, 
.
. 5.21, UML 1 UML 2 
. UML 2 
; UML 1
.
Command
Processor

(UML 1)

Command
Processor

(UML 2)

. 5.21.

(visibility) , 
. ,
(public) (private) .
, 
.
. 
, public (), private () pro'
tected (), 
. , , 
, 
.
UML , 
. , UML
.
,
. UML 
: + (public
),  (private ), ~ (package ) # (protec
ted ).
UML, 

.

111


, . UML
 ,
, 
.

; , 
.
, , + , ,
, .

UML
. , 
, . 5.22.
calculatePrice
fill
Order

Order Item
1

getDiscountedValue

calculatePrice
itemsWaiting

getPrice (quantity)
getLeadTime

Customer

1
Product

getSpecialPrice
. 5.22.

. 
, . 

, 
, ,
.
, 
, , ,
.

6

(object diagram)
 . ,
, 
.

. ( . 6.1
, . 6.2 .)
,
.
, , . 6.2,
, . 
: : . 
, John, :Person aPerson 
. , 
. , 
. 6.2.
, 
, . ,

. 
Party
location

0..1
Person

Organization

. 6.1. , Party
()

113

engineering : Organization
location = "Boston"

tools : Organization
location = "Chicago"

apps : Organization
location = "Saba"

Don : Person
location = "Champaign"

John : Person
location = "Champaign"

. 6.2. Party

(instance specifications) 
.
, 
(. 152) .



. 
, 
. 
.

 
Books.Ru 
ISBN 593286060X,
UML. , 3  Books.Ru
 . 
, 
. 
, 
 (piracy@symbol.ru), .

7


. ,
, 
.
(package) ,
UML
.
, ,
, 
UML.
UML .
, 
,
,
, .
, .
UML
, Java
C++ .NET.
(namespace), 
,
. Date, Date
System,
. ,
(fully qualified name), , 
, . UML 
, 
System::Date MartinFowler::Util::Date.

(. 7.1).

115

util

util

Date
util

Date

java
util

java::util

Date
Date

java::util::Date

. 7.1.

. 
, .

, .
, ,
.
, Date ( java.util),
. 
, Rational Rose, 
.
UML (public) 
(private).
; 
. 

;
, 
UML.
,
,
. , 
private (),

116

7.

, 
.
, Facades () [21], 
.
? 
,
. 
: (Common Closure Principle)
(Common Reuse Principle) [30]. 
, 
. 
,
. , 
, , 
.


(package diagram) 
. . 74.

,

. , 
.
UML ,
. 
,

.
, 
.

, .
(clear flow)
, , 
. . 7.2 
,
.
, 
. 
, data mapper (
) . 7.2 
. 

117

(domain) (database) 
Mapper () [19].
, 
(Acyclic Dependency Principle 
, [30]). , ,
, , 
.
, 
, 
, (Stable Dependencies Princi
ple , [30]). . 7.2 
asset domain ( )
, leasing data mapper (
). , 

(Stable Abstractions Principle , [30]).
(. 75).
,
. 7.2. 
,
(leasing domain). 
(leasing presentation). ( , 

leasing
presentation

asset
presentation

UI framework

leasing domain

asset domain

leasing data
mapper

asset data
mapper

database

. 7.2.

118

7.

.) 
, 
, . 
,
global ().
UML , 
,
. 

. , ,
.


. 7.2, ,
. : 
(presentation), (domain),
(data mapper) (database).
: (leasing) (asset).
, 
, . 7.3.
. 

presentation

domain

UI framework

data mapper

database
. 7.3. . 7.2

leasing

asset

119

, 
. (, 
.)

. , 7.3, 
UML, 
.


, ,
,
. 7.4. 
, (Database Gateway) ,
.
, (Database Gateway) 
, 
.

Application

Oracle Gateway

Database
Gateway

SQL Server
Gateway

Test Stub
Gateway

. 7.4. ,


. , , 
(
. 97).
,
(UI) (controls) 
. ,
, (heaters) (lights).
UI , 
, . 
, ,

120

7.

, 
, . 7.5.
Separated Interface ( ) [19].
Control
interface
OnOff

Button

Check Box

turnOn
turnOff
isOn
isOff

Furnace::Heater

Lighting::Light

. 7.5.


,

. 
. 

. 
.

(composite structure) (. 155).


, ,
[30].
, 
.

8


, ,
.
, .
. 8.1 . 
, 
. (node) , 
. . (device)
: , 
. (execution environment)
, 
, .
(artifacts), 
; .
(
.exe, , DLL, JAR, )
, , HTML
. . , 
.

.
, 
artifact. 
, 
, , 
, , , .

. ,

. . 8.1  

122

8.

BrowserClient
browser

Rich Client
{OS = Windows}
herculesClient.exe

http/Internet

#
Application Server
JoveGL.exe
{vendor = romanSoft}
{component = General Ledger}

http/LAN

Web server
{OS = Solaris}
{web server = apache}
{number deployed = 3}

EJB Container
Java RMI/
LAN

herculesBase.ear
herculesAR.ear
herculesAP.ear

herculesWeb.war
JDBC

Oracle DBMS

. 8.1.

number deployed ( ), 
.
. 
,  .

. 
.


,
.
, 
.


.

.
,
. (scenario)
, 
. , 
, 
(Buy a Product), .

. 
. 

.
,
. 
, 
. ,

, .
, . ,
: . 
, .
: 
,
.
.
(actor) ,
. , 
, .

124

9.

. 
; , 
. 
, .
, 
, .
. 
, 
.
; ,
(role) . , 
,
.
UML. 
, UML . UML
, .
, UML, , 
, .
, 
.



; . . 9.1 
.
(main success sce
nario). ,

. 
(extension), 
.
, 3a, , 6a.
,
. , 
, ,
.
, 
. .

.
, . 
, . ,
. , 
.

125

:
1. .
2. .
3. ,
(, ).
4. 
.
5. .
6. .
7. .
8. 
.

:
3. .
.1: ,
.
.2: 
, 6 .
6a. .
.1:
.
. 9.1.

,
, 
(main success scenario, MSS), ,
. , 
, .
, ,
. 
, .

. :
? ?
,
.
, , , , 
, .
.
UML ,
(includes) .

126

9.

, , , 
, ,
. , . 9.1 
.

, ,
.

.
.

.

(precondition) , 
,
. , 
.

(guarantee)
. 
; 
.

(trigger) ,
.


. , .
, ,
. , ,
, ,
. ; 
, ,
.
, ,
. 
, 
.


, UML ,
,
(. 9.2). , 
. 
. 
.

127

Update
Accounts

Set
Limits

Trading
Manager

Analyze
Risk

include

Price
Deal

include

Accounting
System

Value
Deal

Capture
Deal

Trader

Salesperson

. 9.2.


, . 
, ,

. , 
:


UML include ()
, extend
(). . 

, 
. 
;
.


, , 
,
,
. 
. , 
, ,
(system use case) 

128

9.

,  (business use
case)  
.
[10] . 
.
(sea level)
.

. , ,
,
(fish level). , 
(kitelevel), , 
.

, 
. 
. 
, . 9.1.

( )

; (Ext
reme Programming)
. , 
.

,

. , 
, .
,
,
. 
, , 
 ,

, . 
, .



.
.

129


.
,
. ,  
.
, 
. UML 
, 
.
,
.
, . 
, , ,
.
,  .



[24].
,

. UML , 
,
.
.
[10] 
.
, 
, . 
 http://usecases.org. [11] 

; http://foruse.com.

10

(state machine diagrams) 
.
1960 , 

.  
,
.
, ,
 .
, 
.
, .
, 
, ,
. 
. ,
.
, 
, .
. 10.1 , 
. 
:
Wait ().
(initial pseudostate),
, , .
,
: Wait (), Lock () Open (). 
,
.
, .

131

Open

[ ] /

Wait

[ ] /

Lock

[ ] /
-


. 10.1.

(transition) 
. , :
 []/ (triggersignature [guard]/acti
vity). . , 
, .
, , , 
, .
.
. 
. 
Wait (. 10.1) 
Wait, , 
Lock.
.
, . 
, ,
.  ,
. , ,
,
.
, 
,
Lock (. 10.1) .
, 
Wait ,
.
(final state) , 
, .

132

10.

, , ,
,
, 
.
, 
, . ,
,  
, , 
, .
, 
, , 
.
; ,

.


, 
(internal activities),
,
.
. 10.2
, 
UI.
(selftransition) ,
.
, .
. 10.2 : 
. , 
; ,
. 
;
.
Typing
entry/
exit/
character/
help [verbose]/
help [quiet]/
. 10.2. ,

133


, , 
,  . 
, .
Searching () . 10.3
(activity state): 
do/; doactivity ( ).
, , 
(Display New Hardware).
(cancel), do
Update Hardware
Window ( ).
Update
Hardware
Window

search

Searching
do/ search for new hardware

cancel
Display New
Hardware
Window
. 10.3.

do, 
.
,
, do

, . 10.3.
; 
,
.
UML 1 action (),
activity () do.

, 
. 
(substates), (su
perstate), . 10.4.
cancel () 
Enter Connection Details (D ).

134

10.

Show Connections
new

save
cancel
Enter Connection Details

next
Enter Phone
Number

next
Choose Shared
or Solo

back

Enter Name
back

. 10.4.



, . . 10.5
, CD,
, .
CD/ / 
.
, 
.
.
On
time
Display Current
Time

Display Alarm
Time


Playing Radio

Playing CD

H
Radio

CD
on

off
Off

. 10.5.

alarm

135

. 10.5 (history pseudo


state). , , /CD 
, , 
. , , , 
, .



: switch, State 
. 
switch, . 10.6.
public void HandleEvent (PanelEvent anEvent) {
switch (CurrentState) {
case PanelState.Open :
switch (anEvent) {
case PanelEvent.SafeClosed :
CurrentState = PanelState.Wait;
break;
}
break;
case PanelState.Wait :
switch (anEvent) {
case PanelEvent.CandleRemoved :
if (isDoorOpen) {
RevealLock();
CurrentState = PanelState.Lock;
}
break;
}
break;
case PanelState.Lock :
switch (anEvent) {
case PanelEvent.KeyTurned :
if (isCandleIn) {
OpenSafe();
CurrentState = PanelState.Open;
} else {
ReleaseKillerRabbit();
CurrentState = PanelState.Final;
}
break;
}
break;
}
}
}
. 10.6. switch C#
, . 10.1

136

10.

,
. , ,
.
(State pattern) [21] 
.
. 
, 
. , . 10.1,
, . 10.7.
Secret Panel Controller

Secret Panel State


state 1
handleCandleRemoved
handleKeyTurned
handleSafeClosed

changeStateTo (SecretPanelState)
handleCandleRemoved
handleKeyTurned
handleSafeClosed

do nothing

state.handleCandleRemoved
Wait State
if (door open) {
revealLock()
changeStateTo (LockState)
}

handleCandleRemoved

Lock State
handleKeyTurned

Open State
handleSafeClosed

. 10.7. , . 10.1

,
, , .

, .
.
, . 10.1 . 10.1.
, 
, ,
.
,
, , 
, . 
,
. , 
, ,
, .

137

10.1. . 10.1

Wait

Lock

Candle removed
( )

Lock

Open

Key turned
Candle in
( ) ( )

Open safe
( )

Lock

Final

Key turned
Candle out
( ) ( )

Release killer rab


bit (
)

Open

Wait

Safe closed
( )

Door open
Reveal lock
( ) ( )

,
, .

,
.



.
, 
. 
. , (
4)
, ( 11)

.
. ,
. , 
,
. ; 
.
, 
.
,
. ,
, 
, . 
, UI 
, 
.

138

10.


UML [6],
[40] .

, ,
[15] , 
. [30]
.

11

,
,  .
, 
 ,
.

UML, ,
UML 2. UML 1 

. , 
, 
. UML 2 .
. 11.1 .
(initial node), 
Receive Order ( ). (fork), 

.
. 11.1 , Fill Order ( ), Send
Invoice ( ) 
. , , 
. ,
, (Delivery), (Receive Pay
ment); , , ,
. .
. 
, , ,
. .  :
,  .
, .
,
, . ,

140

11.

Receive
Order

Fill Order

Send Invoice

[priority order]

/
[else]

Overnight
Delivery

Regular
Delivery

Receive
Payment

Close
Order

. 11.1.


, .
, 
. 
, 
.
. 
, . 
(join) Close Order ( 
). 

141

, . 
, .
UML 1 
,
. UML 2
.
, 
(actions), (activities). , 
,
, .

(decisions) (merges). , UML 1
, 
. 
, . 
,
. [else]
, [else] ,
.
. 11.1 
. , (Over
night Delivery);
(Regular Delivery).
(merge) .
,
.

. UML 1 , 
. , 
, . UML 2 ,
; , 
, . 

,
; .


(subactivi
ties). , . 11.1, 
(. 11.2), 
(. 11.3).

.

142

11.

Deliver Order
Regular Delivery
[else]
Order

Order
[Rush Order]
Overnight
Delivery

. 11.2.

Receive
Order


Send Invoice
(Order::sendInvoice)

Fill Order

Deliver
Order

Receive
Payment

Close
Order

. 11.3. . 11.1
. 11.2

143

.
::.
, 
.

, , 
, . 
, ,
. 
,
.
; , 
, , .
(partitions), 
, ,
. . 11.4 
, , 
.
Fulfillment
()

Customer Service
Finance
( ) ( )
Receive
Order

Send
Invoice

Fill Order

Receive
Payment

Deliver
Order

Close
Order

. 11.4.

144

11.

. 11.4 .

(swim lanes), UML 1. UML 2 
,
. , 
,
.

. 11.1
,
. , .
(time signal) . 

.
. 11.5 , 
. , 
. ,
, ,
.

Pack Bags
Leave for Airport

Two hours
before flight
Taxi
Arrives


. 11.5.

, . 11.5,
(Two hours before flight), .
, , .
(Taxi Arrives) ,
(Pack Bags), , .
, . ,
, ,
. . 11.6 
, . ,

145


48
. 11.6.

: , 
, .
,
. ,
,
.

, 
UML, , , ,
(tokens), .
, 
,
. , 
. ,

, , 
.
,
.
.


UML 2 (flow)
(edge) . 
.
, ,
.

146

11.


(connectors), 
. :
,
.
, .
,
. ;
.
, 
. (pins) 
, , 
.
, . 11.7, . 
, , 
. .

. 11.7.


, , . 
,
(pins).
, 
.
, 

. , 
(transformation) (. 11.8) 
.

147


transformation
appointment.cancellationNotice

transformation
appointment.patient

. 11.8.

, : ,
,
.
.
, ,
. 
 , 
.
,
.
, UML 1 
,
.



, 
. , 
. (expan
sion region) ,
.
. 11.9 Choose Topics ( ) 
.
Write Article ( ).
Review Article ( )
, 
. 
, 
, Publish News
letter ( ).

148

11.

Choose Topics




concurrent
Write Article

Review Article

Publish
Newsletter

. 11.9.


.
, ; 
.
. 11.9 , 
concurrent. 
. 
.
,
, , . 11.10.
, 
. 
, UML 1.
Choose
Topics

Prepare
Article

Publish
Newsletter

. 11.10.


, 
, ,
. (flow final) 
.
. 11.11 . 11.9, 
. ,
. 

149

, .

, .
Choose Topics


concurrent

Write Article

Review Article

[]
[]

Publish
Newsletter

. 11.11.


,
. (,
, ,
.) , 
, ,
.
(join specification) ,
. ,
, , 
, . . 11.12, 
, (Select Drink) 
(Insert Coin), . 
,
. , , ,
,
.

150

11.

Select Drink

A
Dispense
Drink

Insert Coin

B
{joinSpec = A B
>= }


. 11.12.


, 
. UML,
. ,
,
.
, 
.
UML, 

.
. ,

, .


,

. 
.
UML 2 , .

UML .
, UML,
. , , 
, 
.
,
,
. , ,

151


,
.

UML . 

.
, 
. ,
.
, .



, UML 2 , 
, 
. ,  .

. (
) Petri Nets,
 http://www.daimi.au.dk/PetriNets/.

12

(communication diagrams) 
, 
.

, ,
, 
,
, , 
.
UML 1.x (col
laboration diagrams). , ,
, .
( (. 161); 
.)
. 12.1 
, . 4.2. 
,
.
,
, ,
. local (
) Order () Product () 
, para
meter () global (). 
UML 1, UML 2. , 
, .
. 12.1 ,
UML . UML 
, 
. 12.2.

153

1: calculatePrice

7: getDiscountInfo
5: calculateBasePrice ()
6: calculateDiscounts()

an Order

a Customer
4: getPricingDetails

2: getQuantity()
3: getProduct ()
local

an Order Line

a Product

. 12.1.

1: calculatePrice
1.5.1: getDiscountInfo
1.4: calculateBasePrice ()
1.5: calculateDiscounts()

an Order

a Customer
1.3: getPricingDetails

1.1: getQuantity()
1.2: getProduct ()

an Order Line

a Product

. 12.2.

, 
. . 4.2 
, getDiscountInfo calculateDiscount.
, . 12.1,
, getDiscountInfo
calculateDiscount calculatePrice. 
.
,
.

154

12.

, , 
, ,
1.1.1.2.1.1.
.
. 
. , A5 B2 
; 1a1 1b1 
, 1. , 
, 
, .

.
(. 86),
. 
, create
delete .

, ,
, ,
. 
: .
. , 
, , 
, , .
, 
,
, ,
. ,
, 
, 
CRC.

13

UML 2 
. 
.
. 13.1 TV Viewer () 
, (. 96).
:  
.
TV control UI

TV control API
TV Viewer

TV Viewer
display
tuning

picture stream


TV control UI
TV control API

tuning
display
picture stream

. 13.1. TV Viewer

. 13.2 , , 
.
: ,
.
, ,
.
.
. 13.2 , TV Viewer 
(Generator) (controls).

156

13.

TV control UI

TV Viewer

controls :
TVPresenter

display
:Generator [1]
TV control API

tuning

picture stream

. 13.2. (,
)

, ,
, . , 
, , , 
. ,
,
,  (. 98).
(. 13.3). 

display

TV control UI

windowing
tuning
tuner
TV Viewer
picture stream
API

TV control API
. 13.3.

157

, 
.


UML 2, 
. 

, , 
.
, 
; ,
.
UML 2,

; UML , 
.

14

 , 
. 
,
UML, , .
UML 1 (. 14.1). UML 2
, 
. compo
nent ().

Widget

Widget

UML 1

UML 2

. 14.1.


. 
, 
(. 98)
.
.
. 14.2 .
Till () 
Sales Server ( ) sales message
( ). ,
Message Queue ( ) ,
, ,
, .
, .

159

Till
Sales Server
sales
message
Transaction
Processor

Accounting
Driver

Message Queue

Accounting
System
. 14.2.

,
.
: Transaction Processor ( 
) , Accounting Driver (
) Accounting System ( ).
, 
. 
, :
.
.
.
,
, 
. , ,
, , 
. ,
. 
. : .
(Ralph Johnson),
http://www.c2.com/cgi/wiki?DoComponentsExist
, ,
.

, . 
[23]. ,

160

14.


,
, 
; DLL.
UML
, DLL. ;
(artifacts) (. 121).


, 


.

15

, 
UML 2. UML 
,

UML 1 .
, .
. (Auc
tion) (seller), (buyer), 
(lot)  (offer).
(. 15.1) , 
, (. 15.2).
Auction

buyer

1
seller

offer

1
1
lot

. 15.1.

162

15.

/seller

b1/ buyer

b2/ buyer

. 15.2.

. 15.1 . 
, ,
. , 
, (roles), 
, 
.
 ,
.
, 
.
:  /  : . , 
.
,
, . 15.3, 
. , 
, , ,
.
UML , 
,  .
(Erich Gamma) 
(. 15.4). 
, :.

163

Bid

Offer

(
)

*
buyer

1
seller

Party

House

*
lot

buyer, seller

Auction


. 15.3.

Composite: Component

Test

tests

run(TestResult)

Command
Pluggable Selector
Template Method

TestCase

TestSuite

name
run(TestResult)
run(TestResult)
runTest()
setUp()
tearDown()

Composite

Composite: Leaf
. 15.4. JUnit (junit.org)


UML 1, ,
. 
, 
. ,
 .

16


.
, 
,
,
.
.
. 16.1 ;
,
. 
.
, XML, , 
. 
.
;
, .

UML 2, , 
. 
, , , 
. 

, .

165

[ ]

sd

[ ]

sd

:Customer

:Customer

:XMLParser

:Database

load

new
parse
getName
getOrders
new

:Order
Summary

ref
Format Order Summary Report

. 16.1.

:Order
Summary

17


, . 
, , UML

. 
, , 
UML, .
UML, .

, :
, , , .
,
(Pump) (Hotplate) (coffee
pot). , , 

10 .
(waterEmpty), ,
15 .
. 17.1 17.2
. ,
. 17.1
, . 17.2 
, 
. ,
. 17.1, , , , 
. 17.2, ,
.
, 
{>10s}, . ,
, , 
.

167

Pump
Hotplate

waterEmpty
On

On

Off

Off
{<15m}
{>10s}

. 17.1. ,

Hotplate

Pump

waterEmpty
Off

On

Off

Off

Off

On
{<15m}
{>10s}

. 17.2. ,



. ,
.

A
UML
, UML
1.0.
UML , OMG .
UML .
UML
1.0 ,
. UML 
, , 
.

UML
UML
0.8, OOPSLA,
1995 . 
. . ( .
Rational). 1996 Rational
0.9 0.91,
. 
UML.
1997 Rational 

OMG 1.0 UML. Rational
1997
1.1. 1997 
OMG. 
OMG UML 
1.0. ,
UML: 1.0 OMG 1.1 Rational,
1.0 Rational. 
1.1.

UML

169

UML. 1.1
1998 , 1.3 1999, 1.4 2001 1.5 2002. 
1.x
UML, 1.3,
, .
UML 1 , UML
UML 2. RFP (Request for Proposals
) 2000, UML 2 
2003 .
UML . 
UML
(http://uml'forum.com). ,
(http://martinfowler.com).


UML ,
UML. .

.

,
, 
UML.
UML 1.0. 
. 1.1.
UML 1.2; 
UML 1.3 .
, UML 1.0, 
.

UML 1.3. , UML 1.4,
.
UML 2 (. . A.1).

UML, 1.0 1.1,
1.2 1.3. 1.x 2.0.
, , 
UML.
UML, .
, 
UML UML
. ,


170

. 
UML,
. ( ,
.)


. , .
A.1. UML.
UML.

UML

1

UML 1.01.3

2

UML 1.31.4

3

UML 2.0

UML 1.0 1.1



UML. 
, 

, . 
UML, 
,
, .
(implementation class)
. (type) 
; ,
.
CORBA,
. 
, .
, 
. 
, .

, 
.

, .
. ,

Java COM.
.

UML

171


, 
. ( , ,

.
, 
, .)


UML. , 
{complete} () ,

. UML 1.1
{complete}, ,
.
.
, . 
,
, 
. 
{mandatory} ().

UML 1.0 ,
(immutable) (frozen), 
, .
.


UML {frozen} () 
.
,
.
frozen,
, .


UML 1.0 ( ) 

(. ). , 
, 
. UML 1.1
, , 
. ( 

172

[16] ,
.) 
enoughStock :=check().

Role
UML 1.0 (role) 
(. ).
UML 1.1 
(association role).
(collaboration role), , 
. UML 1.1
, ,
.

UML 1.2 ( 1.1) 1.3 ( 1.5)

. UML 1.1 
: uses ()
extends (), 
. UML 1.3 :

includes () 
. ,
. 
, 
.
.
(ATM), Withdraw Money (
) Make Transfer ( ) 
Validate Customer ( ). 
uses.

(generalization) , 
. ,
(
) ,

. 
, . ( 
, 
.) ,
, 
.

extends () 
.

UML

173

. 
. 

. ,


.
, 
.

. 
uses , 1.3
includes, in
cludes uses. 
extends 1.1 
, extends 1.3,

1.3. , ex
tends 1.3 :
extends (generalization).

UML, 
. 

, .


1.2 UML 
. 
1.3 ,
UML.

(merge), 
(branch). ,
, 
,
.

( ), (
). 
. 
,
. , 
,
, 

174

. , 
, ( 
) .
,
.
. ,

.
.

*
. 
; , 
 . 

, .
 
, , 
. 

RTF.
UML ( 1.4)
.

UML 1.3 1.4


1.4 (pro
files), , 
. UML
. , 
, 
; UML 1.3 
.
UML (artifacts).
, , , Xerces
, Xerces.jar
, Xerces.
1.3 UML 
(package visibility). 
~.
, UML 1.4 
, 
. , .

UML

175

UML 1.4. 1.5


UML
UML 
. , 
, UML 2.

UML 1.x UML 2.0


UML 2 , .
,
UML. .
UML.
,
.

. 
, ; 
. UML 2 
. ,
: ,
.
. 
, 
, 
.
, 
UML. . ,
, , 
. , 
.

: ( 3)

.
, [2, 4], .
frozen () .
, 
UML 2. parameter (
) local () .

( 4)
,
,

176

, . 

, , . 

. 
;
(participants). , UML 1
, UML 2 .

: ( 5)
. 
, 
.

. , 
. 
. 
.

.

( 10)
UML 1 
. UML 2 ,
do
(doactivity).

( 11)
UML 1
. UML 2 , 
, 

.
, .
, , , 
, , , 
, .
, , UML 1 
,
, UML 2 , 
.
.

.


1. Scott Ambler, Agile Modeling, Wiley, 2002.
2. Kent Beck, Extreme Programming Explained: Embrace Change, Addi
sonWesley, 2000.
3. Kent Beck and Martin Fowler, Planning Extreme Programming, Addi
sonWesley, 2000.
4. Kent Beck and Ward Cunningham, A Laboratory for Teaching Object
Oriented Thinking, Proceedings of OOPSLA 89, 24 (10): 16. http://
c2.com/doc/oopsla89/paper.html
5. Grady Booch, Object'Oriented Analysis and Design with Applications,
Second Edition. AddisonWesley, 1994.
6. Grady Booch, Jim Rumbaugh, and Ivar Jacobson, UML User Guide,
AddisonWesley, 1999.
7. Peter Coad and Edward Yourdon, Object'Oriented Analysis, Yourdon
Press, 1991.
8. Peter Coad and Edward Yourdon, Object'Oriented Design, Yourdon
Press, 1991.
9. Alistair Cockburn, Agile Software Development, AddisonWesley,
2001.
10. Alistair Cockburn, Writing Effective Use Cases, AddisonWesley,
2001.
11. Larry Constantine and Lucy Lockwood, Software for Use, Addison
Wesley, 2000.
12. Steve Cook and John Daniels, Designing Object Systems: Object'Ori'
ented Modeling with Syntropy, PrenticeHall, 1994.
13. Deepak Alur, John Crupi, and Dan Malks, Core J2EE Patterns, Pren
ticeHall, 2001.
14. Ward Cunningham, EPISODES: A Pattern Language of Competitive
Development. In Pattern Languages of Program Design 2, Vlissides,
Coplien, and Kerth, AddisonWesley, 1996, pp. 371388.
15. Bruce Powel Douglass, Real'Time UML, AddisonWesley, 1999.

178

16. Martin Fowler, Analysis Patterns: Reusable Object Models, Addison


Wesley, 1997.
17. Martin Fowler, The New Methodology, http://martinfowler.com/ar'
ticles/newMethodology.html
18. Martin Fowler and Matthew Foemmel, Continuous Integration, http:/
/martinfowler.com/articles/continuousIntegration.html
19. Martin Fowler, Patterns of Enterprise Application Architecture, Addi
sonWesley, 2003.
20. Martin Fowler, Refactoring: Improving the Design of Existing Pro'
grams, AddisonWesley, 1999.1
21. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, De'
sign Patterns:Elements of Reusable Object'Oriented Software, Addi
sonWesley, 1995.
22. Jim Highsmith, Agile Software Development Ecosystems, Addison
Wesley, 2002.
23. Luke Hohmann, Beyond Software Architecture, AddisonWesley,
2003.
24. Ivar Jacobson, Magnus Christerson, Patrik Jonsson, and Gunnar
Overgaard, Object'Oriented Software Engineering: A Use Case Driven
Approach, AddisonWesley, 1992.
25. Ivar Jacobson, Maria Ericsson, and Agneta Jacobson, The Object Ad'
vantage: Business Process Reengineering with Object Technology, Ad
disonWesley, 1995.
26. Norm Kerth, Project Retrospectives, Dorset House, 2001
27. Anneke Kleppe, Jos Warmer, and Wim Bast, MDA Explained, Addi
sonWesley, 2003.
28. Philippe Kruchten, The Rational Unified Process: An Introduction,
AddisonWesley, 1999.
29. Craig Larman, Applying UML and Patterns, 2d ed., PrenticeHall,
2001.
30. Robert Cecil Martin, The Principles, Patterns, and Practices of Agile
Software Development, PrenticeHall, 2003.
31. Steve McConnell, Rapid Development: Taming Wild Software Sched'
ules, Microsoft Press, 1996.
32. Steve Mellor and Marc Balcer, Executable UML, AddisonWesley,
2002.
1

: . .
. : , 2002.

179

33. Bertrand Meyer, Object'Oriented Software Construction. Prentice


Hall, 2000.
34. James Martin and James J. Odell, Object'Oriented Methods: A Founda'
tion (UML Edition), Prentice Hall, 1998.
35. Michael Pont, Patterns for Time'Triggered Embedded Systems, Addi
sonWesley, 2001.
36. Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad,
and Michael Stal, Pattern'Oriented Software Architecture: A System of
Patterns, Wiley, 1996.
37. Douglas Schmidt, Michael Stal, Hans Rohnert, and Frank Buschmann,
Pattern'Oriented Software Archtecture Volume 2: Patterns for Concur'
rent and Networked Objects, Wiley, 2000.
38. James Rumbaugh, OMT Insights, SIGS Books, 1996.
39. James Rumbaugh, Michael Blaha, William Premerlani, Frederick Ed
dy, and William Lorenzen, Object'Oriented Modeling and Design,
PrenticeHall, 1991.
40. James Rumbaugh, Ivar Jacobson, and Grady Booch, The Unified Mod'
eling Language Reference Manual, AddisonWesley, 1999.
41. Sally Shlaer and Stephen J. Mellor, Object'Oriented Systems Analysis:
Modeling the World in Data, Yourdon Press, 1989.
42. Sally Shlaer and Stephen J. Mellor, Object Lifecycles: Modeling the
World in States. Yourdon Press, 1991.
43. Jos Warmer and Anneke Kleppe, The Object Constraint Language:
Precise Modeling with UML, AddisonWesley, 1998.
44. Rebecca WirfsBrock and Alan McKean, Object Design: Roles Respon'
sibilities and Collaborations. PrenticeHall, 2003.

PIM, ,
, 31
PSM, ,
), 31

CASE (

), 29
UML, 35
CORBA,
, 27
CRC (
), 89

do, 133
DSDM, 
, 51

Scrum, , 51
Smalltalk, , 32

RUP,
Rational
, 53

U
F
FDD, ,
, 51

M
MDA, ,
31
M,
UML, 34

O
OMG,
MDA,
, 31
UML, 35
UML, 27

P
Petri Nets,
, 151

UML
, 34, 35
, 27
, 43


, 30
, 41
UML
, 29
UML
, 33
, 33
UML , 33
, 28
, 28
UML
MDA,
, 31
UML , 30,
32
, 32
, 30


, 30
UML,
UML, 39
, 41
UML. , 
UML, 170
UP, , 52

X
XP,
, 61
, 51

,
, 96
, 110
, 56
, , 64
, 68

, 171
, 68
, 93

, 55
, , CRC, 91
, , UML, 34

, 47
,
, 132
, 38
, 166

, 126

, 68
, 139

UML, 38

CRC, 89

181
,
80
, 164
, 164

, 88
, 85
, 38
, 167
, 166
, 38
, 56
, 141
, 150
, ,
147
, 139
UML, 176
, Petri Nets, 151
, 143
, 151
, 144
, 38
, 96
, 94
, 110
, 110
, 57
, 74
, 113


, 103
, 105
, 92
, 77
, 72
, 100
, 100
, 93
UML, 176
, 76
, 79
, 62

, 93
(
), 108
, 38
, 38, 158
, 160

182
, 158
, 38
, 132
, 130
UML, 176
, 134
, 133
, 133
, 161
, 41
, 38
, 38
, 112, 113
, 38
, 38
, 57
, 120
, 114
, 120
, 38
CRC, 89
, 171
, 80
, 89
, 80
UML, 175
, 43

, 88
, 85
, 38
, 56
, 126
, 38
, 57
, 122
, 43
, 121
, 38
, 157
, 155
, 130
, 137
, 135
, 138
, UML, 175
, 30
, 58

UML, 172
, 116
, 110
, 72
, 110

, 78
, .

UML, 31
, 46

, 101

,
103
, 102
, 170
, 92
, 96
, 93
, 171

(CRC), 89
, 62
, 108
, 79
, , 170
, 171
/, 74
, ,
92
, (Cockburn, Alister),
, 129
, 38
, 154
, 94
UML, 171

, 163

, 145
, (Mellorn, Steve)
UML, 31


, , 36

, 170
,
(PSM), 31
, 71

, 98
, 98

, 147
, 62
, 104
,
UML
, 33
, 28
, 30
, 74
, 100

/, 171
, 76
, (Odell, Jim),
UML, 34

, 171
, 68
, 
, 27

, 147
UML, 175
, 110
UML
0.8 2.0, , 168
1.0 1.1, 170
1.2 1.3, 172
1.3 1.4, 174
1.4 1.5, 175
1.x 2.0, 175

, 96

, 118

183
, 116
,
114
, 114
, 134

Separated Interface,
, 120
, 162
, 136
, 131
, 136
, 109
,
, 50
, UML
, 33
, 33
, 32
, 73
, 114
, 145
Petri Nets, 151
, 148

, 128
UML, 172
, 129
, 128
, 128
, 128
, 128
,
117
, 117
,
117

, 49
, 57
, 114

, 45
DSDM,
, 51
FDD, ,
, 51
, 46
, 60
, 46
,
53, 55

184
, 61
, 51

Rational (RUP), 52

(XP), 51, 61
,
UML
, 29
, 33
, 28
, 30

, 135
, 101, 170

, 171
, 36

, , 143
, .

 (Rebecca Wirfs
Brock), UML, 34
, 141
, 138

, 121
, 60
Rational
(RUP)
, 53

(UML), 27
, 85
, 141
, 39

, 79

, 62
frozen, 100
readonly, 100
, , 68
,
, 171
, 101
, 62
, 128
/, 74
, 144
, 51
, 61
, 101
, 101

, 79
, 111
, 111
, 88
, 133
, 46
, 93
, 93
, 133

, 116

 , 98

, 46
,
. XP
, 61
, 51
, UML , 33


Eiffel, 78
Smalltalk, 32
UML , 30
MDA,
, 31
, 32

 
Books.Ru 
ISBN 593286060X,
UML. , 3  Books.Ru
 . 
, 
. 
, 
 (piracy@symbol.ru), .

Вам также может понравиться