Constructor vs Setter dependency Injection in Spring

Tutorials Shared by the Internet Community

Advertisements


Synopsis

Spring framework uses Dependency Injection and inversion of control design principle to manage objects Now to inject dependency it primarily uses Cons

Statistics

  • Total Hits - 19288

  • Total Votes - 108 votes

  • Vote Up - 48 votes

  • Vote Down - 60 votes

  • Domain - javarevisited.blogspot.com

  • Category - JAVA/Spring

  • Submitted By - Javin Paul

  • Submitted on - 2013-05-31 13:35:20

Description

Spring framework uses Dependency Injection and inversion of control design principle to manage objects Now to inject dependency it primarily uses Constructor Injection and Setter injection. This article explains what is constructor and setter injection, difference between Constructor vs Setter injection, and When to use them in spring based Java project. ...


Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements