Solved

interface injection

Posted on 2011-09-06
3
418 Views
Last Modified: 2012-05-12
I would like to know interface injection. I was reading as
Interface Injection-- Injection is done through an interface which is not supported in spring. I am not clear on this concept. why spring does not support it. what are the advantages, disadvantages, uses of it. when where how we use it. thanks in advance
0
Comment
Question by:gudii9
3 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 250 total points
ID: 36493476
read about interface inection in general here:
http://blogs.oracle.com/jrose/entry/interface_injection_in_the_vm


and as it realtes to Spring here:

http://namanmehta.blogspot.com/2010/01/interface.html
0
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 250 total points
ID: 36493480
0
 
LVL 7

Author Comment

by:gudii9
ID: 36589829

>>>There are three types of Dependency Injections.

Type 1 IOC also called Interface Injection In Type 1 IOC the injection is done though an interface. The interface will define the injection method and the implementation class has to implement this interface and provide concrete implementation for the injection method.
Type 2 IOC also called Setter Injection In Type 2 IOC the injection is done via a setter method. Type 2 IOC uses setter methods to get the dependent classes it needs.
Type 3 IOC also called Constructor Injection. In Type 3 IOC implementing class defines a constructor to get all its dependents. The dependent classes are defined in the constructor arguments.





are they only 3 tyoes. I remember reading more than 3. please advise
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
firstswap challenge 20 77
split string containing \r\n in Java 46 44
session migration servlets 2 36
reverse digits of a number using for loop 5 41
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to implement Singleton Design Pattern in Java.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question