java - Is using @Autowired considered a good practice? -
i have question bugging me time , unable find clear answer, decided ask here.
is using @autowired considered practice? in other words, make sense use autowiring production code or should treat "nice have" light projects, not "serious business"? or matter of opinion?
i've had feeling autowiring developer gives on providing "explicit" set of injection rules , relies on framework instead. may sound conservative, doesn't sound design decision me.
there nothing wrong using @autowired annotation in production code.
you can control injection applicationcontext properties on annotation (such required). developer isn't 'giving up' on controlling how things injected.
my argument using autowired can modify 1 configuration , change instances of autowired injection of class. can make refactoring common classes lot less painful.
Comments
Post a Comment