|
From: Colin S. <col...@ex...> - 2005-04-09 15:09:35
|
This is great! (I'm ashamed to say I promised almost a year ago to do an alias tag and never got around to it). This is really going to help people doing (lightweight) component style programming with Spring. I've posted a blog entry about it: http://blog.exis.com/colin/archives/2005/04/09/alias-tag-in-spring-helps-achieve-lightweight-component-style-assembly-of-beans/ -- Colin Sampaleanu Interface21 Principal Consultant Spring Training, Consulting and Support - "From the Source" http://www.springframework.com Juergen Hoeller wrote: >I've just added an <alias> tag for XML bean definitions. For example: > > <alias name="myBean" alias="myAlias"/> > >This allows to define aliases separate from the original bean definition, >for example to link in a bean from some other file under a different name. >See http://opensource.atlassian.com/projects/spring/browse/SPR-554. > >We've already had a BeanReferenceFactoryBean that could achieve this, but >the <alias> tag is a much nicer syntax. > >One use case where this can be used within the framework is the >SingletonBeanFactoryLocator: Instead of defining an alias for another >factory through a "java.lang.String" definition there, you can simply define >an <alias> tag now. > > >BTW, to remove a circular root package dependency between "beans" and >"jndi", I've recently removed JndiBeanFactoryLocator without replacement. >ContextJndiBeanFactoryLocator in the "context" package still exists and is >the only one that's actually used anyway. The "context" package is allowed >to depend on "jndi", but the "beans" package isn't. > >Effectively, the BeanFactoryLocator mechanism will usually only be used for >ApplicationContexts anyway, in particular since we default to full contexts >for our EJB support classes. Hence, the relevant implementations are the >ones in the "context.access" package, even if the interfaces and some base >implementations reside in "beans.factory.access". > > >Juergen > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |