Spring Beans and Dependency Injection¶
Spring Beans and Dependency Injection is a fundamental concept in the Spring Boot development workflow, primarily concerning the actual writing of code logic.^[600-developer__spring__開發一個springboot流程.md] It is a specific step in the broader process of "Developing with Spring Boot," following the configuration of classes and auto-configuration processes.^[600-developer__spring__開發一個springboot流程.md]
In the Spring Framework, a Bean is an object that is instantiated, assembled, and managed by the Spring IoC (Inversion of Control) container.^[600-developer__spring__開發一個springboot流程.md] These beans form the backbone of the application.
Dependency Injection (DI) is the design pattern utilized to implement Inversion of Control, allowing the application to maintain loose coupling between its components.^[600-developer__spring__開發一個springboot流程.md] Instead of creating dependencies manually (e.g., using new), the Spring container injects them into the beans that need them.^[600-developer__spring__開發一個springboot流程.md]
Related Concepts¶
- Spring Boot
- [[Auto-configuration]]
- [[Configuration Classes]]
Sources¶
^[600-developer__spring__開發一個springboot流程.md]