aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes What is the benefit of using Interface Injection? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "What is the benefit of using Interface Injection?" Watch "What is the benefit of using Interface Injection?" New topic
Author

What is the benefit of using Interface Injection?

Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
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?


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30543
    
150

It's helpful when you want to inject mock objects for testing.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
wood burning stoves
 
subject: What is the benefit of using Interface Injection?