Python知識分享網(wǎng) - 專業(yè)的Python學(xué)習(xí)網(wǎng)站 學(xué)Python,上Python222
spring框架外文文獻(xiàn) DOC 下載
發(fā)布于:2023-11-04 09:09:21
(假如點擊沒反應(yīng),多刷新兩次就OK!)

spring框架外文文獻(xiàn) DOC 下載  圖1

 

 

 

 

資料內(nèi)容:

 

Most of the modules have a dependency on some other module in the Spring Framework. The core module is an exception to this rule. Figure 2-2 gives an overview of the commonly used modules and their dependencies on other modules. Notice that the instrumentation, aspect, and test modules are missing from the figure; this is because their dependencies depend on the project and what other modules are used. The Spring Framework has only one required dependency: commons-logging, a logging abstraction framework. The other dependencies differ based on the needs of the project.

 

 

Dependency Injection

The concept of dependency injection (DI), objects are given their dependencies at construction time, is one of the foundations of the Spring Framework. You have also probably heard of Inversion of Control (IoC). IoC is a broader, more general concept that can be addressed in different ways. IoC lets developers decouple and focus on what is important for a given part of an enterprise application, but without having to think about what other parts of the system do. Programming to interfaces is one way to think about decoupling.

Almost every enterprise application consists of multiple components that need to work together. In the early days of Java enterprise development, we simply put all the logic of constructing those objects (and the objects those objects needed) in the constructor (see Listing 2-1). At first sight, there is nothing wrong with that approach; however, as time progressed, object construction became slow, and objects had a lot of knowledge they shouldnt have had (see the Single Responsibility Principle). Those classes became hard to maintain, and they were also quite hard to unit and/or integration test.