Which is better setter or constructor injection?
Answer / Nikunj Kumar
Neither setter nor constructor injection is inherently better. The choice depends on the specific needs of the application and design preferences. Setter injection allows for easier configuration but can lead to looser coupling, while constructor injection promotes stronger coupling but enforces dependencies at object creation.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the concept of dao? : Spring Boot
Is spring boot a microservice framework? : Spring Boot
How do you define the scope of a bean?
What are the different types of annotations in spring?
What is @qualifier annotation in spring?
What are the different components of a spring application?
What is pointcut in spring?
What is a framework in it?
What is difference between hibernate and spring?
What is difference between bean and pojo?
Is singleton thread safe in spring?
Explain the spring mvc framework.