Skip to content

Commit

Permalink
Update general-knowledge.md (#2930)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnzakii committed Feb 28, 2024
1 parent 3c65cee commit 3b6fe90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/zh-cn/docsv2.7/dev/principals/general-knowledge.md
Expand Up @@ -57,7 +57,7 @@ weight: 6

## 微核插件式,平等对待第三方

大凡发展的比较好的框架,都遵守微核的理念。Eclipse 的微核是 OSGi, Spring 的微核是 BeanFactory,Maven 的微核是 Plexus。通常核心是不应该带有功能性的,而是一个生命周期和集成容器,这样各功能可以通过相同的方式交互及扩展,并且任何功能都可以被替换。如果做不到微核,至少要平等对待第三方,即原作者能实现的功能,扩展者应该可以通过扩展的方式全部做到。原作者要把自己也当作扩展者,这样才能保证框架的可持续性及由内向外的稳定性。
但凡发展的比较好的框架,都遵守微核的理念。Eclipse 的微核是 OSGi, Spring 的微核是 BeanFactory,Maven 的微核是 Plexus。通常核心是不应该带有功能性的,而是一个生命周期和集成容器,这样各功能可以通过相同的方式交互及扩展,并且任何功能都可以被替换。如果做不到微核,至少要平等对待第三方,即原作者能实现的功能,扩展者应该可以通过扩展的方式全部做到。原作者要把自己也当作扩展者,这样才能保证框架的可持续性及由内向外的稳定性。

## 不要控制外部对象的生命周期

Expand All @@ -75,4 +75,4 @@ weight: 6

## 增量式扩展,而不要扩充原始核心概念

参见:[谈谈扩充式扩展与增量式扩展](../expansibility)
参见:[谈谈扩充式扩展与增量式扩展](../expansibility)

0 comments on commit 3b6fe90

Please sign in to comment.