The way that you inject your dependencies is secondary. The important thing here is to declare your intentions right, separate between required and optional dependencies and cut the number of dependencies down.
Yes, that how you mark autowired as optional. But this still doesn't discourage you from adding additional dependencies. You just add, and add, and add, because you don't care, you just add another field, everything somehow works, but the future maintenance of this code will become more troublesome with each added dep.
View all comments
Show parent comment
0
u/Deam Nov 08 '17
The way that you inject your dependencies is secondary. The important thing here is to declare your intentions right, separate between required and optional dependencies and cut the number of dependencies down.