The Baeldung logo
  • The Baeldung Logo
  • 从这里开始
  • 指南 ▼▲
    • Persistence

      Spring持久化指南

    • REST

      使用Spring构建REST API指南

    • Security

      Spring Security指南

  • 关于
  •  English

Spring Dependency Injection

最后修改: 2021-06-05T08:43:56Z

by baeldung
  • Series
  • Spring
  • Spring DI

Dependency Injection is a fundamental aspect of the Spring framework, through which the Spring container "injects" objects into other objects or "dependencies".

Simply put, this allows for loose coupling of components and moves the responsibility of managing components onto the container.

Let's explore DI with Spring further here.

DI Basics

  • Intro to Inversion of Control and Dependency Injection with Spring
  • Constructor Dependency Injection in Spring
  • Guide to Spring @Autowired
  • Wiring in Spring: @Autowired, @Resource and @Inject
  • Spring @Primary Annotation
  • @Order in Spring
  • XML-Based Injection in Spring
  • Quick Guide to Spring Bean Scopes

DI Advanced Topics

  • Spring – Injecting Collections
  • Spring Autowiring of Generic Types
  • Constructor Injection in Spring with Lombok
  • How to use the Spring FactoryBean?
  • @Lookup Annotation in Spring
  • Injecting Prototype Beans into a Singleton Instance in Spring

DI Exceptions

  • Unsatisfied Dependency in Spring
  • Circular Dependencies in Spring
  • Spring NoSuchBeanDefinitionException

If you have a few years of experience in the Java ecosystem, and you're interested in sharing that experience with the community (and getting paid for your work of course), have a look at the "Write for Us" page. Cheers, Eugen

The Baeldung logo

分类

  • Spring
  • REST
  • Java
  • Security
  • Persistence
  • Jackson
  • HTTP Client-Side

系列教程

  • Java “回归基础” 教程
  • Jackson JSON 教程
  • HttpClient 4 教程
  • REST 与 Spring 教程
  • Spring 持久化教程
  • Security 与 Spring

关于

  • 关于 Baeldung
  • 课程
  • 工作
  • 归档
  • 为Baeldung写作
  • 编辑
  • 合作伙伴
  • Terms of Service
  • Privacy Policy
  • Company Info
  • Contact
The Baeldung Logo