autowire byType vs byName
Posted on 2011-05-04
I was reading folowing lines and I did not understand clearly.
By using byName autowiring, you are telling the container to consider all properties
of the CourseServiceImpl and look for beans declared with the same name as
the property. In this case, two properties, courseDao and studentService, are eligible
for autowiring through setter injection. If beans are declared in the wiring
file with the names courseDao and studentService, those beans will be wired to
courseDao and studentService, respectively.Autowiring using byType works in a similar way to byName, except that instead of
considering a propertys name, the propertys type is examined. For example, if the
courseService beans autowire is set to byType instead of byName, the container will
search itself for a bean whose type is matches
Any ideas, resources,sample code,links, highly appreciated. thanks in advance.