A note on @Autowired since this is coming up a lot. Yes, constructor injection (and NOT using annotation-based wiring) is the recommended approach if it works for you. But @Autowired is still an important annotation to learn about because of two things - First, it gives you more control with things like qualifiers in scenarios where construction injection doesn't work. Second, there is a good chance you WILL see it in the code and you should know what it does.
Very well presenting for these annotations. One quick question. If I use @Autowired on the field of a class while it has construtor with this field to be injected the value, does spring inject value twice to the field?
I have around 10 years of experience in The IT Industry - mostly as a Software Web Developer. Many years ago - I guess around 2010 or 2011 approx. - I decided to learn Spring Framework. And yours was the first channel I subscribed to and watched ALL of your videos on Spring framework. You introduced me to the world of Spring Framework, And I will always be thankful to you for that! I still follow your channel - mainly to revise my concepts. Thank you for the awesome work you have been doing since more than a decade! 🙌🙏💫
I've been here for along time as well, I think I found him when I was a student around the same time, I still have his spring playlist videos on my machine.he is a great teacher indeed
Great to have all these most important spring annotations in one video perfectly precise and concisely explained. Thank you for all your efforts and videos. All are just great.
Quality content, as usual. Here are a few annotations in my opinion that could be frequently used: @Qualifier - Specifies the bean to be injected when multiple beans of the same type are present @Primary - Indicates that a bean should be given precedence when multiple beans of the same type are present @EnableCaching - Enables Spring's annotation-driven caching capability (Application.java) @Cacheable - Indicates that a method's result should be cached @EnableAsync - Enables Spring's asynchronous method execution capability (Application.java) @Async - Indicates that a method should be executed asynchronously @Scheduled - Specifies methods to be executed on a regular schedule for cron jobs
@Profile marks a bean conditional on the value of the spring.profiles.active property. Use it sparingly because it can make it difficult to reason about the behaviour of your application in different scenarios. In particular do not scatter it throughout your entire codebase.
Wow this is great. This is what I was telling you last week. Thank you so much for getting this done. Please do consider doing TH-cam shorts for most used annotations in the spring framework which you couldn't cover in this video.
Very Useful. Please upload videos for Spring 3.0 and above. Spring security also has lot of changes. So something with all of them will be very helpful
Can you do a similar video for Spring Batch please? There’s a lot of confusion about what the annotations especially with the differences between Springbatch 5 and previous versions.
And one more point I would like to highlight about @Bean annotation is that it is used to create a bean of a class which is part of a library/jar. And you don't have control over the source code of the class of that library/jar file. In case of having control over the source code (your code), definitely you would go for @Component / any other stereotype annotations. And highlighting a point about @Autowired annotations, it can be used at both field level and at constructor level. The key difference between these two usages is that: 1) if it is used at field level of a bean, then the partial injection of the fields of the bean is allowed. 2) if it is used at constructor level, then all the fields of a bean can be used as the parameters of the constructor of the bean. Thus, mandating the requirement of all the fields(that needs to be created before hand) for the creation of bean containing those fields.
Thanks, the list was well synthesized and very well explained. The autowired one is still relevant despite the comments bellow, if you are only a spring entry level user sure it has no use, but if you want to create some things out of the box in runtime is still very appreciated.
Great Video.. I have one question.. we can use @Bean annotation in @configuration and @component class... basically is there any difference in use them in configuration and component. Could you please explain with example it would be really useful
it is more like stereotyping the class, same as using @Service and @Repository instead of only @Component, in order to tell us which is which, you know? So you could use @Component in a config file, but if you use @Configuration, you're also telling the ones who read the code, that is it a config file.
It is really very informative video. Thanks for the video. Just a suggestion please don't add the background music, it distracts from the content audio.
As everyone appreciating content is very good, But audio & video are not synced...However quality is 720p but audio & video should be in a sync. Thanks for listening.
Can anybody help me in this - I created a configuration with @bean method for SoftAssert , now when Iuse it in Step definition, it adds up all the exceptions in method 1 , 2, 3 . I think I should destroy this bean method and reinsitatte it again in each method .How to do that
@@Java.Brains you application still has a dependency to spring. Wiring should happen in @Configuration classes, that encapsulate the wiring. Spring does not promote this, but it's the right way to do it.
Hotshot you are not as good as you think in Spring. There is no difference in @Service and @Component so far. Though it can be useful for pointcuts and tools. There are addtional properties for @Controller and @Repository. When Spring sees these 2 annotations then it do extra processing which is not done for @Service.
A note on @Autowired since this is coming up a lot. Yes, constructor injection (and NOT using annotation-based wiring) is the recommended approach if it works for you.
But @Autowired is still an important annotation to learn about because of two things - First, it gives you more control with things like qualifiers in scenarios where construction injection doesn't work. Second, there is a good chance you WILL see it in the code and you should know what it does.
Thank you so much sir
Very well presenting for these annotations. One quick question. If I use @Autowired on the field of a class while it has construtor with this field to be injected the value, does spring inject value twice to the field?
i think you will face error @@ChooliYip
I have around 10 years of experience in The IT Industry - mostly as a Software Web Developer. Many years ago - I guess around 2010 or 2011 approx. - I decided to learn Spring Framework. And yours was the first channel I subscribed to and watched ALL of your videos on Spring framework. You introduced me to the world of Spring Framework, And I will always be thankful to you for that! I still follow your channel - mainly to revise my concepts. Thank you for the awesome work you have been doing since more than a decade! 🙌🙏💫
True.. ❤
I leart the spring from you long back in 2011. You have been the only teacher for me for a long time. I love you.
I've been here for along time as well, I think I found him when I was a student around the same time, I still have his spring playlist videos on my machine.he is a great teacher indeed
Thanks! Very useful and appreciate the sample code snippets shown for each
Wow thanks! Glad you found it useful ☺️
Great to have all these most important spring annotations in one video perfectly precise and concisely explained. Thank you for all your efforts and videos. All are just great.
Quality content, as usual. Here are a few annotations in my opinion that could be frequently used:
@Qualifier - Specifies the bean to be injected when multiple beans of the same type are present
@Primary - Indicates that a bean should be given precedence when multiple beans of the same type are present
@EnableCaching - Enables Spring's annotation-driven caching capability (Application.java)
@Cacheable - Indicates that a method's result should be cached
@EnableAsync - Enables Spring's asynchronous method execution capability (Application.java)
@Async - Indicates that a method should be executed asynchronously
@Scheduled - Specifies methods to be executed on a regular schedule for cron jobs
Knew all these, but hearing you explain it solidifies it and fills in gaps in my knowledge. Thanks so much!
Thanks!
on point!
Thank you! 😊
Wow i am so happy to see Koushik being back with some knowledge sharing again
I never use @Autowired. If you use the consructor to wire up variables, those variables are automatically wired.
🙏
Yes, I have a pinned comment to clarify. Thanks for your comment!
And use the annotation for constructor injection if possible
Thank you for this video. I need to learn Spring for my job and this was a great starting point.
The best teacher ever. Thank you a ton
Appreciate this tutorial. Is very helpful. Hope to see more Spring boot related video in the future !
I really like the way you teach, please do spring boot and it’s related videos more often
Yup, thanks!
Very informative! can you please also touch upon the below annotations ?
1.@Profile
2.@ControllerAdvice
3.@Required
@Profile marks a bean conditional on the value of the spring.profiles.active property. Use it sparingly because it can make it difficult to reason about the behaviour of your application in different scenarios. In particular do not scatter it throughout your entire codebase.
Dhanyavadagalu Gurugale, love from Bengaluru🫀
Great video. The explanation was really good, it helped me understand annotations better. Thank you
Another conscise and informational content. Short, crisp and To the point... Keep up the good work. 😃
Wow this is great. This is what I was telling you last week. Thank you so much for getting this done. Please do consider doing TH-cam shorts for most used annotations in the spring framework which you couldn't cover in this video.
Great minds think alike! 😉 Like I said, I had this in the works. Your shorts idea is great btw. I will try to plan something.
Greatly explained koushik . Even though i used all these annotations before i got to know more about them . Thanks for the videos .
Great video on annotations in Spring. 6:10 great explanation here.
My excitement level everytime this guy uploads a video 📈📈
We need more content from you buddy 🤌
More to come! Thanks! ☺️
Helpful summary. Ignore the haters as they will always shout at anything
Very Useful. Please upload videos for Spring 3.0 and above. Spring security also has lot of changes. So something with all of them will be very helpful
explanations on important spring annotations are very clear and useful.
Great video! I’m back in the job market and taking time to audit my knowledge base, this was very affirming and helped clarify a few unknowns.
Glad it was helpful!
Love the quality improvements of the videos!
Hi Koushik, thanks a lot for all your contents. Waiting for your updated Spring Boot tutorials/bootcamp! ❤
Will upload soon
Can you do a similar video for Spring Batch please? There’s a lot of confusion about what the annotations especially with the differences between Springbatch 5 and previous versions.
And one more point I would like to highlight about @Bean annotation is that it is used to create a bean of a class which is part of a library/jar. And you don't have control over the source code of the class of that library/jar file. In case of having control over the source code (your code), definitely you would go for @Component / any other stereotype annotations.
And highlighting a point about @Autowired annotations, it can be used at both field level and at constructor level. The key difference between these two usages is that: 1) if it is used at field level of a bean, then the partial injection of the fields of the bean is allowed. 2) if it is used at constructor level, then all the fields of a bean can be used as the parameters of the constructor of the bean. Thus, mandating the requirement of all the fields(that needs to be created before hand) for the creation of bean containing those fields.
Excellent video. I love how you can express your self so clearly.
Glad you enjoyed it!
Great overview!
I am a fan of you since 2019. Thanks for the valuable content❤
What about using only configuration classes to create beans vs using annotations to register the beans. What are the pros and cons?
Thank you so much for this video, loved it. It's very useful and concise explanation. Great job!!!
Koushik is the man
Thank you so much sir, keep posting and sharing your valuable knowledge with us.
always wait for your video😍😍
Thank you so much 😀
Is there anything related to the continuation of the started JavaBrains bootcamp?
Yes! I have Spring Core coming in a week. I'm working on an updated Spring Boot course after that.
@@Java.Brains Ok, thank you very much Koushik !
Great video - thanks for making it!
Good Explanation!! 👏🏼
Very nice explanation, thanks for this video....👍👍
Very useful
Thank you
THANK YOU FOR THE CLEAR AND CONCISE EXPLANATION!!!
Glad it was helpful!
Thanks, the list was well synthesized and very well explained. The autowired one is still relevant despite the comments bellow, if you are only a spring entry level user sure it has no use, but if you want to create some things out of the box in runtime is still very appreciated.
Excellent video! Thanks
Thank you for the video
Awesome work 😍
Thank you! Cheers!
Amazing video and a great refresher for me. Thank you infinitely ☺️
Nice video. It would be nice if you can come up with important annotations for each project such as spring security, spring data jpa etc
Love this channel
awesome as always
Always waiting for a next vedio.thanku fo suc a content
More to come!
very usefull ! thank you
Great Video.. I have one question.. we can use @Bean annotation in @configuration and @component class... basically is there any difference in use them in configuration and component. Could you please explain with example it would be really useful
it is more like stereotyping the class, same as using @Service and @Repository instead of only @Component, in order to tell us which is which, you know? So you could use @Component in a config file, but if you use @Configuration, you're also telling the ones who read the code, that is it a config file.
A good explanation.
Wonderful video. Superb explanation
Glad it was helpful!
It is really very informative video. Thanks for the video. Just a suggestion please don't add the background music, it distracts from the content audio.
@Transactional is crazy man
25:45 this truck starting sound in background music is very annoying
It's better to remove the background music as it disturbs.
The music is highly distracting from listening to content
Thank you for this informative video
Glad it was helpful!
As everyone appreciating content is very good, But audio & video are not synced...However quality is 720p but audio & video should be in a sync. Thanks for listening.
Everything looks good to me. Can you please check again?
Sorry It was my Bluetooth headphones I was wearing. Because of that I felt that lag.....Now without that it's perfectly synced. Really sorry 😐
All good ☺️ Glad it's working fine now
Thank u sir
Great video!
Glad you enjoyed it
Great video sir, but one request , if it's possible then do not add background music in videos , your voice doesn't seems clear some time.
Can anybody help me in this - I created a configuration with @bean method for SoftAssert , now when Iuse it in Step definition, it adds up all the exceptions in method 1 , 2, 3 . I think I should destroy this bean method and reinsitatte it again in each method .How to do that
Excellent content
Glad you enjoyed it
Could you please check if Quarkas is gaining attention and consider starting a series on the same please 😀👍
Quarkus is a good alternative. But Spring Boot is pretty much monopolizing the Java backend space tbh
Quarkus would fade away as Spring native becomes mature
isnt Autowired deprecated ?
Why have you added this background music, it's not required in your videos sir. You are already awesome 👍
Could please make one Real time project by using spring boot.
I have a couple of playlists "Code With Me" series already. I will plan to make more!
excellent
sorry to say insion of spring there is no required to user @Repository anymore
@Autowired is recommended as not be used
Yes, I have a pinned comment to clarify. Thanks for your comment!
Seems to me that having the application tell spring about itself breaks encapsulation.
Not so much with an annotation. Annotations are like "tags" or markers. It's not ideal but it's still way better than a compile time dependency.
@@Java.Brains you application still has a dependency to spring. Wiring should happen in @Configuration classes, that encapsulate the wiring.
Spring does not promote this, but it's the right way to do it.
20:29 🤣
Background music is disturbing
every imp annotations is cover
Hotshot you are not as good as you think in Spring. There is no difference in @Service and @Component so far. Though it can be useful for pointcuts and tools. There are addtional properties for @Controller and @Repository. When Spring sees these 2 annotations then it do extra processing which is not done for @Service.
He looks like satya nadella a bit except the hair
dont add the background music not useful!
For me it's more easy to understand with light music. So it's not the same for everybody)