Spring Framework: Difference between revisions

Content deleted Content added
Tags: Mobile edit Mobile web edit
 
(2 intermediate revisions by 2 users not shown)
Line 25:
! Version
! Date
! Notes
|-
| 0.9 || 2003 ||
|-
| 1.0 || March 24, 2004 || First production release.
|-
| 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 105 ⟶ 104:
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, and is used for autowiring references to POJOs by '''name'''.{{sfn | Deinum | Long | Mak | Rubio | 2014 | loc=§3-4 Auto-wire POJOs the @Resource and @Inject annotation | pp=151-154}}

The {{code|@Inject}} annotation is an annotation that conforms to JSR 300, or Standard Annotations for injection, and is used for autowiring references to POJOs by '''type'''.{{sfn | Deinum | Long | Mak | Rubio | 2014 | loc=§3-4 Auto-wire POJOs the @Resource and @Inject annotation | pp=151-154}}
 
===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>{{Citationcite book |last=Chidester |first=Ashlan |title=Looking Forward to the Spring Framework needed|date=June2024 |publisher=Kindle Edition |url=https://www.amazon.com/dp/B0CFYBPFLQ?ref=KC_GS_GB_US |access-date=February 12, 20232025}}</ref>
 
Since version 2.0 of the framework, Spring provides two approaches to the AOP configuration: