spring-plugin 来自spring 官方的plugin 解决方案

spring-plugin属于spring 官方的plugin 解决方案

使用的上下文

以下是官方的一些使用场景

  • 希望构建一个插件化架构
  • 不能使用osgi的(实际上还是osgi 太复杂)
  • 系统通过一些接口进行系统扩展
  • 希望通过jar 包的模式进行系统的灵活扩展
  • 项目使用spring

说明

目前不太好的是spring-plugin似乎缺少维护,如果实际上使用一个插件化框架的化,我还是推荐基于pf4j,社区还是比较活跃的,而且一致在更新
好多设计点也很不错,官方文档也基本够用,spring-plugin 核心是对于spring 项目比较合适,但是pf4j 的通用型更强,如果看过dremio 的设计的话
会发现dremio的插件化架构也是很强大的,通过动态类加载,实现的能力也是很不错的

参考资料

https://github.com/spring-projects/spring-plugin
https://github.com/pf4j/pf4j
https://github.com/pf4j/pf4j-spring
https://wearenotch.com/extending-spring-boot-apps-with-plugins-2/
https://www.rajith.me/2021/10/strategy-pattern-with-spring-plugin.html
https://spring.io/blog/2021/10/13/spring-tips-spring-plugin
https://medium.com/javarevisited/the-strategy-design-pattern-with-spring-plugin-e99021c8f6eb
https://developer.atlassian.com/server/framework/atlassian-sdk/osgi-spring-and-the-plugin-framework/

posted on 2024-02-04 09:59  荣锋亮  阅读(170)  评论(0编辑  收藏  举报

导航