I was reading folowing lines and I did not understand clearly.
To autowire or not to autowire
Although autowiring seems to be a powerful way to cut down on the amount of
manual configuration required when writing the bean wiring file, it may lead to
For example, suppose that the studentService bean is set to be autowired
using byName. As a result, its studentDao property will automatically be set to the
bean in the container whose name is studentDao. Lets say that you decide that
you want to refactor the studentDao property, renaming it as studentData. After
refactoring, the container will try to autowire by looking for a bean named
studentData. Unless you have changed the bean XML file, it wont find a bean by
that name and will leave the property unwired. When the studentService tries to use the studentData property, youll get a NullPointerException.wired to the
studentData property, Depending on the type of the student-
Data bean, Spring may quietly wire in the unwanted bean, resulting in unexpected
Autowiring is a powerful tool
Any ideas, resources,sample code,links, highly appreciated. thanks in advance.