Skip to content

Spring Framework Blog

Menu
  • Home
  • Spring
  • Spring Boot
  • About
Menu

Stereotypes

Posted on June 1, 2024June 2, 2024 by Armando Marques

Stereotypes are part of Spring annotations config, used with @ComponentScan.

Annotations:

@Components – is a generic stereotype for any Spring managed components.

@Service – annotates classes at the service layer, code that holds business layer.

@Repository – annotation used for classes from the persistence layer. Catches specific exceptions and re-throws them as Spring unified unchecked exceptions.

@Controller (@RestController) – denotes a frontend endpoint.

@Configuration – configuration class containing bean definitions (@Bean).

Spring vs JSR

Other

@Lazy – dependency will be injected the first time is used.

@DependsOn – Spring guarantees that the defined beans will be initialized before attempting an initialization of the current bean.

  • Spring
  • Documentation
  • References
  • Toc
  • Books
  • Certification
  • AOP
  • Config
  • Java
  • Java core
  • JDBC
  • JPA
  • Rest
  • Security
  • Spring
  • Spring Boot
  • Spring Core
  • Spring Data
  • Spring MVC
  • Spring Rest
  • Spring Security
  • Tests
  • Transactions
  • Uncategorized

Recent Posts

  • Spring Annotations
  • Java Tests
  • Java operators
  • Java versions
  • Java Oracle Licenses
  • Configuration properties
  • MockMvc
  • Spring Security III
  • MVC Controller Method Params
  • JPA Methods
  • Transaction propagation and isolation
  • Spring JDBC
  • Spring Boot Auto-Configuration
  • Spring Resource interface
  • JSR 330 Standard Annotations
  • Spring Aware Interfaces
  • Spring Transactions
  • Spring Boot Core
  • MVC Rest
  • Spring Boot JPA
©2025 Spring Framework Blog | Built using WordPress and Responsive Blogily theme by Superb