about summary refs log tree commit diff
path: root/usth/ICT2.7/P3L2 A Tale of Analysis and Design Subtitles/4 - Adding Attributes - lang_en.srt
blob: 0a48aaec3cc6eeae854819498cf7f393ad65e359 (plain) (blame)
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
1
00:00:00,240 --> 00:00:02,880
Okay, so let me look at the requirements and

2
00:00:05,500 --> 00:00:09,150
it's something that I can see here that we didn't point out before is that

3
00:00:09,150 --> 00:00:13,540
there seems to be clearly some concept of a due date. And I'm telling you why

4
00:00:13,540 --> 00:00:17,610
I'm saying that because here, for example, I notice that it says when items are

5
00:00:17,610 --> 00:00:22,580
due. We mention overdue several times, so is

6
00:00:22,580 --> 00:00:24,410
this something we need to keep track of?

7
00:00:24,410 --> 00:00:27,510
>> Yeah remember when we used to stamp them on the books? In the stamp pad?

8
00:00:27,510 --> 00:00:28,240
>> Oh yeah yeah yeah! Oh course!

9
00:00:28,240 --> 00:00:30,600
>> Right? Yeah we definitely keep track of,

10
00:00:30,600 --> 00:00:32,390
the system has to keep track of when books are due.

11
00:00:32,390 --> 00:00:35,300
>> Okay. So it seems to me that one good way

12
00:00:35,300 --> 00:00:39,660
of doing that is by basically adding an attribute to the, item.

13
00:00:39,660 --> 00:00:40,590
>> Okay.

14
00:00:40,590 --> 00:00:41,910
>> And I'll just call it due date.

15
00:00:41,910 --> 00:00:42,400
>> Okay.

16
00:00:42,400 --> 00:00:45,360
>> So basically for each item in case it's loaned

17
00:00:45,360 --> 00:00:48,315
there will be this attribute that will contain the value of

18
00:00:48,315 --> 00:00:48,520
>> Okay.

19
00:00:48,520 --> 00:00:55,710
>> Of when, when the item is due. And then, something else that I noticed

20
00:00:55,710 --> 00:00:58,734
here is that down here, it seems like

21
00:00:58,734 --> 00:01:00,900
the requirements are saying that an item can

22
00:01:00,900 --> 00:01:04,190
be renewed only once. So, I guess, that's

23
00:01:04,190 --> 00:01:05,933
something we need to keep track of, right?

24
00:01:05,933 --> 00:01:06,056
>> Yeah.

25
00:01:06,056 --> 00:01:06,700
>> The system needs to know.

26
00:01:06,700 --> 00:01:08,360
>> We have to know whether they've renewed it or not.

27
00:01:08,360 --> 00:01:14,132
>> Okay so, I'll do a similar thing here. I think I want to go and add a an

28
00:01:14,132 --> 00:01:19,140
attribute that we'd call number of times renewed, and add it to the item class.

29
00:01:19,140 --> 00:01:19,760
>> Okay.

30
00:01:19,760 --> 00:01:21,140
>> And this is kind of more generic

31
00:01:21,140 --> 00:01:23,180
than what you need, because here it says only once, but

32
00:01:23,180 --> 00:01:25,800
let's say that in the future you want to allow it to,

33
00:01:25,800 --> 00:01:28,690
kind of renew twice, you'll be able to use these attributes again

34
00:01:28,690 --> 00:01:31,090
because, we can just count how many times it was renewed. Okay?

35
00:01:31,090 --> 00:01:31,680
>> Makes sense.

36
00:01:31,680 --> 00:01:35,980
>> Alright. And one last thing I want to point out.

37
00:01:35,980 --> 00:01:38,310
And this seems obvious but I'm going to check with

38
00:01:38,310 --> 00:01:43,150
you anyways. And seems like there is a basically the

39
00:01:43,150 --> 00:01:46,090
need to keep track of whether an item is checked

40
00:01:46,090 --> 00:01:48,210
out or not. If you look at the text here,

41
00:01:48,210 --> 00:01:51,080
the requirements here, I can see that check out and checked out are

42
00:01:51,080 --> 00:01:55,070
mentioned five times. So, I'm assuming that that's something also

43
00:01:55,070 --> 00:01:58,080
that we want to know about an item, whether it's checked out or not.

44
00:01:58,080 --> 00:01:59,970
>> We have to keep track of whether they're checked out.

45
00:01:59,970 --> 00:02:01,930
>> Okay, so I'll add an

46
00:02:01,930 --> 00:02:04,340
additional attribute there. So I'm going to again go

47
00:02:04,340 --> 00:02:06,480
back to the diagram and I'm

48
00:02:06,480 --> 00:02:10,139
just going to write here also the checked out attribute.

49
00:02:12,260 --> 00:02:14,590
And, I think that's it as far as I'm

50
00:02:14,590 --> 00:02:16,330
concerned. Is there anything that you think is missing?

51
00:02:16,330 --> 00:02:21,077
>> Well, I do have a question. Would checked out,

52
00:02:21,077 --> 00:02:27,140
better not be the case that someone can check out a reference book.

53
00:02:27,140 --> 00:02:28,400
>> Oh, I see, I see.

54
00:02:28,400 --> 00:02:30,120
>> Okay. I mean, it's only the books and

55
00:02:30,120 --> 00:02:31,780
the audio visual material that can be checked out.

56
00:02:31,780 --> 00:02:37,790
>> Right, right, right. Okay, so I, I guess, well the way I will fix that is,

57
00:02:37,790 --> 00:02:42,300
I'll probably put yet another attribute in the item class, and I'll

58
00:02:42,300 --> 00:02:45,860
call it loanable. And basically, this attribute is just telling us whether

59
00:02:45,860 --> 00:02:49,580
an item is loanable or not. So, when it's not true and

60
00:02:49,580 --> 00:02:53,480
loanable is not on. Basically, that item can be checked out.

61
00:02:53,480 --> 00:02:55,174
>> Okay. And, the system would know this.

62
00:02:55,174 --> 00:02:56,450
>> The system will know that.

63
00:02:56,450 --> 00:02:57,160
>> And prevent it from happening.

64
00:02:57,160 --> 00:02:58,240
>> And prevent it from happening. Okay?

65
00:02:58,240 --> 00:02:58,750
>> Alright.

66
00:02:58,750 --> 00:03:02,918
>> Perfect. So, we're going to do that and, any other objections,

67
00:03:02,918 --> 00:03:04,035
any other?

68
00:03:04,035 --> 00:03:05,730
>> No, that was my question.

69
00:03:05,730 --> 00:03:08,040
>> Okay, perfect, so what I'm going to do next, I

70
00:03:08,040 --> 00:03:11,130
mean, I haven't mentioned that yet, but you know classes right

71
00:03:11,130 --> 00:03:12,890
now we just looked at the attributes right that give

72
00:03:12,890 --> 00:03:16,140
you sort of the state of the class. And there's something

73
00:03:16,140 --> 00:03:19,185
else, there's a second part of the class that is kind of

74
00:03:19,185 --> 00:03:22,520
an orthogonal aspect, which is what the class can do. And we

75
00:03:22,520 --> 00:03:25,640
call those operations. So normally these kinds also have operations, I

76
00:03:25,640 --> 00:03:28,000
guess you know it would make sense to you as well.

77
00:03:28,000 --> 00:03:30,070
And one way, one very natural way to

78
00:03:30,070 --> 00:03:33,310
identify operations is to look at the requirements and

79
00:03:33,310 --> 00:03:36,850
look for verbs. Because verbs associated with an item

80
00:03:36,850 --> 00:03:38,480
will tell you basically what the item can do.

81
00:03:38,480 --> 00:03:38,900
>> Okay.

82
00:03:38,900 --> 00:03:41,250
>> So I, I'd like to go back to the requirements and

83
00:03:41,250 --> 00:03:45,110
start, the same way in which we underlined, nouns, we're going to underline

84
00:03:45,110 --> 00:03:49,340
verbs and we're going to see which ones of those verbs actually represent

85
00:03:49,340 --> 00:03:53,120
actions that we want to represent explicitly, we want to model explicitly in

86
00:03:53,120 --> 00:03:53,950
our class diagram.

87
00:03:53,950 --> 00:03:54,490
>> Okay.

88
00:03:54,490 --> 00:03:54,750
>> Okay.