Here’s a definition of beans in the Spring Framework documentation:
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容器实例化、组装和管理的对象。
参考 What is a Spring Bean?
参考 spring bean是什么?
bean规范如下:
- 所有属性为private
- 提供getter和setter
- 提供默认构造方法
- 实现serializable接口