Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

autowire byType vs byName

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.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial