• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Aliasing in Spring

 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the advantage of aliasing beans in spring?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34073
335
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One reason I can think of is if you are reusing different jars/components and they require different names. For example, suppose on needs a "abcDatasource" and the other needs a "defDataSource." You want to refer to the same bean and only declare it once. Aliasing solves this problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic