Get the App
SLTechnology News&Howtos  ›  Development  › 

How to understand Spring Ioc Container Bean

Shulou Source: shulou.com Published: 2022-06-03 05:52:27 11月17日 Update

This article focuses on "how to understand Spring Ioc Container Bean". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to understand Spring Ioc Container Bean.

Naming of Bean

Bean can have one or more names in the Ioc container, but these names must be unique within the container, and you can alias Bean by configuring the id and name properties in Xml.

In this way, we can get the instance of UserBean by the names user, zhangsan, lisi.

Of course, if you do not configure the id/name attribute for UserBean, the Spring Ioc container will automatically generate a lowercase alias for the first character of the class name without Bean.

In addition, you can also use the

Tags: Instance property container configuration method function factory name parameter cycle life type interface alias data other than that different special two function Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei vpn NVidia OPPO Reno Linux