Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface injection in Spring

 
Manikandan Swaminathan
Ranch Hand
Posts: 117
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am new to Spring.

Can anyone of you please explain Interface Injection in Spring with a simple example?

Or is there any tutorial available for this?

I searched, but unable to find for interface injection in particular.

Have a great weekend !

Thanks
 
Eduardo Bueno
Ranch Hand
Posts: 155
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A simple example:


And now you just need a reference of the SomeRepository interface which will be injected (by type, since SomeRepositoryImpl implements SomeRepository) via setter method:
 
Hong Anderson
Ranch Hand
Posts: 1936
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring doesn't support Interface injection and the above example about autowiring is incorrect.
Will reply more later.
 
Manikandan Swaminathan
Ranch Hand
Posts: 117
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kengkaj,

Can you please post the details?

If possible please mail me the details. My mail id is graghuu@gmail.com

Thanks for your help !

Regards
 
Jaydeep Mazumdar
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring does not fully support Interface injection although the same can be achieved using "autowire=byType". But this has some serious drawbacks. See this discussion for a proposed implementation of Interace injection in Spring:
http://opensource.atlassian.com/confluence/spring/display/DISC/Adding+Interface+Injection+to+Spring
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic