Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • 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: 38151
617
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!