# 1.5　小结

现在，你应该对 Spring 的功能特性有了一个清晰的认识。Spring 致力 于简化企业级 Java 开发，促进代码的松散耦合。成功的关键在于依赖注入和 AOP。

在本章，我们先体验了 Spring 的 DI。DI 是组装应用对象的一种方式，借助这种方式对象无需知道依赖来自何处或者依赖的实现方式。不同于自己获取依赖对象，对象会在运行期赋予它们所依赖的对象。依赖对象通常会通过接口了解所注入的对象，这样的话就能确保低耦合。

除了 DI，我们还简单介绍了 Spring 对 AOP 的支持。AOP 可以帮助应用将散落在各处的逻辑汇集于一处 —— 切面。当 Spring 装配 bean 的时候，这些切面能够在运行期编织起来，这样就能非常有效地赋予 bean 新的行为。

依赖注入和 AOP 是 Spring 框架最核心的部分，因此只有理解了如何应用 Spring 最关键的功能，你才有能力使用 Spring 框架的其他功能。在本章，我们只是触及了 Spring DI 和 AOP 特性的皮毛。在以后的几章，我们将深入探讨 DI 和 AOP。

闲言少叙，我们立即转到第 2 章学习如何在 Spring 中使用 DI 装配对象。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://potoyang.gitbook.io/spring-in-action-v4/1/1.5-xiao-jie.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
