Hi everyone.
Let's go to.
The next concept of Nest.js will be the provider.
Okay, now you can see, you can read a little bit right here.
Now you can notice something like this class.
May be treated as a "provider" okay.
Now what is the "class"?
Class is just a service repository.
Okay.
We already teach you in a previous video, right.
The service and repository is just the class or factories or helper and so on.
Okay.
Difference type class right here can be treated as a provider.
And now what is the provider?.
We don't have any idea about that, right? now.
You can see the main idea of a provider is it can be injected as a dependency.
Now focus on this line.
Inject as a dependency.
What is a inject?
What is a dependency?
And that's for the video.
If you read about the concept right here, if you are a beginner, you do not understand everything,
right?
Because you can see what is inject and what is the dependency.
And for that reason before understand what is the provider.
Firstly, make sure you understand the something called dependency injection, okay, dependency injection.
And actually it's a little bit tricky for beginner to understand what is the Dependency injection.
The reason?
Because before learning a dependency injection.
We must understand what is the inversion of control okay.
And what is the tightly coupled and loosely coupled okay.
Well, let me tell you what is the inversion of control.
The inversion of control as a name suggest
It will invert the some kind of control.
Now for example.
If you buy a car and you drive a car, it means you control a car, right?
And with the inversion of control, we must invert the control.
Right now, we cannot directly drive a car anymore.
Instead of we will hire a some driver and a driver.
It will control your cars, right?
So that's the idea of inversion of control.
And the reason inversion of control exist, it will achieve something called "loosely coupled".
I will discuss about what is the tightly coupled and loosely coupled
Now the whole purpose of inversion of control, it will it will remove the tightly coupled and achieve the
loosely coupled
And this is the problem right now.
What is a tightly coupled?
And I will see you in the next video to understand what is it tightly coupled and loosely coupled