• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is the benefit of using Interface Injection?  RSS feed

 
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?
 
author & internet detective
Marshal
Posts: 38391
650
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.
 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!