IoC 的类型?

  • Constructor-based dependency injection:

  • Setter-based dependency injection: