Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the benefit of using Interface Injection?  RSS feed

 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't quite understand what is the benefit of using Interface Injection. It looks similar to Setter Injection but requires implementing an interface.
In which circumstance that we should use Interface Injection rather than Setter Injection?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37242
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's helpful when you want to inject mock objects for testing.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!