What you do today can improve all your tomorrows.
Bear in mind: S = Single Responsibility Principle
O = Opened Closed Principle
L = Liskov Substitution Principle
I = Interface Segregation Principle
D = Dependency Inversion Principle
摘要:
依赖注入可以这么理解,就是一个盒子预先注入了很多服务。用户每次HTTP请求都会从盒子里拿相关服务(即实例),都是新的服务(Singleton的服务除外),然后当前请求进入某个controller中某个方法体内进行操作。在这个方法体内或之间,如果再次向盒子要服务,这样就会出现三种情况:1. Singl 阅读全文