From: Peter Friese (JIRA) <jira@an...> - 2005-12-21 09:49:41
Add support for Spring FactoryBeans
Project: Spring Cartridge
Reporter: Peter Friese
Assigned to: Peter Friese
Fix For: 3.2-RC1
Usually when you model a dependency on a service, the Spring cartridge creates a setter on the dependant service that receives an instance of the target service. This works out fine as long as the target service is a normal Spring bean. There is, however, something called "FactoryBean" in Spring - see http://www.springframework.org/docs/api/org/springframework/beans/factory/FactoryBean.html. The Spring docs state that "A FactoryBean is defined in a bean style, but the object exposed for bean references is always the object that it creates." This results in type mismatches on the dependency setter.
I suggest to annotate the dependency in order to specify the "real" type of the reference. We could use a tagged value (e.g. @andromda.spring.reference.type).
For a bried discussion on this topic, see the forum: http://galaxy.andromda.org/forum/viewtopic.php?p=8062