Top 10 Spring Annotations to know in 2024

Поделиться
HTML-код
  • Опубликовано: 3 фев 2025

Комментарии • 129

  • @Java.Brains
    @Java.Brains  Год назад +50

    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.

    • @aamirakhtar3911
      @aamirakhtar3911 Год назад +1

      Thank you so much sir

    • @ChooliYip
      @ChooliYip Год назад

      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?

    • @forinterview2two417
      @forinterview2two417 11 месяцев назад

      i think you will face error @@ChooliYip

  • @shridhar_rao
    @shridhar_rao 11 месяцев назад +29

    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! 🙌🙏💫

  • @asjjain191183
    @asjjain191183 Год назад +7

    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.

    • @ahmedjaad4940
      @ahmedjaad4940 Год назад

      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

  • @tharvik1
    @tharvik1 Год назад +2

    Thanks! Very useful and appreciate the sample code snippets shown for each

    • @Java.Brains
      @Java.Brains  Год назад +1

      Wow thanks! Glad you found it useful ☺️

  • @uchitshah2956
    @uchitshah2956 Месяц назад +1

    Sir, your content is exceptionally clear and straight to the point. Please continue creating more videos to educate us, your teaching style is truly outstanding!

  • @abdulashiq2173
    @abdulashiq2173 9 месяцев назад +7

    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

  • @dejandjordjdevic4527
    @dejandjordjdevic4527 7 месяцев назад +2

    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.

  • @leithold315
    @leithold315 11 месяцев назад +3

    Knew all these, but hearing you explain it solidifies it and fills in gaps in my knowledge. Thanks so much!

  • @ZhiHuiMingDeng1
    @ZhiHuiMingDeng1 2 месяца назад

    Thanks!

  • @lucasteixeira1631
    @lucasteixeira1631 Год назад

    on point!

  • @er.sahilmd
    @er.sahilmd Год назад

    Wow i am so happy to see Koushik being back with some knowledge sharing again

  • @CaliBeast824
    @CaliBeast824 Год назад +1

    Thank you for this video. I need to learn Spring for my job and this was a great starting point.

  • @tanjinpeng279
    @tanjinpeng279 Год назад +2

    Appreciate this tutorial. Is very helpful. Hope to see more Spring boot related video in the future !

  • @pmorah
    @pmorah Год назад +1

    The best teacher ever. Thank you a ton

  • @tharangopal2911
    @tharangopal2911 6 дней назад

    Awesome and explicit as usual

  • @pratibhamaind6258
    @pratibhamaind6258 3 месяца назад

    Great video. The explanation was really good, it helped me understand annotations better. Thank you

  • @Vikashkumar-js8hb
    @Vikashkumar-js8hb Год назад +1

    Another conscise and informational content. Short, crisp and To the point... Keep up the good work. 😃

  • @venkatasandeepgurram9276
    @venkatasandeepgurram9276 Год назад

    Greatly explained koushik . Even though i used all these annotations before i got to know more about them . Thanks for the videos .

  • @funshots6499
    @funshots6499 Год назад +2

    I really like the way you teach, please do spring boot and it’s related videos more often

  • @venkatduvvuru8369
    @venkatduvvuru8369 11 месяцев назад

    I am a fan of you since 2019. Thanks for the valuable content❤

  • @ramonwest3684
    @ramonwest3684 Год назад +1

    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.

  • @beth8able
    @beth8able 11 месяцев назад

    Thank you so much for this video, loved it. It's very useful and concise explanation. Great job!!!

  • @aabhasjain96
    @aabhasjain96 Год назад

    Thank you so much sir, keep posting and sharing your valuable knowledge with us.

  • @virajsh
    @virajsh Год назад +1

    Excellent video. I love how you can express your self so clearly.

  • @tabrezshaikh7705
    @tabrezshaikh7705 Год назад +3

    My excitement level everytime this guy uploads a video 📈📈
    We need more content from you buddy 🤌

  • @mariselvamdheivasigamani578
    @mariselvamdheivasigamani578 Год назад

    explanations on important spring annotations are very clear and useful.

  • @jaime4066
    @jaime4066 Год назад

    Love the quality improvements of the videos!

  • @ShivaKumarSatakuri
    @ShivaKumarSatakuri Год назад +1

    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 RUclips shorts for most used annotations in the spring framework which you couldn't cover in this video.

    • @Java.Brains
      @Java.Brains  Год назад +3

      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.

  • @gowthambhat1498
    @gowthambhat1498 Год назад

    Dhanyavadagalu Gurugale, love from Bengaluru🫀

  • @raamch
    @raamch 10 месяцев назад

    Great video on annotations in Spring. 6:10 great explanation here.

  • @svalyavasvalyava9867
    @svalyavasvalyava9867 Год назад

    Amazing video and a great refresher for me. Thank you infinitely ☺️

  • @prajwaltirpude8582
    @prajwaltirpude8582 10 месяцев назад

    Helpful summary. Ignore the haters as they will always shout at anything

  • @rajkumarvb2602
    @rajkumarvb2602 Год назад +1

    Hi Koushik, thanks a lot for all your contents. Waiting for your updated Spring Boot tutorials/bootcamp! ❤

  • @DrSeanKennedy-k2b
    @DrSeanKennedy-k2b 8 месяцев назад

    Great video - thanks for making it!

  • @ArjunKumar-zu2kl
    @ArjunKumar-zu2kl 11 месяцев назад

    Very nice explanation, thanks for this video....👍👍

  • @rgablejr
    @rgablejr Год назад +1

    Great overview!

  • @fenixisalive
    @fenixisalive Год назад

    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.

  • @robertwhite3503
    @robertwhite3503 Год назад +18

    I never use @Autowired. If you use the consructor to wire up variables, those variables are automatically wired.

    • @cool-aquarian
      @cool-aquarian Год назад

      🙏

    • @Java.Brains
      @Java.Brains  Год назад +4

      Yes, I have a pinned comment to clarify. Thanks for your comment!

    • @tschalky
      @tschalky Год назад

      And use the annotation for constructor injection if possible

  • @yoursownarts
    @yoursownarts 7 месяцев назад

    Good Explanation!! 👏🏼

  • @uniquestreetfood8391
    @uniquestreetfood8391 9 месяцев назад

    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

  • @abhishekkumarroy2815
    @abhishekkumarroy2815 Год назад +1

    always wait for your video😍😍

  • @SerTony16
    @SerTony16 11 месяцев назад

    Love this channel

  • @sharmarahul17
    @sharmarahul17 Год назад

    Excellent video! Thanks

  • @hyperborean72
    @hyperborean72 10 месяцев назад

    awesome as always

  • @alamaiii
    @alamaiii Год назад

    THANK YOU FOR THE CLEAR AND CONCISE EXPLANATION!!!

  • @pankajarora5514
    @pankajarora5514 Год назад

    Always waiting for a next vedio.thanku fo suc a content

  • @RobertPodosek
    @RobertPodosek Год назад

    Koushik is the man

  • @botane7538
    @botane7538 Год назад

    Thank you for the video

  • @ahmedyoussef7923
    @ahmedyoussef7923 5 месяцев назад

    Very useful
    Thank you

  • @PR-nb4rb
    @PR-nb4rb Год назад +1

    Awesome work 😍

  • @ismailarifm5041
    @ismailarifm5041 7 месяцев назад

    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.

  • @10SURA
    @10SURA Год назад +2

    Very informative! can you please also touch upon the below annotations ?
    1.@Profile
    2.@ControllerAdvice
    3.@Required

    • @JamesStansell
      @JamesStansell Год назад +1

      @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.

  • @aravindk4608
    @aravindk4608 11 месяцев назад

    What about using only configuration classes to create beans vs using annotations to register the beans. What are the pros and cons?

  • @sami_yanezcarbonell
    @sami_yanezcarbonell Год назад

    very usefull ! thank you

  • @leithold315
    @leithold315 11 месяцев назад

    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.

  • @shashankdesai819
    @shashankdesai819 Год назад

    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

  • @victorlangat856
    @victorlangat856 Год назад

    A good explanation.

  • @aamirakhtar3911
    @aamirakhtar3911 Год назад

    Wonderful video. Superb explanation

  • @apurvachatterji5852
    @apurvachatterji5852 20 дней назад

    One Notable info on Autowired, Spring will not automatically create a bean for a class that is not annotated with any Spring stereotype annotation (like @Component, @Service, @Repository, etc.) or explicitly defined in the Spring configuration (via @Bean or XML configuration). As a result, if you try to @Autowired such a class, Spring will throw an error indicating that it cannot find a bean of that type. In order to use the full flavor of Autowired that class has to be a bean of any time

  • @anadivyas4841
    @anadivyas4841 Год назад

    Thank you for this informative video

  • @danieljoseph1122
    @danieljoseph1122 Год назад

    Thank u sir

  • @mils3318
    @mils3318 Год назад +1

    Is there anything related to the continuation of the started JavaBrains bootcamp?

    • @Java.Brains
      @Java.Brains  Год назад +2

      Yes! I have Spring Core coming in a week. I'm working on an updated Spring Boot course after that.

    • @mils3318
      @mils3318 Год назад

      @@Java.Brains Ok, thank you very much Koushik !

  • @yourAI-Buddy
    @yourAI-Buddy 2 месяца назад

    @Transactional is crazy man

  • @alanmangroo3656
    @alanmangroo3656 Год назад

    Great video!

  • @LizaSachdev
    @LizaSachdev 7 месяцев назад

    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

  • @tyler13923
    @tyler13923 10 месяцев назад

    excellent

  • @rajatpandey4979
    @rajatpandey4979 Год назад

    Excellent content

  • @iam_kundan
    @iam_kundan Год назад

    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.

  • @vigneshj.m.7969
    @vigneshj.m.7969 Год назад

    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

    • @lucasteixeira1631
      @lucasteixeira1631 Год назад +1

      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.

  • @thecreativelife7795
    @thecreativelife7795 Год назад +6

    It's better to remove the background music as it disturbs.

    • @abhaykumar-cd5gu
      @abhaykumar-cd5gu 3 месяца назад

      The music is highly distracting from listening to content

  • @devrajatverma
    @devrajatverma 2 месяца назад

    25:45 this truck starting sound in background music is very annoying

  • @ahmedmk534
    @ahmedmk534 11 месяцев назад

    isnt Autowired deprecated ?

  • @exploreraadi9376
    @exploreraadi9376 Год назад

    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.

  • @MutantBikers
    @MutantBikers Год назад

    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.

    • @Java.Brains
      @Java.Brains  Год назад +2

      Everything looks good to me. Can you please check again?

    • @MutantBikers
      @MutantBikers Год назад

      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 😐

    • @Java.Brains
      @Java.Brains  Год назад

      All good ☺️ Glad it's working fine now

  • @pushpendranamdev8920
    @pushpendranamdev8920 Год назад

    Why have you added this background music, it's not required in your videos sir. You are already awesome 👍

  • @basavaraj2065
    @basavaraj2065 Год назад

    Could you please check if Quarkas is gaining attention and consider starting a series on the same please 😀👍

    • @Java.Brains
      @Java.Brains  Год назад

      Quarkus is a good alternative. But Spring Boot is pretty much monopolizing the Java backend space tbh

    • @amitpadgaonkar8830
      @amitpadgaonkar8830 Год назад

      Quarkus would fade away as Spring native becomes mature

  • @DasariPrasad-jy3yz
    @DasariPrasad-jy3yz Год назад

    Could please make one Real time project by using spring boot.

    • @Java.Brains
      @Java.Brains  Год назад

      I have a couple of playlists "Code With Me" series already. I will plan to make more!

  • @hkkabir2024
    @hkkabir2024 2 месяца назад

    sorry to say insion of spring there is no required to user @Repository anymore

  • @JPBelanger
    @JPBelanger Год назад

    Seems to me that having the application tell spring about itself breaks encapsulation.

    • @Java.Brains
      @Java.Brains  Год назад

      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.

    • @JPBelanger
      @JPBelanger Год назад

      @@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.

  • @thesilentkiller3882
    @thesilentkiller3882 Год назад +1

    @Autowired is recommended as not be used

    • @Java.Brains
      @Java.Brains  Год назад

      Yes, I have a pinned comment to clarify. Thanks for your comment!

  • @rakhi4549
    @rakhi4549 4 месяца назад

    Background music is disturbing

  • @devrajatverma
    @devrajatverma 2 месяца назад

    20:29 🤣

  • @prasantsaurabh4086
    @prasantsaurabh4086 Год назад

    He looks like satya nadella a bit except the hair

  • @binaramani3249
    @binaramani3249 11 месяцев назад

    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.

  • @Ambesh171
    @Ambesh171 Год назад

    every imp annotations is cover

  • @nooruddinraotiwala353
    @nooruddinraotiwala353 Год назад +2

    dont add the background music not useful!

    • @cv462-l4x
      @cv462-l4x Год назад

      For me it's more easy to understand with light music. So it's not the same for everybody)