about summary refs log tree commit diff
path: root/usth/ICT2.7/P3L2 A Tale of Analysis and Design Subtitles/8 - Refining the Class Diagram - lang_en.srt
blob: 1e47ea6594d50441328e44a7752046e93fbb7e62 (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
1
00:00:00,260 --> 00:00:01,720
Okay, so let me see if

2
00:00:01,720 --> 00:00:07,930
anything changed after we did this last modification.

3
00:00:07,930 --> 00:00:09,530
Acutally, there is someting that I would like

4
00:00:09,530 --> 00:00:12,120
to do here. Because looking at this a little

5
00:00:12,120 --> 00:00:15,560
bit more, I noticed that there are two

6
00:00:15,560 --> 00:00:18,760
attributes, renewed and due date. That we have in

7
00:00:18,760 --> 00:00:21,640
loanable Item, right? But they don't seem to

8
00:00:21,640 --> 00:00:25,590
be really, attributes or characteristics of loanable Item.

9
00:00:25,590 --> 00:00:29,150
They're more of the characteristics of the association between the

10
00:00:29,150 --> 00:00:31,450
Loanable Item and the patron. Wouldn't you agree?

11
00:00:32,470 --> 00:00:34,230
>> Well, yeah, it's not like you could

12
00:00:34,230 --> 00:00:37,644
only renew a book once in it's entire history.

13
00:00:37,644 --> 00:00:41,220
>> Right. Exactly, exactly. So, that's why what l like

14
00:00:41,220 --> 00:00:43,970
to do is I would like to move those out of loanable

15
00:00:43,970 --> 00:00:48,020
item. And actually there is a construct that we can use

16
00:00:48,020 --> 00:00:50,710
to express this. It's called, we haven't seen it yet, but it's

17
00:00:50,710 --> 00:00:52,780
a special kind of class. It's called an association

18
00:00:52,780 --> 00:00:55,480
class. So, it's a class that is connected to

19
00:00:55,480 --> 00:00:57,730
a specific association. So what we can do

20
00:00:57,730 --> 00:01:00,730
here, we can create this class, which I'm going to

21
00:01:00,730 --> 00:01:05,200
call checked out. I'm going to, associate it with

22
00:01:05,200 --> 00:01:09,520
this, association. I'm going to connect it with this association. And

23
00:01:09,520 --> 00:01:11,620
then I'm going to move the due date and the

24
00:01:11,620 --> 00:01:16,300
renewed attributes From the LoanableItem here in this checked

25
00:01:16,300 --> 00:01:18,520
out class. So in this way, seems to me that

26
00:01:18,520 --> 00:01:20,910
it makes it very explicit for somebody looking at this

27
00:01:20,910 --> 00:01:25,530
class diagram, that these characteristics are characteristics of the loan,

28
00:01:25,530 --> 00:01:28,200
and not of the elements involved in the loan.

29
00:01:28,200 --> 00:01:33,410
>> Can you do the same thing with Fine, isn't Fine a property of the

30
00:01:33,410 --> 00:01:36,740
loan? Yeah, actually is right because

31
00:01:36,740 --> 00:01:39,120
a fine is a fine for a specific loan, right?

32
00:01:39,120 --> 00:01:39,910
>> That's correct.

33
00:01:39,910 --> 00:01:41,950
>> Okay, so yeah. Then we can do that.

34
00:01:41,950 --> 00:01:45,900
We don't need to represent fine as a class, we can just transform

35
00:01:45,900 --> 00:01:49,460
that into an attribute that we can put into the checked out association class.

36
00:01:49,460 --> 00:01:50,560
>> Gotcha.

37
00:01:50,560 --> 00:01:52,760
>> Anything else?

38
00:01:52,760 --> 00:01:57,990
>> Yeah. It occurred to me that there's another thing that happens in one

39
00:01:57,990 --> 00:02:00,260
of my scenarios, I put down

40
00:02:00,260 --> 00:02:02,770
about the patron actually returning an item.

41
00:02:02,770 --> 00:02:07,620
>> Right. Okay, so we would probably need an additional operation,

42
00:02:07,620 --> 00:02:08,550
I guess, for the patron.

43
00:02:08,550 --> 00:02:08,990
>> Right.

44
00:02:08,990 --> 00:02:11,310
>> So, okay, so what I'm going to do, that's pretty easy

45
00:02:11,310 --> 00:02:15,350
to do, I'm just going to add the return operation here in the

46
00:02:15,350 --> 00:02:19,310
patron, and when that happens, that will mean that I'll get rid

47
00:02:19,310 --> 00:02:23,490
of this association class because the item is returned. Is that right?

48
00:02:23,490 --> 00:02:27,060
>> Well, what happens if somebody drops the

49
00:02:27,060 --> 00:02:29,400
book in the book drop, but doesn't pay the,

50
00:02:29,400 --> 00:02:31,050
if it's overdue and doesn't pay the fine?

51
00:02:31,050 --> 00:02:32,700
Will that get rid of the information about what

52
00:02:32,700 --> 00:02:33,040
they owe?

53
00:02:33,040 --> 00:02:37,960
>> Oh, I see. So you can have the item being available, but you still

54
00:02:37,960 --> 00:02:42,510
want to know whether there is any pending fines on the book.

55
00:02:42,510 --> 00:02:44,390
>> Uh-huh, and how much those fines are.

56
00:02:44,390 --> 00:02:46,340
>> And how do you compute how much it is?

57
00:02:47,420 --> 00:02:52,710
>> It's how many days it was, from the time it was

58
00:02:52,710 --> 00:02:58,170
due, to when they returned it. I see. OK.

59
00:02:58,170 --> 00:03:00,380
So you know what we can do? I think

60
00:03:00,380 --> 00:03:03,690
we can put an additional attribute in the checked out

61
00:03:03,690 --> 00:03:07,190
class and I'm going to call it when returned and

62
00:03:07,190 --> 00:03:10,200
that item will have either a special value or it

63
00:03:10,200 --> 00:03:12,040
will contain the date in which the book was

64
00:03:12,040 --> 00:03:14,520
returned. So in this way you should be able to

65
00:03:14,520 --> 00:03:18,040
keep this in the system until it's paid, and also to compute

66
00:03:18,040 --> 00:03:19,970
how much the fine is. Is that working?

67
00:03:19,970 --> 00:03:23,210
>> So the special value is for a normal situation when they

68
00:03:23,210 --> 00:03:25,880
haven't, they don't owe anything and haven't returned it yet.

69
00:03:25,880 --> 00:03:28,080
>> Exactly so that will tell us that,

70
00:03:28,080 --> 00:03:29,970
that the loan is still active basically.

71
00:03:29,970 --> 00:03:30,500
>> Great.

72
00:03:30,500 --> 00:03:31,480
>> Does that work for you?

73
00:03:31,480 --> 00:03:35,200
>> Yes. And you know, I like this. I mean, I feel pretty good

74
00:03:35,200 --> 00:03:38,490
about it. I think we have a nice class diagram. So what I'd like to

75
00:03:38,490 --> 00:03:43,280
do is just go off and clean it up a little bit, and put it

76
00:03:43,280 --> 00:03:48,640
in an IDE so I can pretty print it and rearrange things a little bit.

77
00:03:48,640 --> 00:03:50,080
And then I'd like to sit down again and

78
00:03:50,080 --> 00:03:52,730
just go through it for a last time. And

79
00:03:52,730 --> 00:03:54,900
for some final considerations. So if you don't mind

80
00:03:54,900 --> 00:03:56,880
we will take a ten minute break and reconvene here.

81
00:03:56,880 --> 00:03:57,500
>> That's fine.

82
00:03:57,500 --> 00:03:57,990
>> Alright.