Since we just challenged some of Spring Framework's most important features and practices, now it's time to shed some light on good ways of developing your code. Let's start again with dependency injection.
Good ways to develop your code
Don't inject too much
As we already mentioned, the @Autowired annotation will inject all necessary dependencies. To avoid the problem with dependency injection that we explained previously, try to avoid injecting too many dependencies into a single class. Usually, it's good if you have very few beans that your class requires. It's up to you to maintain this balance and organize your architecture.