Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyongyuan committed May 3, 2023
1 parent 200a62e commit a4fdff7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

尽管策略模式非常常见,但是在项目中却有非常多不同的代码实现:不同的工程师、不同的策略类可能就定义一套自己的BeanFactory。一个工程里面可能有很多个XXXBeanFactory。

另外由于Dubbo的SPI机制非常有名,不少项目中甚至在项目已经使用Spring的基础上,自定义一套META-INF目录,自己去做文件解析,bean注册、注入,整个设计非常复杂并且不好维护。
另外由于Dubbo的SPI机制非常出名,但是不少项目中在项目已经使用Spring的基础上,自定义一套META-INF目录,自己去做文件解析,bean注册、注入,整个设计非常复杂并且不好维护。
个人认为,由于Dubbo并不是基于Spring构建,所以自行设计了对应的文件解析是可以理解,但是对于Spring构建的Bean,就不用自己再去做注入了,通过Spring即可进行不同文件、类的加载。

我们需要的SPI机制,可能更多的是策略模式。比如ExtensionLoader中的Wrapper模式,可能在Spring中通过AOP的模式即可实现。对于SPI的理解,我们更多的应该从构建可扩展系统去了解。
Expand Down

0 comments on commit a4fdff7

Please sign in to comment.