Top 5 Reasons Why Constructor Injection is Recommended ? Spring dependency injection | Spring Boot
Selenium Express Selenium Express
107K subscribers
13,085 views
335

 Published On Oct 29, 2023

Top 5 Reasons Why Constructor Injection is Recommended ? Spring dependency injection | Spring Boot

Setter Injection Vs Constructor Injection , One of the top most asked questions in spring boot interview. Here are Top 5 Reasons Why Constructor Injection is Recommended.

When it comes to spring dependency injection, we can achieve it by using Setter Injection, Constructor Injection and Field Injection. Let’s go in-depth

Timestamp
___________

Introduction - 00:00:00
Let’s go start.spring.io - 00:01:55What is dependency injection? - 00:02:57
Why setter injection is not recommend - 00:11:19
Implement Setter Injection and Constructor Injection using Spring Boot - 00:25:35
Setter Injection Vs Constructor Injection- 00:30:21
The infamous null pointer injection - 00:33:38
Immutable objects -00:36:39
Design smell - 00:44:08
Constructor injection for unit testing - 00:49:35
When to choose field injection over constructor injection - 01:00:55

#springbootinterviewquestions #dependencyinjection #springboot #javainterviewquestions

For more free/paid courses visit
https://www.seleniumexpress.com

LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers
   • Java interview questions and answers ...  

Watch my new Hello spring boot series
   • Spring Vs Spring Boot - Why Spring Bo...  

Watch Spring boot Hot topics
   • @Reposicotry Vs @Service | Spring Boo...  

Java Interview / Question and Answer series
   • Java collections interview questions ...  

Explain spring Bean Lifecycle
   • REAL-TIME: Spring Bean life cycle usi...  

spring core
   • Spring framework tutorial for beginne...  

spring mvc
   • Spring MVC course introduction || Und...  

spring mvc intermediate
   • [INTERMEDIATE] Spring MVC Course Prev...  

Spring JDBC
   • Spring JDBC Course Preview || Let’s t...  

spring live project
   • #1 Build and Deploy A Spring Project ...  

SPRING SECURITY COURSE[NEW]
   • Spring Security Course Preview | Lear...  

For more courses visit
https://www.seleniumexpress.com

Any time you are getting stuck with issues, Feel free to ask for support.
You can send mail to [email protected]

you can ping me on my Facebook page
  / seleniumexpress  

Make sure to join my private Facebook page (Ask me here)
“SeleniumExpress - Support"
  / 187000222361579  

you can ask for support in my website forum
https://www.seleniumexpress.com

Subscribe to my youtube channel

   / @seleniumexpress  

Follow me on Insta
  / selenium_express  

show more

Share/Embed