WEBVTT

1
00:00.590 --> 00:02.210
Hi everyone.

2
00:02.900 --> 00:04.730
Let's go to.

3
00:04.760 --> 00:09.950
The next concept of Nest.js will be the provider.

4
00:10.880 --> 00:15.020
Okay, now you can see, you can read a little bit right here.

5
00:16.970 --> 00:21.950
Now you can notice something like this class.

6
00:21.950 --> 00:26.930
May be treated as a "provider" okay.

7
00:26.960 --> 00:28.700
Now what is the "class"?

8
00:29.930 --> 00:33.290
Class is just a service repository.

9
00:33.320 --> 00:33.920
Okay.

10
00:33.920 --> 00:39.560
We already teach you in a previous video, right.

11
00:39.830 --> 00:47.450
The service and repository is just the class or factories or helper and so on.

12
00:47.870 --> 00:48.470
Okay.

13
00:49.580 --> 00:56.060
Difference type class right here can be treated as a provider.

14
00:56.960 --> 01:01.400
And now what is the provider?.

15
01:02.660 --> 01:06.710
We don't have any idea about that, right? now.

16
01:06.710 --> 01:16.430
You can see the main idea of a provider is it can be injected as a dependency.

17
01:16.460 --> 01:18.290
Now focus on this line.

18
01:18.320 --> 01:21.710
Inject as a dependency.

19
01:23.900 --> 01:25.940
What is a inject?

20
01:26.150 --> 01:28.460
What is a dependency?

21
01:30.410 --> 01:34.400
And that's for the video.

22
01:34.820 --> 01:45.350
If you read about the concept right here, if you are a beginner, you do not understand everything,

23
01:45.350 --> 01:45.980
right?

24
01:46.610 --> 01:51.980
Because you can see what is inject and what is the dependency.

25
01:52.940 --> 02:00.050
And for that reason before understand what is the provider.

26
02:00.260 --> 02:09.500
Firstly, make sure you understand the something called dependency injection, okay, dependency injection.

27
02:09.830 --> 02:17.510
And actually it's a little bit tricky for beginner to understand what is the Dependency injection.

28
02:19.370 --> 02:19.940
The reason?

29
02:19.940 --> 02:24.170
Because before  learning a dependency injection.

30
02:24.200 --> 02:30.410
We must understand what is the inversion of control okay.

31
02:31.220 --> 02:38.510
And what is the tightly coupled and loosely coupled okay.

32
02:39.530 --> 02:44.720
Well, let me tell you what is the inversion of control.

33
02:45.770 --> 02:49.160
The inversion of control as a name suggest

34
02:49.190 --> 02:53.960
It will invert the some kind of control.

35
02:54.050 --> 02:55.640
Now for example.

36
02:57.830 --> 03:12.710
If you buy a car and you drive a car, it means you control a car, right?

37
03:13.400 --> 03:18.530
And with the inversion of control, we must invert the control.

38
03:20.000 --> 03:27.350
Right now, we cannot directly drive a car anymore.

39
03:27.380 --> 03:33.020
Instead of we will hire a some driver and a driver.

40
03:33.020 --> 03:37.370
It will control your cars, right?

41
03:40.430 --> 03:44.120
So that's the idea of inversion of control.

42
03:45.620 --> 03:57.080
And the reason inversion of control exist, it will achieve something called "loosely coupled".

43
03:58.280 --> 04:03.050
I will discuss about what is the tightly coupled and loosely coupled

44
04:05.660 --> 04:16.190
Now the whole purpose of inversion of control, it will it will remove the tightly coupled and achieve the

45
04:16.190 --> 04:17.420
loosely coupled 

46
04:18.170 --> 04:21.710
And this is the problem right now.

47
04:21.740 --> 04:23.510
What is a tightly coupled?

48
04:25.820 --> 04:32.510
And I will see you in the next video to understand what is it tightly coupled and loosely coupled 