Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Aliasing in Spring  RSS feed

 
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
Sheriff
Posts: 36406
454
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
Boost this thread!