I read about the advantages of using Dependency for interface.
I understand the concept for interface – but why to use @Autowire on class? If we use Autowire on class I know in advance what is the implmeneted class and it’s like a regular member of it (without the ability of get to this member)!
What am I missing?
1) Convenience – you do not need to take care for initializing your components, you save time on typing code and configuration files,
2) Forcing good practices – your components to be autowired must be written to be manageable by Spring and spring will take care about error checking for you and pop all errors. So your code will be organized in component collaborating way.
3) Autowiring will also reduce your effort when your classes/beans will grow and evolve.