Skip to content

Introduce predefined composed annotations in core Spring [SPR-13442] #18022

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sam Brannen opened SPR-13442 and commented

Status Quo

Spring Framework 4.2 introduced support for explicit attribute overrides in meta-annotations via the new @AliasFor annotation. This new support makes it possible to include a set of predefined composed annotations in several modules of the Spring Framework.


Spring Composed

For the time being, the Spring team is using the spring-composed project as a playground for trying out new ideas with regard to what kinds of predefined composed annotations Spring should support.

Feedback is welcome!


Candidates for Inclusion

The following candidates are for inclusion in the Spring Framework.

  • @GetMapping, @PostMapping, @PutMapping, @DeleteMapping, & @PatchMapping, for standard Spring MVC controller methods
  • @ApplicationScope, @SessionScope, @RequestScope

Possible Candidates for Inclusion

The following candidates are possible for inclusion in the Spring Framework based on early feedback.

  • @HeadMapping, @OptionsMapping, & @TraceMapping for standard Spring MVC controller methods
  • @GetResource, @PostResource, @PutResource, @DeleteResource etc. for generic REST-based Spring MVC controller methods with preconfigured response statuses
  • @TransactionalService, @TransactionalComponent, @TransactionalRepository
  • @SingletonScope, @PrototypeScope, @GlobalSessionScope

Unlikely Candidates for Inclusion

The following candidates are unlikely for inclusion in the Spring Framework based on early feedback.

  • @GetJson, @GetXml, etc. for opinionated REST-based Spring MVC controller methods
  • @TransactionalController, @TransactionalRestController

Deliverables

  1. Determine the set of predefined composed annotations to introduce.
  2. Create new issues to address individual groups of composed annotations.
  3. Implement, test, and document the new predefined composed annotations.

Affects: 4.2 GA

Issue Links:

7 votes, 17 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions