Use Modular Architecture
From APIDesign
Have You Ever Wondered...?
Your advice seems to be to split code into independent modular pieces, however I wonder how to glue them together? Right, you need some injection to configure all individual components to work together. This chapter starts with the most straightforward solutions and then enhances them to cover injection as provided by Spring Framework as well as latest releases of JDK.