Внедрение зависимостей
Плохо
Хорошо
Почему
https://habr.com/post/334636/
Плохо
@Autowired
private BeanA beanA;
@Autowired
private beanB beanB;
Хорошо
private BeanA beanA;
private BeanB beanB;
@Autowired
public DI(BeanA beanA, BeanB beanB) {
this.beanA = beanA;
this.beanB = beanB;
}
Почему
https://habr.com/post/334636/