File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the benefit of using Interface Injection?

 
Hong Anderson
Ranch Hand
Posts: 1936
  • 0
  • 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
Marshal
Posts: 33671
316
Eclipse IDE Java VI Editor
  • 0
  • 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