Content deleted Content added
→Creating and managing beans: Minor change Tags: Mobile edit Mobile web edit |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 25:
! Version
! Date
|-
| 0.9 || 2003
|-
| 1.0 || March 24, 2004
|-
| 2.0 || 2006
|-
| 3.0 || 2009
|-
| 4.0 || 2013
|-
| 5.0 || 2017
|-
| 6.0 || November 22, 2022
|-
| 6.1 || November 16, 2023
|-
| 6.2 || November 14, 2024
|-
|}
Line 101 ⟶ 100:
====Autowiring====
The Spring framework has a feature known as autowiring, which uses the
There are several annotations that can be used for autowiring POJOs, including the Spring-specific annotation {{code|@Autowire}} (as well as several other Spring-specific annotations that help resolve autowire ambiguity such as the {{code|@Qualifier}} or {{code|@Primary}} annotations),{{sfn | Deinum | Long | Mak | Rubio | 2014 | loc=§3-3 Use POJO References and Auto-Wiring to Interact with other POJOs |pp=145-151}}{{sfn | Cosmina | Harrop | Schaefer | Ho | 2017 | loc=§3 Introducing IoC and DI in Spring - Autowiring Your Beans | pp=112-120 }} and the standard Java annotations {{code|@Resource}} and {{code|@Inject}}.{{sfn | Deinum | Long | Mak | Rubio | 2014 | loc=§3-4 Auto-wire POJOs the @Resource and @Inject annotation | pp=151-154}}
The {{code|@Qualifier}} annotation can be used on a class that defines a bean to inform Spring to prioritize the bean creation when autowiring it by '''name'''.{{sfn | Cosmina | Harrop | Schaefer | Ho | 2017 | loc=§3 Introducing IoC and DI in Spring - Autowiring Your Beans | pp=112-120 }}
The {{code|@Primary}} annotation can be used on a class that defines a bean to inform Spring to prioritize the bean creation when autowiring it by '''type'''.{{sfn | Cosmina | Harrop | Schaefer | Ho | 2017 | loc=§3 Introducing IoC and DI in Spring - Autowiring Your Beans | pp=112-120 }}
The {{code|@Resource}} annotation is an annotation that conforms to [[JSR 250]], or Common Annotations for the Java Platform
The {{code|@Inject}} annotation is an annotation that conforms to JSR 300, or Standard Annotations for injection ===Aspect-oriented programming framework===
Line 121 ⟶ 122:
Spring AOP has been designed to work with cross-cutting concerns inside the Spring Framework.{{sfn | Johnson | Hoeller | 2004}}{{rp | p=473}} Any object which is created and configured by the container can be enriched using Spring AOP.
The Spring Framework uses Spring AOP internally for transaction management, security, remote access, and [[Java Management Extensions|JMX]].<ref>{{
Since version 2.0 of the framework, Spring provides two approaches to the AOP configuration:
|