Tan115 commited on
Commit
240fb90
·
verified ·
1 Parent(s): 03cd5c5

Clean up: Remove specific course folders (delete folder '55 - ===== Exam DAO, Database, JDBC, SQL ======')

Browse files
55 - ===== Exam DAO, Database, JDBC, SQL ======/001 Exam task review and solution.mp4 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:d99607852b9641bbc07191dfa2971b894f04299222abe8bc6710f52db35c7683
3
- size 289853748
 
 
 
 
55 - ===== Exam DAO, Database, JDBC, SQL ======/001 Exam task review and solution_en.srt DELETED
@@ -1,936 +0,0 @@
1
- 1
2
- 00:00:05,000 --> 00:00:06,000
3
- Hello, Jim.
4
-
5
- 2
6
- 00:00:06,000 --> 00:00:11,000
7
- In this lesson, we're going to review the homework that will help you to practice your skills in using
8
-
9
- 3
10
- 00:00:11,000 --> 00:00:16,000
11
- Dolly Parton, even B, C and sequel and please, what is this lesson?
12
-
13
- 4
14
- 00:00:16,000 --> 00:00:20,000
15
- Because I'm sure this lesson will be super musical for you.
16
-
17
- 5
18
- 00:00:21,000 --> 00:00:23,000
19
- Why, I think so.
20
-
21
- 6
22
- 00:00:23,000 --> 00:00:29,000
23
- Because exactly in this media, I'm going to feel the gap between the theory and practice, and we'll
24
-
25
- 7
26
- 00:00:29,000 --> 00:00:35,000
27
- try to teach you structural thinking in order to achieve better architecture and software design.
28
-
29
- 8
30
- 00:00:36,000 --> 00:00:42,000
31
- In this lesson, I am going to share with you a lot of practical things that you wouldn't read on any
32
-
33
- 9
34
- 00:00:42,000 --> 00:00:46,000
35
- website and wouldn't find on any forum in the internet.
36
-
37
- 10
38
- 00:00:46,000 --> 00:00:51,000
39
- I wish somebody would explain the average student in a similar way when I just started the program.
40
-
41
- 11
42
- 00:00:52,000 --> 00:00:54,000
43
- So enjoys the video.
44
-
45
- 12
46
- 00:00:54,000 --> 00:01:00,000
47
- Also, if you are a student of my job, of course, you know that during the course we implement online
48
-
49
- 13
50
- 00:01:00,000 --> 00:01:00,000
51
- shop.
52
-
53
- 14
54
- 00:01:01,000 --> 00:01:05,000
55
- And in this homework, we're going to make the next step towards our goal.
56
-
57
- 15
58
- 00:01:06,000 --> 00:01:11,000
59
- Great web application of our online store today will improve our lives.
60
-
61
- 16
62
- 00:01:11,000 --> 00:01:14,000
63
- It is responsible for storing information in our app.
64
-
65
- 17
66
- 00:01:15,000 --> 00:01:17,000
67
- Let's start from reviewing the task first.
68
-
69
- 18
70
- 00:01:18,000 --> 00:01:22,000
71
- First of all, you need to download template of the app to your computer.
72
-
73
- 19
74
- 00:01:23,000 --> 00:01:26,000
75
- Here are provided templates application.
76
-
77
- 20
78
- 00:01:26,000 --> 00:01:30,000
79
- This is the latest version of our that with together with all students.
80
-
81
- 21
82
- 00:01:31,000 --> 00:01:36,000
83
- In case you want to implement the application from scratch or you want to become more familiar with
84
-
85
- 22
86
- 00:01:36,000 --> 00:01:39,000
87
- the functionality of the app just in case.
88
-
89
- 23
90
- 00:01:39,000 --> 00:01:42,000
91
- Here I also have a description of all functional requirements.
92
-
93
- 24
94
- 00:01:43,000 --> 00:01:46,000
95
- You can check them and implement that app by your own.
96
-
97
- 25
98
- 00:01:47,000 --> 00:01:53,000
99
- But still, I believe using the template is more than enough to achieve the goals of this homework.
100
-
101
- 26
102
- 00:01:53,000 --> 00:01:59,000
103
- Once you are able to run the solution locally, we're going to proceed with the next steps.
104
-
105
- 27
106
- 00:02:00,000 --> 00:02:03,000
107
- On the next step, you have to create tables in the database.
108
-
109
- 28
110
- 00:02:03,000 --> 00:02:09,000
111
- If you followed the course, then we created almost all necessary tablespoons.
112
-
113
- 29
114
- 00:02:09,000 --> 00:02:16,000
115
- Of course, you need just to create one more table and make some minor adjustments by adding additional
116
-
117
- 30
118
- 00:02:16,000 --> 00:02:16,000
119
- columns.
120
-
121
- 31
122
- 00:02:17,000 --> 00:02:24,000
123
- If you don't have any table created yet, create all necessary tables from scratch at the end of the
124
-
125
- 32
126
- 00:02:24,000 --> 00:02:25,000
127
- homework description.
128
-
129
- 33
130
- 00:02:25,000 --> 00:02:32,000
131
- Will provide you with the link to my data expert, and you will be able to include the same tables that
132
-
133
- 34
134
- 00:02:32,000 --> 00:02:34,000
135
- I have with the same data.
136
-
137
- 35
138
- 00:02:35,000 --> 00:02:38,000
139
- After that, you need to implement the types for that.
140
-
141
- 36
142
- 00:02:39,000 --> 00:02:45,000
143
- I want you to indentify which star types you have to create by yourself, because this is also part
144
-
145
- 37
146
- 00:02:45,000 --> 00:02:46,000
147
- of the task.
148
-
149
- 38
150
- 00:02:46,000 --> 00:02:53,000
151
- I will not tell you that you have to implement these these lenses now because this is super simple for
152
-
153
- 39
154
- 00:02:53,000 --> 00:02:53,000
155
- your level already.
156
-
157
- 40
158
- 00:02:54,000 --> 00:03:00,000
159
- But nevertheless, I will provide you was my solution and you will be able to find what types I create
160
-
161
- 41
162
- 00:03:01,000 --> 00:03:02,000
163
- together with no thoughts.
164
-
165
- 42
166
- 00:03:02,000 --> 00:03:04,000
167
- You need to create detail or types.
168
-
169
- 43
170
- 00:03:05,000 --> 00:03:11,000
171
- And one more important thing I recommend you to create converters between video and business entities.
172
-
173
- 44
174
- 00:03:12,000 --> 00:03:20,000
175
- I've explained why now and on example because data transfer objects are nothing more than a reflection
176
-
177
- 45
178
- 00:03:20,000 --> 00:03:23,000
179
- of the data from the database in Java objects.
180
-
181
- 46
182
- 00:03:24,000 --> 00:03:27,000
183
- But these objects are not true objects.
184
-
185
- 47
186
- 00:03:27,000 --> 00:03:35,000
187
- If you understand what I mean, zap pure data structures that don't have any behavior, while existing
188
-
189
- 48
190
- 00:03:35,000 --> 00:03:40,000
191
- business objects that are already created in the app may have some behavior.
192
-
193
- 49
194
- 00:03:41,000 --> 00:03:49,000
195
- Another point is that database table may contain dozens of rules, but not all the information from
196
-
197
- 50
198
- 00:03:49,000 --> 00:03:53,000
199
- each column may be used in existing business scenarios.
200
-
201
- 51
202
- 00:03:54,000 --> 00:03:59,000
203
- It might happen that some of the values are used just for consistency purposes.
204
-
205
- 52
206
- 00:04:00,000 --> 00:04:02,000
207
- As a column I used not so.
208
-
209
- 53
210
- 00:04:02,000 --> 00:04:07,000
211
- I choose a solution of business goals, but to solve some technical aspects of implementation.
212
-
213
- 54
214
- 00:04:08,000 --> 00:04:14,000
215
- That's why it is not always a guarantee that all information from the veto will be used in the app.
216
-
217
- 55
218
- 00:04:15,000 --> 00:04:21,000
219
- And last but not least, the argument to implement convergence between the data and models is isolation.
220
-
221
- 56
222
- 00:04:22,000 --> 00:04:26,000
223
- I will go now and in the future is to reduce coupling between modules.
224
-
225
- 57
226
- 00:04:27,000 --> 00:04:33,000
227
- We're about to introduce new persistence layer and instead of rewriting business models and business
228
-
229
- 58
230
- 00:04:33,000 --> 00:04:40,000
231
- logic of the app, what we do will is averaging like it was before to minimize the impact of adjustments
232
-
233
- 59
234
- 00:04:41,000 --> 00:04:45,000
235
- to make sure that the existing application will work like it's worked before.
236
-
237
- 60
238
- 00:04:45,000 --> 00:04:52,000
239
- But together with new persistence layer, we introduce convergence that can convert our digital objects
240
-
241
- 61
242
- 00:04:53,000 --> 00:04:55,000
243
- to existing business objects.
244
-
245
- 62
246
- 00:04:55,000 --> 00:05:02,000
247
- And in case we can take control over the process of converting objects into business objects and vice
248
-
249
- 63
250
- 00:05:02,000 --> 00:05:03,000
251
- versa.
252
-
253
- 64
254
- 00:05:03,000 --> 00:05:10,000
255
- And in this case, we can take control of the process of converting digital objects into business objects
256
-
257
- 65
258
- 00:05:10,000 --> 00:05:11,000
259
- and vice versa.
260
-
261
- 66
262
- 00:05:12,000 --> 00:05:16,000
263
- And now the important thing is the task implementation.
264
-
265
- 67
266
- 00:05:16,000 --> 00:05:21,000
267
- Do not hesitate to remove Java files that you see we don't need anymore.
268
-
269
- 68
270
- 00:05:22,000 --> 00:05:24,000
271
- We created this solution during the Java course.
272
-
273
- 69
274
- 00:05:25,000 --> 00:05:31,000
275
- And sometimes we separate that responsibility as much as we can for demo purposes.
276
-
277
- 70
278
- 00:05:31,000 --> 00:05:37,000
279
- Probably you can merge some types together, and some of them completely may be removed.
280
-
281
- 71
282
- 00:05:38,000 --> 00:05:38,000
283
- It is up to you.
284
-
285
- 72
286
- 00:05:39,000 --> 00:05:46,000
287
- Just want to highlight that during my solution to you are going to see some of the facts are made.
288
-
289
- 73
290
- 00:05:46,000 --> 00:05:53,000
291
- And as you may already understand, the main goal of this task is to make sure that our solution works
292
-
293
- 74
294
- 00:05:53,000 --> 00:06:01,000
295
- with database and use relational database as main persistent storage z sole task is that you have to
296
-
297
- 75
298
- 00:06:01,000 --> 00:06:01,000
299
- work on.
300
-
301
- 76
302
- 00:06:02,000 --> 00:06:06,000
303
- So now you can press a pause and start implementation of the task.
304
-
305
- 77
306
- 00:06:07,000 --> 00:06:11,000
307
- And when you will be done with implementation, you can review my solution.
308
-
309
- 78
310
- 00:06:12,000 --> 00:06:12,000
311
- Yeah.
312
-
313
- 79
314
- 00:06:12,000 --> 00:06:15,000
315
- Left reference to commands that contains all changes done.
316
-
317
- 80
318
- 00:06:16,000 --> 00:06:21,000
319
- But if you want to look at the solution as a whole, you can find all code of the solutions here.
320
-
321
- 81
322
- 00:06:22,000 --> 00:06:29,000
323
- Separately, I left here allocation of scripts in database in case you would like to record a state
324
-
325
- 82
326
- 00:06:29,000 --> 00:06:29,000
327
- of SAP.
328
-
329
- 83
330
- 00:06:30,000 --> 00:06:34,000
331
- And also let me hold quick walkthrough of the solution of the task.
332
-
333
- 84
334
- 00:06:35,000 --> 00:06:42,000
335
- So the first thing that I did, I created the types I didn't implement all across operations for the
336
-
337
- 85
338
- 00:06:42,000 --> 00:06:50,000
339
- purpose because usually I would keep records that I don't use and that I decided to rely only on the
340
-
341
- 86
342
- 00:06:50,000 --> 00:06:57,000
343
- business behavior and declare masses as it would allow to access just enough data to perform existing
344
-
345
- 87
346
- 00:06:57,000 --> 00:06:58,000
347
- business behavior.
348
-
349
- 88
350
- 00:06:58,000 --> 00:07:07,000
351
- How I did that, I looked at existing business there, and this application of business logic is concentrated
352
-
353
- 89
354
- 00:07:07,000 --> 00:07:08,000
355
- in services.
356
-
357
- 90
358
- 00:07:08,000 --> 00:07:11,000
359
- We have separate package was services here.
360
-
361
- 91
362
- 00:07:12,000 --> 00:07:19,000
363
- So what I did, I open the services, review them and created a downtimes that would help you to achieve
364
-
365
- 92
366
- 00:07:19,000 --> 00:07:20,000
367
- expected results.
368
-
369
- 93
370
- 00:07:20,000 --> 00:07:22,000
371
- Let me show you z on one example.
372
-
373
- 94
374
- 00:07:23,000 --> 00:07:26,000
375
- For example, the user management service.
376
-
377
- 95
378
- 00:07:26,000 --> 00:07:28,000
379
- Let's see what this service does.
380
-
381
- 96
382
- 00:07:29,000 --> 00:07:30,000
383
- It registers user.
384
-
385
- 97
386
- 00:07:31,000 --> 00:07:33,000
387
- What this means for me.
388
-
389
- 98
390
- 00:07:33,000 --> 00:07:37,000
391
- This means that during registration, users should be saved in the.
392
-
393
- 99
394
- 00:07:38,000 --> 00:07:38,000
395
- Database.
396
-
397
- 100
398
- 00:07:39,000 --> 00:07:43,000
399
- So in my user now I declare massive safe user.
400
-
401
- 101
402
- 00:07:44,000 --> 00:07:50,000
403
- But why isn't I don't use registered user as an interface of my DAO implementations?
404
-
405
- 102
406
- 00:07:51,000 --> 00:07:54,000
407
- The answer is simple and complex at the same time.
408
-
409
- 103
410
- 00:07:55,000 --> 00:08:02,000
411
- I don't use my service as a downer because this service is another layer of abstraction.
412
-
413
- 104
414
- 00:08:03,000 --> 00:08:07,000
415
- It isn't easy to understand at first glance, but let me try to explain.
416
-
417
- 105
418
- 00:08:08,000 --> 00:08:14,000
419
- And probably in many other languages, in larger price applications, you would ignore this.
420
-
421
- 106
422
- 00:08:15,000 --> 00:08:16,000
423
- But not many guys.
424
-
425
- 107
426
- 00:08:17,000 --> 00:08:20,000
427
- I'm going to teach you how to create scalable architecture.
428
-
429
- 108
430
- 00:08:21,000 --> 00:08:26,000
431
- So this course, user management service is a business there.
432
-
433
- 109
434
- 00:08:26,000 --> 00:08:27,000
435
- What does that mean?
436
-
437
- 110
438
- 00:08:28,000 --> 00:08:35,000
439
- This means that besides saving user, it is a database and lots of other things may happen.
440
-
441
- 111
442
- 00:08:35,000 --> 00:08:37,000
443
- User user registration.
444
-
445
- 112
446
- 00:08:38,000 --> 00:08:43,000
447
- What are the things, for example, user user registration you things may happen.
448
-
449
- 113
450
- 00:08:44,000 --> 00:08:48,000
451
- The most obvious one we store information about usernames and database.
452
-
453
- 114
454
- 00:08:49,000 --> 00:08:52,000
455
- Also, potentially, we sent a welcome email.
456
-
457
- 115
458
- 00:08:53,000 --> 00:08:58,000
459
- The user also dependent on the conditions of our affiliate program.
460
-
461
- 116
462
- 00:08:58,000 --> 00:09:05,000
463
- We need Three Flags that this user was registered by the reference of another user in order that the
464
-
465
- 117
466
- 00:09:05,000 --> 00:09:11,000
467
- user will receive bonuses in the future from the money spent by this user inside the application.
468
-
469
- 118
470
- 00:09:12,000 --> 00:09:14,000
471
- And these are just a few examples.
472
-
473
- 119
474
- 00:09:14,000 --> 00:09:23,000
475
- Registered user Behera describes some business case business behavior, and on the implementation level,
476
-
477
- 120
478
- 00:09:23,000 --> 00:09:29,000
479
- we define how this behavior will be implemented and saving user does it not base?
480
-
481
- 121
482
- 00:09:29,000 --> 00:09:33,000
483
- It is just one step means a user registration flow.
484
-
485
- 122
486
- 00:09:34,000 --> 00:09:35,000
487
- Do you feel my point now?
488
-
489
- 123
490
- 00:09:36,000 --> 00:09:40,000
491
- That's why I strongly recommend to keep this list separately.
492
-
493
- 124
494
- 00:09:41,000 --> 00:09:45,000
495
- You already know the benefits that we can get from the low koplan.
496
-
497
- 125
498
- 00:09:45,000 --> 00:09:46,000
499
- I wouldn't repeat myself.
500
-
501
- 126
502
- 00:09:47,000 --> 00:09:53,000
503
- I would just make a reference here to my in-laws, of course, is the school software architecture Anthony
504
-
505
- 127
506
- 00:09:53,000 --> 00:10:00,000
507
- called Design, where I explained and details the benefits of low Koplan and how to achieve scalable
508
-
509
- 128
510
- 00:10:00,000 --> 00:10:01,000
511
- architecture.
512
-
513
- 129
514
- 00:10:02,000 --> 00:10:08,000
515
- Words that course through if you wish this will extremely beneficial for all software engineers, regardless
516
-
517
- 130
518
- 00:10:08,000 --> 00:10:10,000
519
- programming language they use.
520
-
521
- 131
522
- 00:10:11,000 --> 00:10:19,000
523
- And similar case with other masses, for example, I have get users behavior in my service and I forget
524
-
525
- 132
526
- 00:10:19,000 --> 00:10:21,000
527
- users in my downtime.
528
-
529
- 133
530
- 00:10:22,000 --> 00:10:30,000
531
- But here's one more difference in user management service gets users returns a list of user objects,
532
-
533
- 134
534
- 00:10:30,000 --> 00:10:37,000
535
- but in mind now all of you get users massive returns, US list of user data objects.
536
-
537
- 135
538
- 00:10:37,000 --> 00:10:39,000
539
- Why is this is different?
540
-
541
- 136
542
- 00:10:39,000 --> 00:10:45,000
543
- I tried to explain this during a home task description, and I will remind you now.
544
-
545
- 137
546
- 00:10:46,000 --> 00:10:52,000
547
- So the detail object is data structure in very, very simplified words.
548
-
549
- 138
550
- 00:10:52,000 --> 00:10:59,000
551
- This is a reflection of all fields that the user table has in the database, and not all ways to solve.
552
-
553
- 139
554
- 00:10:59,000 --> 00:11:02,000
555
- Our business case is unique to you and data structures.
556
-
557
- 140
558
- 00:11:03,000 --> 00:11:09,000
559
- At the end of the day, we need to have places where to put objects related behavior, and this should
560
-
561
- 141
562
- 00:11:09,000 --> 00:11:13,000
563
- be business types, but not data structures.
564
-
565
- 142
566
- 00:11:13,000 --> 00:11:22,000
567
- Also, as I already said in detail, might be fields that are not used in business logic and exist just
568
-
569
- 143
570
- 00:11:22,000 --> 00:11:24,000
571
- to support data consistency.
572
-
573
- 144
574
- 00:11:24,000 --> 00:11:32,000
575
- By the way, having separate data and business objects, we can minimize impact and modification of
576
-
577
- 145
578
- 00:11:32,000 --> 00:11:32,000
579
- persistence systems.
580
-
581
- 146
582
- 00:11:33,000 --> 00:11:40,000
583
- And in a similar way, I analyze the business needs of the app and created the phrases for different
584
-
585
- 147
586
- 00:11:41,000 --> 00:11:41,000
587
- types.
588
-
589
- 148
590
- 00:11:42,000 --> 00:11:47,000
591
- After that, I had to implement these interfaces not since complex here.
592
-
593
- 149
594
- 00:11:48,000 --> 00:11:53,000
595
- Every scene is similar to the approach we discussed during our GDC lessons.
596
-
597
- 150
598
- 00:11:54,000 --> 00:12:00,000
599
- Probably the only one interested in seeing that we didn't discuss during lesson is auto generated is
600
-
601
- 151
602
- 00:12:01,000 --> 00:12:02,000
603
- usually rated by.
604
-
605
- 152
606
- 00:12:02,000 --> 00:12:05,000
607
- That's a base for the new top Ojo's insertion.
608
-
609
- 153
610
- 00:12:06,000 --> 00:12:12,000
611
- When this model needed imagines that the insurgents formation that you purchase is a database in one
612
-
613
- 154
614
- 00:12:12,000 --> 00:12:14,000
615
- table in purchased table.
616
-
617
- 155
618
- 00:12:15,000 --> 00:12:22,000
619
- But also you need to base Newt to oppose and purchase products that implement many, many relationships
620
-
621
- 156
622
- 00:12:22,000 --> 00:12:26,000
623
- between product and purchase entities and to implement this.
624
-
625
- 157
626
- 00:12:27,000 --> 00:12:30,000
627
- We need the base I.D. of generated purchase.
628
-
629
- 158
630
- 00:12:31,000 --> 00:12:38,000
631
- We can extract auto generated from the statement during the creation of the statement.
632
-
633
- 159
634
- 00:12:38,000 --> 00:12:44,000
635
- We have to parse that for auto generated case in safe purchase method.
636
-
637
- 160
638
- 00:12:44,000 --> 00:12:53,000
639
- We have this example, so you can see that I post custom value from statements close to the school return
640
-
641
- 161
642
- 00:12:53,000 --> 00:12:55,000
643
- generated case.
644
-
645
- 162
646
- 00:12:55,000 --> 00:13:04,000
647
- This is just a flat single int value, and once we execute this statement, we can get auto generated
648
-
649
- 163
650
- 00:13:04,000 --> 00:13:13,000
651
- piece by column yet generated case massive vehicle returns, a result set that will contain auto generated
652
-
653
- 164
654
- 00:13:13,000 --> 00:13:15,000
655
- key for each and set it up.
656
-
657
- 165
658
- 00:13:16,000 --> 00:13:24,000
659
- And we will use that key to insert trackers in purchase product table, as you can see, I execute this
660
-
661
- 166
662
- 00:13:24,000 --> 00:13:27,000
663
- insertions in watch to improve performance.
664
-
665
- 167
666
- 00:13:28,000 --> 00:13:31,000
667
- Basically, the rest of the scenes here should be familiar to you.
668
-
669
- 168
670
- 00:13:32,000 --> 00:13:40,000
671
- By the way, I remember it's one more thing I need all the management service and order entity into
672
-
673
- 169
674
- 00:13:40,000 --> 00:13:48,000
675
- purchase because order is a key word in the database and that is hard to use order as a database name.
676
-
677
- 170
678
- 00:13:48,000 --> 00:13:56,000
679
- That's why to address this challenge, I decided to use purchase terminology instead and renamed all
680
-
681
- 171
682
- 00:13:56,000 --> 00:13:58,000
683
- related files in our app here.
684
-
685
- 172
686
- 00:13:59,000 --> 00:14:07,000
687
- Also, I created Category Table is a database that contains only category name and I.D. because there's
688
-
689
- 173
690
- 00:14:07,000 --> 00:14:11,000
691
- a connection between product and category manager one.
692
-
693
- 174
694
- 00:14:12,000 --> 00:14:16,000
695
- Different products may be related was one Category two.
696
-
697
- 175
698
- 00:14:16,000 --> 00:14:20,000
699
- Implement this We also need to add foreign key in product.
700
-
701
- 176
702
- 00:14:20,000 --> 00:14:24,000
703
- Table three Establish connection between each product category.
704
-
705
- 177
706
- 00:14:25,000 --> 00:14:33,000
707
- Those are changes that they need in the database and also implements respective types in the app in
708
-
709
- 178
710
- 00:14:33,000 --> 00:14:41,000
711
- parallel by implementing different data types to reflect each database entity in Java in object oriented
712
-
713
- 179
714
- 00:14:41,000 --> 00:14:42,000
715
- way.
716
-
717
- 180
718
- 00:14:42,000 --> 00:14:44,000
719
- Nothing so much interesting here.
720
-
721
- 181
722
- 00:14:45,000 --> 00:14:47,000
723
- Just fields, getters and setters.
724
-
725
- 182
726
- 00:14:48,000 --> 00:14:51,000
727
- Separate package here is code converter.
728
-
729
- 183
730
- 00:14:51,000 --> 00:14:59,000
731
- This package contains all converters that I need in my app to convert your objects to business objects
732
-
733
- 184
734
- 00:14:59,000 --> 00:15:00,000
735
- and vice versa.
736
-
737
- 185
738
- 00:15:01,000 --> 00:15:06,000
739
- Let's review one of the example product detail converter in our application.
740
-
741
- 186
742
- 00:15:06,000 --> 00:15:10,000
743
- We also often work with collections of details and business models.
744
-
745
- 187
746
- 00:15:11,000 --> 00:15:19,000
747
- That's why it also makes sense for us to have an API that easily converts least of use the list of business
748
-
749
- 188
750
- 00:15:19,000 --> 00:15:20,000
751
- objects and vice versa.
752
-
753
- 189
754
- 00:15:21,000 --> 00:15:27,000
755
- Inside the masses, I basically create objects that I need and manually populate data.
756
-
757
- 190
758
- 00:15:27,000 --> 00:15:32,000
759
- Probably, you might be wondering why do we need so many classes?
760
-
761
- 191
762
- 00:15:32,000 --> 00:15:36,000
763
- It is crazy amount of classes, even on simple example.
764
-
765
- 192
766
- 00:15:36,000 --> 00:15:42,000
767
- You are right in some degree, but you always should understand the goals that we want to achieve.
768
-
769
- 193
770
- 00:15:43,000 --> 00:15:49,000
771
- Our goal is to make software designs that would allow us easily to scale our application when it will
772
-
773
- 194
774
- 00:15:49,000 --> 00:15:58,000
775
- be needed and one more interested in seeing the share such objects as d'etats converters may be auto
776
-
777
- 195
778
- 00:15:58,000 --> 00:15:58,000
779
- generated.
780
-
781
- 196
782
- 00:15:59,000 --> 00:16:06,000
783
- As you can see, Zen follows similar pattern, and this is also possible to write the code that will
784
-
785
- 197
786
- 00:16:06,000 --> 00:16:08,000
787
- auto generate classes like this.
788
-
789
- 198
790
- 00:16:09,000 --> 00:16:17,000
791
- Based on our entity's definition in such enterprise, the eCommerce solution as harbors from SAP similar
792
-
793
- 199
794
- 00:16:17,000 --> 00:16:25,000
795
- to generation is already implemented and during the build process, such kind of classes create automatically.
796
-
797
- 200
798
- 00:16:25,000 --> 00:16:33,000
799
- If you have enough time, you can also implement seamless sync because if you followed my job, of course
800
-
801
- 201
802
- 00:16:33,000 --> 00:16:40,000
803
- you already know what your affection is and you know how you can use it to dynamically explore a program
804
-
805
- 202
806
- 00:16:40,000 --> 00:16:40,000
807
- is around that.
808
-
809
- 203
810
- 00:16:42,000 --> 00:16:49,000
811
- The next thing that they did, I created new implementations of services, we have product management
812
-
813
- 204
814
- 00:16:49,000 --> 00:16:56,000
815
- service to products, we have purchase management service to manage purchases and we have user management
816
-
817
- 205
818
- 00:16:56,000 --> 00:16:57,000
819
- service to manage users.
820
-
821
- 206
822
- 00:16:58,000 --> 00:17:00,000
823
- These are existing interfaces.
824
-
825
- 207
826
- 00:17:00,000 --> 00:17:06,000
827
- I just gave them another mutation and created three new services.
828
-
829
- 208
830
- 00:17:07,000 --> 00:17:11,000
831
- ZF, the implementations injected into zone.
832
-
833
- 209
834
- 00:17:12,000 --> 00:17:19,000
835
- Let me open my school user management service here is registered user massive, not just use dot to
836
-
837
- 210
838
- 00:17:19,000 --> 00:17:21,000
839
- save user in the database.
840
-
841
- 211
842
- 00:17:22,000 --> 00:17:26,000
843
- It also returns error message in case something is going wrong.
844
-
845
- 212
846
- 00:17:27,000 --> 00:17:30,000
847
- For example, such emails already registered.
848
-
849
- 213
850
- 00:17:31,000 --> 00:17:36,000
851
- This is also some kind of business logic that couldn't be just moved to the door.
852
-
853
- 214
854
- 00:17:37,000 --> 00:17:38,000
855
- Can you understand that?
856
-
857
- 215
858
- 00:17:39,000 --> 00:17:46,000
859
- And besides that, some of the scenarios that are not implemented here but potentially can be like welcome
860
-
861
- 216
862
- 00:17:46,000 --> 00:17:53,000
863
- email notification or implementation of affiliate program, all this could potentially will be stored
864
-
865
- 217
866
- 00:17:53,000 --> 00:17:56,000
867
- here, but not in the.
868
-
869
- 218
870
- 00:17:57,000 --> 00:18:05,000
871
- That's why I want you scenes on these services, just designated locations to sit down objects and converters,
872
-
873
- 219
874
- 00:18:06,000 --> 00:18:07,000
875
- seek wine.
876
-
877
- 220
878
- 00:18:08,000 --> 00:18:16,000
879
- And the last scenes that we have to do is to inject our services inside our menus, right in our general
880
-
881
- 221
882
- 00:18:16,000 --> 00:18:17,000
883
- course.
884
-
885
- 222
886
- 00:18:17,000 --> 00:18:23,000
887
- I'm going to teach you how to use dependency injection in case we use dependency injection.
888
-
889
- 223
890
- 00:18:23,000 --> 00:18:30,000
891
- It is only a matter of consideration to set what concrete implementation of interface you want to inject
892
-
893
- 224
894
- 00:18:30,000 --> 00:18:31,000
895
- in one or another object.
896
-
897
- 225
898
- 00:18:32,000 --> 00:18:39,000
899
- In our case, we need to make these changes not in the configuration level, but still on the source
900
-
901
- 226
902
- 00:18:39,000 --> 00:18:40,000
903
- code level.
904
-
905
- 227
906
- 00:18:40,000 --> 00:18:48,000
907
- For example, in check out menu, I need to open it and initialize my service was another implementation
908
-
909
- 228
910
- 00:18:48,000 --> 00:18:52,000
911
- of the interface, and I did this for each menu.
912
-
913
- 229
914
- 00:18:53,000 --> 00:18:59,000
915
- After this is done, I can run my app and make sure that everything works as expected.
916
-
917
- 230
918
- 00:19:00,000 --> 00:19:04,000
919
- And by the way, you already know how to work with G-Unit and locate.
920
-
921
- 231
922
- 00:19:05,000 --> 00:19:13,000
923
- So never forget the right this to make sure that you didn't break Arneson hands of Amazon works as expected.
924
-
925
- 232
926
- 00:19:14,000 --> 00:19:20,000
927
- That's so what I wanted to share with you in the media, even in case you still have some questions,
928
-
929
- 233
930
- 00:19:21,000 --> 00:19:28,000
931
- please do not hesitate to -- in comments below this video since selecting for your attention.
932
-
933
- 234
934
- 00:19:29,000 --> 00:19:32,000
935
- Have a great day and see you in the next lesson.
936
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55 - ===== Exam DAO, Database, JDBC, SQL ======/001 Homework-description-and-reference-to-the-solution.url DELETED
@@ -1,2 +0,0 @@
1
- [InternetShortcut]
2
- URL=https://docs.google.com/document/d/1o5Y33LTL-5fild3Uii3qTi-Zmc4u6jN-TuYsSibeQoU/edit?usp=sharing
 
 
 
55 - ===== Exam DAO, Database, JDBC, SQL ======/external-links.txt DELETED
@@ -1,3 +0,0 @@
1
-
2
- 001 Homework-description-and-reference-to-the-solution
3
- https://docs.google.com/document/d/1o5Y33LTL-5fild3Uii3qTi-Zmc4u6jN-TuYsSibeQoU/edit?usp=sharing