spring bean 的介绍

Spring有跟多概念,其中最基本的一个就是bean,那到底spring bean是什么?

Bean是Spring框架中最核心的两个概念之一,IOC容器,另一个是面向切面编程AOP。

1 定义

Spring 官方文档对 bean 的解释是:

In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC container are called beans. A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container.

翻译过来就是:

在 Spring 中,构成应用程序主干并由Spring IoC容器管理的对象称为bean。bean是一个由Spring IoC容器实例化、组装和管理的对象。

概念简单明了,我们提取处关键的信息:

  1. bean是对象,一个或者多个不限定
  2. bean由Spring中一个叫IoC的东西管理
  3. 我们的应用程序由一个个bean构成
posted @ 2020-02-04 23:36  你我皆牛马  阅读(191)  评论(0编辑  收藏  举报