Ugo Cei wrote:
Sylvain Wallez wrote:
Makes me think: does Spring has the concept of "default component"? i.e. a bean that will be injected for dependencies of a given type that aren't explicitely written in the configuration file.
<bean name="parser" default-impl-of="org.apache.excalibur.xml.Parser" class="..."/>
3.3.4. Autowiring collaborators
"Spring has autowire capabilities, which means it's possible to automatically let Spring resolve collaborators (other beans) for your bean by inspecting the BeanFactory/ApplicationContext. The autowiring functionality has four modes. Autowiring is specified per bean and can thus be enabled for some beans, while other beans won't be autowired. Using autowiring, it is possible to reduce or eliminate the need to specify properties or constructor arguments." [1]
Might be pertinent, but I don't know, I need to study it further.
The "byType" autowiring is more or less what I was talking about, but requires the wiring to become explicit as soon as more than one implementation exist in the system, which actually makes it less useful.
[1] http://www.springframework.org/docs/reference/beans.html#beans-factory-autowire
They have an impressive doc!
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
