1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
1
00:00:00,100 --> 00:00:02,160
There's two more structural diagrams that I want to
2
00:00:02,160 --> 00:00:04,670
mention before we move to the behavioral ones. The
3
00:00:04,670 --> 00:00:07,420
first one's the component diagram. A component diagram is
4
00:00:07,420 --> 00:00:09,690
a static view of components in a system and of
5
00:00:09,690 --> 00:00:13,010
their relationships. More precisely, a node in a component
6
00:00:13,010 --> 00:00:16,700
diagram represents a component where a component consists of one
7
00:00:16,700 --> 00:00:21,090
or more classes with a well-defined interface. Edges conversely
8
00:00:21,090 --> 00:00:25,290
indicate relationships between the components. You can read this relationship
9
00:00:25,290 --> 00:00:29,600
as component A uses services of component B. And notice that the
10
00:00:29,600 --> 00:00:32,990
component diagrams can be used to represent an architecture, which is
11
00:00:32,990 --> 00:00:36,110
a topic that we will cover extensively in the next mini-course.
12
00:00:36,110 --> 00:00:39,540
So let's illustrate this with an example. So, what I'm representing
13
00:00:39,540 --> 00:00:43,160
here is a component diagram for our example system, the course
14
00:00:43,160 --> 00:00:46,220
management system. And as you can see, it's slightly more complex
15
00:00:46,220 --> 00:00:48,390
than the other diagrams that we saw. But there's really no
16
00:00:48,390 --> 00:00:50,700
need to go through all the steps and all the details.
17
00:00:50,700 --> 00:00:53,470
Important thing is to point out some key aspects of
18
00:00:53,470 --> 00:00:56,370
this diagram. So the first one is that these rectangular
19
00:00:56,370 --> 00:00:58,560
nodes are the nodes in the system, so are my
20
00:00:58,560 --> 00:01:02,960
components. For example, student is a component, schedule is a component,
21
00:01:02,960 --> 00:01:05,069
and so on. And as far as edges are concerned,
22
00:01:05,069 --> 00:01:08,580
I'm representing two kinds of edges. The first kind of dashed
23
00:01:08,580 --> 00:01:12,060
edges which were part of the original uml definition and
24
00:01:12,060 --> 00:01:16,120
indicate use. So an edge, for example, between this compnent and
25
00:01:16,120 --> 00:01:19,570
this compnent indicated that the seminar management uses the
26
00:01:19,570 --> 00:01:23,890
facilities component. More recently, in UML two, a richer representation
27
00:01:23,890 --> 00:01:26,240
was introduced, which is the one that I'm also showing
28
00:01:26,240 --> 00:01:27,860
here. So if we look at this part of the
29
00:01:27,860 --> 00:01:29,540
diagram, you can see this sort of you now,
30
00:01:29,540 --> 00:01:34,080
lollipop socket representation. And in this case, what this represents,
31
00:01:34,080 --> 00:01:37,920
is that a lollipop indicates a provided interface. So an
32
00:01:37,920 --> 00:01:41,500
interface that is provided by the component. So, for example,
33
00:01:41,500 --> 00:01:45,940
this security component provides encryption capabilities. The socket,
34
00:01:45,940 --> 00:01:49,190
conversely, indicates a required interface. So, for example, in
35
00:01:49,190 --> 00:01:52,270
this case, it's saying that the facilities component
36
00:01:52,270 --> 00:01:55,920
is needing access control capabilities, which, by the way,
37
00:01:55,920 --> 00:01:58,660
is provided by the security component. So in
38
00:01:58,660 --> 00:02:02,240
a sense these sockets and lollipop indicate interfaces between
39
00:02:02,240 --> 00:02:04,770
a provider of some of functionality, and the client
40
00:02:04,770 --> 00:02:06,630
of that functionality and you can look at those
41
00:02:06,630 --> 00:02:09,740
as basically APIs. So sets of methods that
42
00:02:09,740 --> 00:02:12,160
provide a given functionality. To give you another
43
00:02:12,160 --> 00:02:14,760
example, if we look at the persistence components
44
00:02:14,760 --> 00:02:19,110
the persistence component provides, unsurprisingly, persistent services. And
45
00:02:19,110 --> 00:02:21,650
those persistent services are required by several other
46
00:02:21,650 --> 00:02:24,520
components in the system. And in turn, the persistent
47
00:02:24,520 --> 00:02:28,320
components relies on the University database component to
48
00:02:28,320 --> 00:02:31,740
provide such services. So, there's the University DB components
49
00:02:31,740 --> 00:02:34,700
provide these sort of low-level database services that are used
50
00:02:34,700 --> 00:02:38,150
by the persistence component To in turn provided services. Last thing
51
00:02:38,150 --> 00:02:41,080
I want to note is that components or relationships can be
52
00:02:41,080 --> 00:02:44,450
annotated, so, for example if we look at the seminar management
53
00:02:44,450 --> 00:02:47,090
and the student administration components you can see that they
54
00:02:47,090 --> 00:02:51,360
are annotated here to indicate that they are user inferfaces. So
55
00:02:51,360 --> 00:02:53,600
that's all I wanted to say on the component diagrams, but
56
00:02:53,600 --> 00:02:56,750
again the key piece of information is that they represent components
57
00:02:56,750 --> 00:03:00,250
in the system where a component consists of one or more classes indicate the
58
00:03:00,250 --> 00:03:03,540
interfaces that these components provide or require.
59
00:03:03,540 --> 00:03:06,210
and describe the interactions between these components.
|