Chapter 2. Hello, Mikado Method!
Listing 2.1. Launcher.java
Listing 2.2. Launcher.java with parameterized setStorageFile(..)
Listing 2.3. Launcher.java
Listing 2.4. App.java
Listing 2.5. The UI.java code, somewhat reduced
Listing 2.6. Changing FileDB to Database, with compilation errors in bold
Listing 2.7. The call to the FileDB constructor is changed.
Listing 2.8. The call to the FileDB constructor is changed in UI.
Listing 2.9. Database interface
Listing 2.10. Use the interface in UI
Listing 2.11. Error in Launcher
Listing 2.12. Error in UI
Listing 2.13. The UI is done
Listing 2.14. Pulled construction to App
Listing 2.15. FileDB pulled all the way up to Launcher
Listing 2.16. Launcher in final shape
Listing 2.17. App in final shape
Chapter 5. Breaking up a monolith
Listing 5.1. The handle method in LoanHandler.java
Listing 5.2. Helper methods in LoanHandler.java
Listing 5.3. The stubbed response
Listing 5.4. The stubbed HttpServletRequest
Listing 5.5. The stubbed Request
Listing 5.6. The tests
Listing 5.7. The slightly changed LoanHandler.java
Listing 5.8. The slightly changed setUp() in LoanHandlerTest.java
Listing 5.9. Contents of the RequestHelper class
Listing 5.10. Contents of the ApproveHandler class
Listing 5.11. Contents of the LoanHandler class
Listing 5.12. Contents of the LoanRepository interface
Listing 5.13. Contents of the ApproveHandlerTest class
Chapter 6. Emergent design
Listing 6.1. A piece of code that does too much
Listing 6.2. Responsibilities distributed