「Spring认证」Spring IoC 容器

分享 0 242
IT胶囊
IT胶囊 LV1 2021年4月24日 17:57 发表
点击群号免费加入社区交流群:367346704
<p style="margin-top: 0px; margin-bottom: 8px; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &quot;pingfang SC&quot;, &quot;helvetica neue&quot;, arial, &quot;hiragino sans gb&quot;, &quot;microsoft yahei ui&quot;, &quot;microsoft yahei&quot;, simsun, sans-serif; white-space: pre-wrap;">Spring 容器是 Spring 框架的核心。容器将创建对象,将它们连接在一起,配置它们,并管理它们从创建到销毁的完整生命周期。Spring 容器使用 DI 来管理组成应用程序的组件。这些对象称为 Spring Bean,我们将在下一章中讨论。</p><p style="margin-top: 0px; margin-bottom: 8px; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &quot;pingfang SC&quot;, &quot;helvetica neue&quot;, arial, &quot;hiragino sans gb&quot;, &quot;microsoft yahei ui&quot;, &quot;microsoft yahei&quot;, simsun, sans-serif; white-space: pre-wrap;">容器通过读取提供的配置元数据来获取有关要实例化、配置和组装哪些对象的指令。配置元数据可以由 XML、Java 注释或 Java 代码表示。下图展示了 Spring 如何工作的高级视图。Spring IoC 容器利用 Java POJO 类和配置元数据来生成完全配置且可执行的系统或应用程序。</p><p style="margin-top: 0px; margin-bottom: 8px; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &quot;pingfang SC&quot;, &quot;helvetica neue&quot;, arial, &quot;hiragino sans gb&quot;, &quot;microsoft yahei ui&quot;, &quot;microsoft yahei&quot;, simsun, sans-serif; white-space: pre-wrap;">Spring 提供了以下两种不同类型的容器。</p><p style="margin-top: 0px; margin-bottom: 8px; list-style: inherit; min-height: 24px; color: rgb(51, 51, 51); font-family: &quot;pingfang SC&quot;, &quot;helvetica neue&quot;, arial, &quot;hiragino sans gb&quot;, &quot;microsoft yahei ui&quot;, &quot;microsoft yahei&quot;, simsun, sans-serif; white-space: pre-wrap;">所述的ApplicationContext容器包括所有功能的BeanFactory容器,因此,通常建议在Bean工厂。BeanFactory 仍可用于轻量级应用程序,例如移动设备或基于小程序的应用程序,其中数据量和速度很重要。</p>
收藏(0)  分享
相关标签: java
0个回复
  • 消灭零回复