Spring Helloworld Refactoring

Spring Framework: Refactoring Helloworld Application (Why DI is useful?)

  • How a simple HelloWorld application can be refactored in order to achieve the agility (and testability)? 
    • How can I change a certain part of an application without affecting other parts of the code? (maintainability) 
    • How can I wire different parts of the application without writing a lot of glue code myself? (productivity) 
    • How can I test the business logic without being tied up with a particular framework? (testability) 
  • Dependency Injection (DI) helps in these regards

Refactoring HelloWorld Application

  1. HelloWorld 
  2. HelloWorld with command line arguments 
  3. HelloWorld with decoupling without using Interface 
  4. HelloWorld with decoupling using Interface 
  5. HelloWorld with decoupling through Factory 
  6. HelloWorld using Spring framework as a factory class but not using DI (Dependency Injection) 
  7. HelloWorld using Spring framework's DI 
  8. HelloWorld using Spring framework's DI and XML configuration file 
  9. HelloWorld using Spring framework's DI and XML configuration file with constructor argument
  10. HelloWorld using @Autowired annotation
  11. HelloWorld using auto-scanning (component-scanning) in XML 
  12. HelloWorld using auto-scanning (component-canning) in Java

  

Download course content