filmov
tv
Important Interview Question of Spring annotation : @Component, @Controller, @Repository & @Service
![preview_player](https://i.ytimg.com/vi/zJBfC96EYd8/maxresdefault.jpg)
Показать описание
#Component #Controller #Repository #Service
► SUBSCRIBE & LIKE!!
► Important Information and code guide available bottom of the Description section
► Download the sample java microservice application :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
► Here is our amazing playlist for Core Java, Spring MVC/Boot, Git and Microservice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Watch my "Most Watched Videos"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From Spring 2.5 annotation-based dependency injection was introduced, which automatically scans and registers classes as Spring bean which is annotated using @Component annotation.
This means you don't declare that bean using the bean tag and inject the dependency, it will be done automatically by Spring. This functionality was enabled and disabled using context:component-scan tag.
Now that you know what does @Component annotation does let's see what does @Service, @Controller, and @Repository annotation do.
They are nothing but the specialized form of @Component annotation for certain situations. Instead of using @Component on a controller class in Spring MVC, we use @Controller, which is more readable and appropriate.
Instagram: techtalk_debu
if you like my video, please subscribe to my channel and share the video
Thanks & Regards,
Debu Paul
► SUBSCRIBE & LIKE!!
► Important Information and code guide available bottom of the Description section
► Download the sample java microservice application :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
► Here is our amazing playlist for Core Java, Spring MVC/Boot, Git and Microservice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Watch my "Most Watched Videos"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From Spring 2.5 annotation-based dependency injection was introduced, which automatically scans and registers classes as Spring bean which is annotated using @Component annotation.
This means you don't declare that bean using the bean tag and inject the dependency, it will be done automatically by Spring. This functionality was enabled and disabled using context:component-scan tag.
Now that you know what does @Component annotation does let's see what does @Service, @Controller, and @Repository annotation do.
They are nothing but the specialized form of @Component annotation for certain situations. Instead of using @Component on a controller class in Spring MVC, we use @Controller, which is more readable and appropriate.
Instagram: techtalk_debu
if you like my video, please subscribe to my channel and share the video
Thanks & Regards,
Debu Paul
Комментарии