https://learn.openapis.org/introduction.html
Technical Solutions
Wednesday, 15 April 2026
Wednesday, 18 March 2026
Design pattern
Let’s simplify everything from Refactoring Guru Design Patterns into very easy (lemon 😄) terms + real-world + Java/Spring examples.
🧠 First: What is a Design Pattern?
👉 A design pattern = proven solution to common coding problem
Think like:
“This problem already happened before → smart people solved it → reuse that solution”
🧩 3 Types of Design Patterns
1. 🏗️ Creational (Object banana ka tareeka)
How objects are created
2. 🧱 Structural (Object ko kaise jode)
How objects are structured/connected
3. 🔄 Behavioral (Object kaise behave kare)
How objects communicate
🏗️ 1. CREATIONAL PATTERNS (Creation)
1. Singleton 🧍
👉 Only one object in whole system
🍋 Lemon Example:
There is only one Aadhaar database
💻 Java Example:
class Config {
private static Config instance = new Config();
private Config() {}
public static Config getInstance() {
return instance;
}
}
🔥 Real Use:
DB connection pool
Redis client
Spring Beans (default singleton)
2. Factory 🏭
👉 Object create karne ka decision system lega
🍋 Example:
You order coffee
Latte / Cappuccino / Espresso
System decides what to create
💻 Java Example:
interface Notification {}
class Email implements Notification {}
class SMS implements Notification {}
class Factory {
public static Notification get(String type) {
if (type.equals("email")) return new Email();
return new SMS();
}
}
🔥 Real Use:
Payment methods
Notification service
3. Builder 🧱
👉 Complex object step-by-step banana
🍋 Example:
Ordering pizza
size
cheese
toppings
💻 Example:
User user = User.builder()
.name("Pawan")
.age(30)
.build();
🔥 Real Use:
DTO creation
Immutable objects
🧱 2. STRUCTURAL PATTERNS
4. Adapter 🔌
👉 Incompatible cheez ko compatible banana
🍋 Example:
Indian charger → US socket adapter
💻 Example:
Old API → New API wrapper
🔥 Real Use:
Third-party API integration (very important for you!)
5. Decorator 🎁
👉 Existing object ko extra feature dena
🍋 Example:
Coffee + milk + chocolate
💻 Example:
class Coffee {}
class MilkDecorator extends Coffee {}
🔥 Real Use:
Logging
Security layers
6. Facade 🏢
👉 Complex system ko simple interface dena
🍋 Example:
Swiggy app → kitchen, delivery, payment sab hide
💻 Example:
class OrderService {
void placeOrder() {
payment();
inventory();
delivery();
}
}
🔥 Real Use:
Microservice orchestration
🔄 3. BEHAVIORAL PATTERNS
7. Strategy 🎯
👉 Multiple ways to do same task
🍋 Example:
Travel options:
Car
Bike
Train
💻 Example:
interface PaymentStrategy {
void pay();
}
class UPI implements PaymentStrategy {}
class Card implements PaymentStrategy {}
🔥 Real Use:
👉 Your AWS SES email system can use this!
8. Observer 👀
👉 One change → multiple systems notified
🍋 Example:
YouTube subscribe → notification
💻 Example:
observer.update();
🔥 Real Use:
SNS, Kafka, Event-driven systems
9. Command 📦
👉 Request ko object bana do
🍋 Example:
Remote control button
💻 Example:
interface Command {
void execute();
}
🔥 Real Use:
Queue (SQS)
Task execution
🚀 Most Important for YOU (Based on your work)
Since you're working with:
Spring Boot
AWS SES, SQS
Microservices
👉 Focus on:
Strategy → email sending logic
Factory → notification type
Observer → event system (SNS/SQS)
Facade → service layer
Builder → DTO creation
🎯 Simple Memory Trick
| Type | Meaning |
|---|---|
| Creational | Object kaise banega |
| Structural | Object kaise judega |
| Behavioral | Object kaise behave karega |
💡 Real-world Example (Your Project)
Your Email System:
Factory → choose Email/SMS
Strategy → SES / SMTP
Observer → Bounce/Delivery events
Command → SQS message
Facade → EmailService
Perfect — let’s go deep into Creational Patterns (this is where strong backend engineers stand out in interviews + system design).
I’ll explain:
Core idea (simple 🍋)
When to use (important!)
Internal thinking (how it works)
6+ real-world examples (with Java/Spring mapping)
🏗️ CREATIONAL DESIGN PATTERNS (Deep Dive)
👉 These patterns solve:
“Object kaise banega — simple, controlled, flexible way mein?”
1. 🧍 Singleton Pattern (One instance only)
🍋 Simple Idea:
System mein sirf ek hi object allowed
🧠 Why needed?
Avoid multiple expensive objects
Maintain shared state
⚙️ Internal Concept:
Private constructor
Static instance
Global access method
💻 Production-Ready Java (Thread-safe)
public class ConfigManager { private static volatile ConfigManager instance; private ConfigManager() {} public static ConfigManager getInstance() { if (instance == null) { synchronized (ConfigManager.class) { if (instance == null) { instance = new ConfigManager(); } } } return instance; } }🔥 Real-world examples (6+)
1. DB Connection Pool
DataSource ds = DataSourceSingleton.getInstance();2. Redis Client
Jedis jedis = RedisManager.getInstance().getClient();3. Logger (Log4j / SLF4J)
👉 Only one logger config
4. Spring Beans (Default)
@Service class UserService {}👉 Spring internally uses Singleton
5. Cache Manager
CacheManager.getInstance().put(key, value);6. Configuration Loader
ConfigManager.getInstance().get("db.url");⚠️ When NOT to use:
When object needs different states (use prototype)
2. 🏭 Factory Pattern (Object creation decision hidden)
🍋 Simple Idea:
“Tum bas bolo kya chahiye — system bana ke dega”
🧠 Why needed?
Remove
newkeyword everywhereLoose coupling
💻 Example (Advanced)
interface Payment { void pay(); } class UPI implements Payment { public void pay() { System.out.println("UPI"); } } class Card implements Payment { public void pay() { System.out.println("Card"); } } class PaymentFactory { public static Payment getPayment(String type) { switch(type) { case "UPI": return new UPI(); case "CARD": return new Card(); default: throw new IllegalArgumentException(); } } }🔥 Real-world examples
1. Payment System
Payment p = PaymentFactory.getPayment("UPI");2. Notification System
Notification n = NotificationFactory.get("EMAIL");3. Spring BeanFactory
👉 Spring internally uses Factory
4. AWS SDK Clients
AmazonSQS sqs = AmazonSQSClientBuilder.defaultClient();5. JDBC DriverManager
Connection con = DriverManager.getConnection(url);6. Parser System
Parser parser = ParserFactory.get("JSON");⚠️ Problem solved:
👉 No
if-elseeverywhere3. 🧱 Builder Pattern (Complex object creation)
🍋 Simple Idea:
“Step-by-step object banana”
🧠 Why needed?
Too many constructor arguments
Optional fields
💻 Example
class User { private String name; private int age; private String email; public static class Builder { private String name; private int age; private String email; public Builder setName(String name) { this.name = name; return this; } public Builder setAge(int age) { this.age = age; return this; } public Builder setEmail(String email) { this.email = email; return this; } public User build() { User u = new User(); u.name = this.name; u.age = this.age; u.email = this.email; return u; } } }🔥 Real-world examples
1. HTTP Request (Spring)
ResponseEntity.ok().header("x","y").body(data);2. Lombok Builder
User user = User.builder() .name("Pawan") .email("p@test.com") .build();3. AWS SES Email
SendEmailRequest request = new SendEmailRequest() .withDestination(...) .withMessage(...);4. Kafka Message Builder
ProducerRecord record = new ProducerRecord(topic, key, value);5. Query Builder (JPA)
criteriaBuilder.createQuery(User.class);6. Docker Config (Your project!)
👉 step-by-step container config
4. 🧬 Prototype Pattern (Clone object)
🍋 Simple Idea:
“Naya object banane ke bajaye copy karo”
🧠 Why needed?
Object creation expensive hai
💻 Example
class User implements Cloneable { String name; public Object clone() throws CloneNotSupportedException { return super.clone(); } }🔥 Real-world examples
1. Template Email Copy
Email copy = original.clone();2. Spring Prototype Scope
@Scope("prototype") @Bean public User user() { return new User(); }3. Object Copy in Cache
return cachedObject.clone();4. Game Development (Characters)
5. Document Templates
6. Request Retry Copy
👉 same request clone
5. 🏢 Abstract Factory (Factory of factories)
🍋 Simple Idea:
“Factory bhi dynamically choose hogi”
🧠 Why needed?
Multiple related object families
💻 Example
interface UIFactory { Button createButton(); } class WindowsFactory implements UIFactory { public Button createButton() { return new WindowsButton(); } } class MacFactory implements UIFactory { public Button createButton() { return new MacButton(); } }🔥 Real-world examples
1. Multi-cloud system (AWS/Azure)
CloudFactory factory = getFactory("AWS"); factory.createS3();2. DB Support (MySQL / Mongo)
DAOFactory factory = getFactory("MYSQL");3. UI Themes
4. Payment Gateway Providers
GatewayFactory.get("RAZORPAY");5. Messaging Systems
Factory → Kafka / RabbitMQ6. Your Microservice Design
👉 Per-tenant implementation
🧠 Interview-Level Insight
Difference:
Pattern Key Idea Singleton One instance Factory Object creation logic Builder Step-by-step creation Prototype Copy object Abstract Factory Group of factories 🚀 YOUR PROJECT MAPPING (VERY IMPORTANT)
For your AWS Email System:
Component Pattern SES / SMTP switch Strategy + Factory Email Request Builder Event handling Observer Config Singleton Multi-provider Abstract Factory Perfect, Pawan — let’s design a real production-level Spring Boot microservice using ALL creational patterns together.
I’ll build this around something relevant to your work:
👉 Email Notification Service (AWS SES / SMTP / Future providers)🚀 🏗️ SYSTEM OVERVIEW
🎯 Goal:
Send emails using different providers dynamically:
AWS SES
SMTP
Future: SendGrid
🧩 WHERE EACH PATTERN FITS
Pattern Usage Singleton Config / AWS clients Factory Choose provider Abstract Factory Cloud provider family Builder Email request creation Prototype Retry email copy 📦 HIGH-LEVEL FLOW
Controller → Service → Factory → Provider → Send Email ↓ Builder (email) ↓ Prototype (retry)1️⃣ 🧍 Singleton → Config Manager
👉 One config across system
@Component public class AppConfig { private final Map<String, String> config = new HashMap<>(); public AppConfig() { config.put("provider", "SES"); } public String get(String key) { return config.get(key); } }✅ Spring makes it singleton automatically
2️⃣ 🧱 Builder → Email Object
👉 Complex object (to, subject, body, attachments)
public class Email { private String to; private String subject; private String body; private Email() {} public static class Builder { private String to; private String subject; private String body; public Builder to(String to) { this.to = to; return this; } public Builder subject(String subject) { this.subject = subject; return this; } public Builder body(String body) { this.body = body; return this; } public Email build() { Email email = new Email(); email.to = this.to; email.subject = this.subject; email.body = this.body; return email; } } }3️⃣ 🏭 Factory → Provider Selection
public interface EmailProvider { void send(Email email); }Implementations:
@Component public class SESProvider implements EmailProvider { public void send(Email email) { System.out.println("Sending via SES"); } } @Component public class SMTPProvider implements EmailProvider { public void send(Email email) { System.out.println("Sending via SMTP"); } }Factory
@Component public class EmailProviderFactory { @Autowired private SESProvider ses; @Autowired private SMTPProvider smtp; public EmailProvider getProvider(String type) { if ("SES".equalsIgnoreCase(type)) return ses; return smtp; } }4️⃣ 🏢 Abstract Factory → Cloud Providers
👉 Suppose future:
AWS (SES, SQS)
Azure (Email, Queue)
public interface CloudFactory { EmailProvider createEmailProvider(); }AWS Factory
@Component public class AWSFactory implements CloudFactory { @Autowired private SESProvider ses; public EmailProvider createEmailProvider() { return ses; } }Azure Factory (future)
@Component public class AzureFactory implements CloudFactory { public EmailProvider createEmailProvider() { return new SMTPProvider(); } }5️⃣ 🧬 Prototype → Retry Email
👉 Same email clone for retry
public class Email implements Cloneable { public Email clone() { try { return (Email) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } } }Retry Logic
public void retry(Email email) { Email copy = email.clone(); send(copy); }6️⃣ 🎯 SERVICE LAYER (Putting everything together)
@Service public class EmailService { @Autowired private AppConfig config; @Autowired private EmailProviderFactory factory; public void sendEmail(String to, String subject, String body) { // Builder Email email = new Email.Builder() .to(to) .subject(subject) .body(body) .build(); // Factory String providerType = config.get("provider"); EmailProvider provider = factory.getProvider(providerType); provider.send(email); } }7️⃣ 🌐 CONTROLLER
@RestController @RequestMapping("/email") public class EmailController { @Autowired private EmailService service; @PostMapping public String send() { service.sendEmail("test@mail.com", "Hello", "Body"); return "Sent"; } }🔥 REAL PRODUCTION ENHANCEMENTS (VERY IMPORTANT)
Since you're working on large-scale email system, add:
✅ 1. Strategy (Bonus pattern)
Switch providers dynamically:
Map<String, EmailProvider> providers;✅ 2. Add SQS (Command pattern)
queue.send(emailRequest);✅ 3. Observer (SES events)
Bounce
Delivery
Complaint
✅ 4. Rate Limiting
Avoid SES blocking (you faced this already)
✅ 5. Retry with Backoff
retry after 1s → 5s → 10s🧠 HOW INTERVIEWER WILL TEST YOU
They will ask:
👉 “Design email system supporting multiple providers”
Your answer:
Builder → Email object
Factory → provider selection
Strategy → sending logic
Singleton → config
Prototype → retry
🔥 This is staff-level answer
🚀 NEXT LEVEL (I recommend)
If you want to go even deeper:
👉 I can upgrade this to:
Kafka-based event system
Fully async microservices
Circuit breaker (Resilience4j)
Multi-tenant email system (VERY IMPORTANT FOR YOU)
Just tell me:
👉 “Make it production-level architecture”
Tuesday, 17 February 2026
Spring boot annotation list
✅ 1. Core Spring / IOC & Bean Management
Stereotype annotations
@Component
@Service
@Repository
@Controller
@RestController
Configuration & Beans
@Configuration
@Bean
@Import
@ImportResource
@ComponentScan
@PropertySource
@Profile
@Scope
@Lazy
@DependsOn
@Primary
@Qualifier
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 1/2417/02/2026, 16:47 Spring Boot Annotations List
Dependency Injection
@Autowired
@Value
@Required
✅ 2. Spring Boot Specific
@SpringBootApplication
@EnableAutoConfiguration
@ConfigurationProperties
@EnableConfigurationProperties
@SpringBootTest
@TestConfiguration
@MockBean
@SpyBean
✅ 3. Web / MVC / REST
Controller & Mapping
@RequestMapping
@GetMapping
@PostMapping
@PutMapping
@DeleteMapping
@PatchMapping
Request handling
@RequestParam
@PathVariable
@RequestBody
@ResponseBody
@ResponseStatus
@RequestHeader
@CookieValue
@ModelAttribute
@MatrixVariable
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 2/2417/02/2026, 16:47 Exception Handling
@ExceptionHandler
@ControllerAdvice
@RestControllerAdvice
Spring Boot Annotations List
CO
RS
@CrossOrigin
✅ 4. Validation (JSR-303 / Hibernate Validator)
@Valid
@Validated
@NotNull
@NotEmpty
@NotBlank
@Size
@Min
@Max
@Positive
@Negative
@Pattern
@Future
@Past
@Digits
@AssertTrue
@AssertFalse
✅ 5. Spring Data JPA / Persistence
Repository
@Repository
@EnableJpaRepositories
Entity mapping (JPA)
@Entity
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 3/2417/02/2026, 16:47 Spring Boot Annotations List
@Table
@Id
@GeneratedValue
@Column
@Transient
@Lob
@Enumerated
@Temporal
Relations
@OneToOne
@OneToMany
@ManyToOne
@ManyToMany
@JoinColumn
@JoinTable
@MapsId
@Embedded
@Embeddable
Query
@Query
@NamedQuery
@Modifying
@Param
@Procedure
Transactions
@Transactional
✅ 6. Security (Spring Security)
@EnableWebSecurity
@EnableMethodSecurity
@Secured
@RolesAllowed
@PreAuthorize
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 4/2417/02/2026, 16:47 Spring Boot Annotations List
@PostAuthorize
@PreFilter
@PostFilter
@AuthenticationPrincipal
✅ 7. Scheduling & Async
@EnableScheduling
@Scheduled
@EnableAsync
@Async
✅ 8. Caching
@EnableCaching
@Cacheable
@CachePut
@CacheEvict
@Caching
✅ 9. Spring Cloud / Microservices (very common)
@EnableDiscoveryClient
@FeignClient
@EnableFeignClients
@LoadBalanced
@CircuitBreaker
@Retryable
@Recover
@RefreshScope
✅ 10. Messaging (Kafka / JMS / RabbitMQ)
@EnableKafka
@KafkaListener
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 5/2417/02/2026, 16:47 Spring Boot Annotations List
@SendTo
@EnableJms
@JmsListener
@RabbitListener
@RabbitHandler
✅ 11. Testing
@RunWith
@ExtendWith
@WebMvcTest
@DataJpaTest
@JdbcTest
@JsonTest
@RestClientTest
@AutoConfigureMockMvc
@AutoConfigureTestDatabase
@TestPropertySource
@ActiveProfiles
@DirtiesContext
@BeforeEach
@AfterEach
@BeforeAll
@AfterAll
@Test
✅ 12. AOP (Aspect Oriented Programming)
@Aspect
@Before
@After
@AfterReturning
@AfterThrowing
@Around
@Pointcut
@EnableAspectJAutoProxy
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 6/2417/02/2026, 16:47 Spring Boot Annotations List
✅ 13. Internationalization / Formatting
@DateTimeFormat
@NumberFormat
✅ 14. Conditional Annotations (Auto-Config magic)
@Conditional
@ConditionalOnBean
@ConditionalOnMissingBean
@ConditionalOnProperty
@ConditionalOnClass
@ConditionalOnMissingClass
@ConditionalOnWebApplication
@ConditionalOnNotWebApplication
@ConditionalOnExpression
✅ 15. Actuator
@Endpoint
@ReadOperation
@WriteOperation
@DeleteOperation
⚠
Reality Check
There is NO single official list called “all Spring Boot annotations” because:
Spring = Core + Web + Data + Security + Cloud + Test + Integration
JPA & Validation annotations come from Java EE / Jakarta
New annotations added every
version
If you really want absolute every annotation, you must scan packages:
org.springframework.*
jakarta.persistence.*
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 7/2417/02/2026, 16:47 jakarta.validation.*
org.springframework.boot.*
Spring Boot Annotations List
🎯 What I recommend for you (as a senior dev)
Master these 30 first:
less
Copy code
@SpringBootApplication
@Component
@Service
@Repository
@RestController
@Autowired
@Configuration
@Bean
@RequestMapping
@GetMapping
@PostMapping
@RequestBody
@PathVariable
@Transactional
@Entity
@Id
@OneToMany
@ManyToOne
@JoinColumn
@Query
@ExceptionHandler
@ControllerAdvice
@Scheduled
@Async
@Cacheable
@PreAuthorize
@FeignClient
@Test
@SpringBootTest
If you
want, next I can give you one of these (your choice):
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 8/2417/02/2026, 16:47 A) 📄 B) 🧠 C) 🔥 D)
Spring Boot Annotations List
PDF cheat sheet of all annotations category-wise
Diagram of Spring annotation layers
Interview-focused annotation list (top 50)
🧪
Example project showing 30 annotations used
E) Full table (Annotation | Purpose | Example)
Just reply with: A / B / C / D / E 😄
A and E
Awesome choice, Pawan 😎
Here is:
wise)
✅ A) Spring Boot Annotations – Cheat Sheet (Category-
and
✅ E) Full Table (Annotation | Purpose | Example)
You can copy this and I can convert it into a PDF for you next if you say:
👉 “Convert this into PDF”
Copy code
🅐 Spring Boot Annotation Cheat Sheet 📄
🔹 Core & IOC
less
@Component, @Service, @Repository, @Controller, @RestController
@Configuration, @Bean, @ComponentScan
@Autowired, @Qualifier, @Primary
@Value, @PropertySource
@Profile, @Scope, @Lazy, @DependsOn
🔹 Spring Boot
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 9/2417/02/2026, 16:47 less
Spring Boot Annotations List
Copy code
@SpringBootApplication
@EnableAutoConfiguration
@ConfigurationProperties
@EnableConfigurationProperties
@SpringBootTest
@TestConfiguration
@MockBean, @SpyBean
🔹 Web / REST
less
@RequestMapping
@GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping
Copy code
@RequestParam, @PathVariable
@RequestBody, @ResponseBody
@ResponseStatus
@RequestHeader, @CookieValue
@ModelAttribute
@CrossOrigin
🔹 Exception Handling
less
@ExceptionHandler
@ControllerAdvice
@RestControllerAdvice
Copy code
🔹 Validation
less
Copy code
@Valid, @Validated
@NotNull, @NotEmpty, @NotBlank
@Size, @Min, @Max
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 10/2417/02/2026, 16:47 @Email, @Pattern
@Positive, @Negative
@Future, @Past
@Digits
Spring Boot Annotations List
🔹 JPA / Hibernate
less
@Entity, @Table
@Id, @GeneratedValue
@Column, @Transient, @Lob
@OneToOne, @OneToMany, @ManyToOne, @ManyToMany
@JoinColumn, @JoinTable
@Embedded, @Embeddable
@Enumerated, @Temporal
Copy code
🔹 Spring Data
less
@Repository
@EnableJpaRepositories
@Query
@Modifying
@Param
@Transactional
Copy code
🔹 Security
less
@EnableWebSecurity
@EnableMethodSecurity
@PreAuthorize
@PostAuthorize
@Secured
Copy code
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 11/2417/02/2026, 16:47 @RolesAllowed
@AuthenticationPrincipal
Spring Boot Annotations List
🔹 Scheduling & Async
less
Copy code
@EnableScheduling
@Scheduled
@EnableAsync
@Async
🔹 Cache
less
Copy code
@EnableCaching
@Cacheable
@CachePut
@CacheEvict
@Caching
🔹 Messaging
less
Copy code
@KafkaListener
@EnableKafka
@JmsListener
@EnableJms
@RabbitListener
@RabbitHandler
🔹 Spring Cloud
less
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 12/2417/02/2026, 16:47 Spring Boot Annotations List
Copy code
@EnableDiscoveryClient
@FeignClient
@EnableFeignClients
@LoadBalanced
@RefreshScope
@Retryable
@Recover
🔹 AOP
less
@Aspect
@Before
@After
@AfterReturning
@AfterThrowing
@Around
@Pointcut
@EnableAspectJAutoProxy
Copy code
🔹 Testing
less
@RunWith / @ExtendWith
@Test
@SpringBootTest
@WebMvcTest
@DataJpaTest
@MockBean
@AutoConfigureMockMvc
@TestPropertySource
@ActiveProfiles
@DirtiesContext
@BeforeEach, @AfterEach
Copy code
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 13/2417/02/2026, 16:47 🔹 Actuator
less
Spring Boot Annotations List
@Endpoint
@ReadOperation
@WriteOperation
@DeleteOperation
Copy code
🅔 Full Table: Annotation | Purpose | Example
Annotation Purpose Example
Copy code
@SpringBootApplicatio
n
Main entry point @SpringBootApplication public
class App {}
@Component Generic bean @Component class MyBean {}
@Service Business logic layer @Service class UserService {}
@Repository DAO layer @Repository interface UserRepo
{}
@RestControllerREST controller @RestController class
UserController {}
@Autowired Inject dependency @Autowired UserService service;
@Bean Create bean manually @Bean DataSource ds()
@Configuration Config class @Configuration class AppConfig
{}
@GetMapping HTTP GET @GetMapping("/users")
@PostMapping HTTP POST @PostMapping("/users")
@RequestBodyMap JSON to object public save(@RequestBody User u)
@PathVariable U
R
L variable @PathVariable int id
@RequestParam Query param @RequestParam String name
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 14/2417/02/2026, 16:47 Spring Boot Annotations List
Annotation Purpose Example
@ResponseStatus Custom HTTP status @ResponseStatus(HttpStatus.OK)
@ExceptionHandler Handle exception @ExceptionHandler(Exception.clas
s)
@ControllerAdvice Global exception
handler
@ControllerAdvice class GlobalEx
{}
@Entity JPA entity @Entity class User {}
@Id Primary key @Id Long id;
@GeneratedValue Auto PK @GeneratedValue(strategy=AUTO)
@OneToManyRelationship @OneToMany List<Order>
@ManyToOneRelationship @ManyToOne User user
@JoinColumn FK column @JoinColumn(name="user_id")
@Query Custom query @Query("select u from User u")
@Transactional Transaction mgmt @Transactional public void
save()
@Valid Trigger validation public save(@Valid User u)
@NotNull Field validation @NotNull String name;
@EnableScheduling Enable scheduler @EnableScheduling
@Scheduled Cron job @Scheduled(cron="0 0 * * *")
@EnableAsync Enable async @EnableAsync
@AsyncR
un async @Async public void task()
@Cacheable Cache result @Cacheable("users")
@PreAuthorize Security rule @PreAuthorize("hasRole('ADMIN')"
)
@FeignClientREST client @FeignClient("order-service")
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 15/2417/02/2026, 16:47 Spring Boot Annotations List
Annotation Purpose Example
@Aspect AOP class @Aspect class LogAspect {}
@Before Before advice @Before("execution(*)")
@Test Unit test @Test void testSave()
@SpringBootTest Full context test @SpringBootTest class TestApp {}
@MockBeanMock bean @MockBean UserService service;
@Endpoint Actuator endpoint @Endpoint(id="custom")
🎁 Next Step (Free Bonus)
I can generate for you:
✅ PDF Cheat Sheet
✅ Excel table (Annotation | Purpose | Example)
✅ Printable A4 sheet
✅ Mind map diagram
Just reply one word:
PDF or EXCEL or DIAGRAM or ALL
And I’ll generate it for you 🚀
category-wise give me annotation list
Got it 👍 You
want a pure category-wise list of Spring Boot / Spring annotations (no
explanations, no examples — just clean grouped lists).
Here is the most complete practical catalog used in real Spring Boot applications.
🟢 1. Core / IOC / Bean Management
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 16/2417/02/2026, 16:47 Spring Boot Annotations List
@Component
@Service
@Repository
@Controller
@RestController
@Configuration
@Bean
@ComponentScan
@Import
@ImportResource
@DependsOn
@Lazy
@Scope
@Primary
@Qualifier
@Profile
@PropertySource
@Value
@Autowired
@Required
@Lookup
🟢 2. Spring Boot Specific
@SpringBootApplication
@EnableAutoConfiguration
@AutoConfiguration
@ConfigurationProperties
@EnableConfigurationProperties
@ConstructorBinding
@SpringBootConfiguration
@TestConfiguration
@SpringBootTest
@MockBean
@SpyBean
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 17/2417/02/2026, 16:47 Spring Boot Annotations List
🟢 3. Web / MVC / REST
Mapping
@RequestMapping
@GetMapping
@PostMapping
@PutMapping
@DeleteMapping
@PatchMapping
Request / Response
@RequestParam
@PathVariable
@RequestBody
@ResponseBody
@ResponseStatus
@RequestHeader
@CookieValue
@ModelAttribute
@MatrixVariable
@CrossOrigin
Exception
@ExceptionHandler
@ControllerAdvice
@RestControllerAdvice
🟢 4. Validation (Jakarta / Hibernate Validator)
@Valid
@Validated
@NotNull
@NotEmpty
@NotBlank
@Size
@Min
@Max
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 18/2417/02/2026, 16:47 Spring Boot Annotations List
@Positive
@Negative
@Pattern
@Future
@Past
@Digits
@AssertTrue
@AssertFalse
🟢 5. Persistence / JPA / Hibernate
Entity
@Entity
@Table
@Id
@GeneratedValue
@Column
@Transient
@Lob
@Enumerated
@Temporal
@Version
Relations
@OneToOne
@OneToMany
@ManyToOne
@ManyToMany
@JoinColumn
@JoinTable
@MapsId
@MapKey
@OrderBy
@OrderColumn
@Embedded
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 19/2417/02/2026, 16:47 Spring Boot Annotations List
@Embeddable
🟢 6. Spring Data
@Repository
@EnableJpaRepositories
@Query
@NamedQuery
@NamedNativeQuery
@Modifying
@Param
@Procedure
@Transactional
@Lock
@EntityGraph
🟢 7. Transaction Management
@Transactional
@EnableTransactionManagement
🟢 8. Security (Spring Security)
@EnableWebSecurity
@EnableMethodSecurity
@Secured
@RolesAllowed
@PreAuthorize
@PostAuthorize
@PreFilter
@PostFilter
@AuthenticationPrincipal
🟢 9. Scheduling & Async
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 20/2417/02/2026, 16:47 Spring Boot Annotations List
@EnableScheduling
@Scheduled
@EnableAsync
@Async
🟢 10. Cache
@EnableCaching
@Cacheable
@CachePut
@CacheEvict
@Caching
🟢 11. AOP
@Aspect
@Before
@After
@AfterReturning
@AfterThrowing
@Around
@Pointcut
@EnableAspectJAutoProxy
🟢 12. Messaging (Kafka / JMS / RabbitMQ)
@EnableKafka
@KafkaListener
@SendTo
@EnableJms
@JmsListener
@RabbitListener
@RabbitHandler
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 21/2417/02/2026, 16:47 Spring Boot Annotations List
🟢 13. Spring Cloud / Microservices
@EnableDiscoveryClient
@EnableEurekaClient
@FeignClient
@EnableFeignClients
@LoadBalanced
@RefreshScope
@Retryable
@Recover
@CircuitBreaker
🟢 14. Conditional (Auto Configuration)
@Conditional
@ConditionalOnBean
@ConditionalOnMissingBean
@ConditionalOnProperty
@ConditionalOnClass
@ConditionalOnMissingClass
@ConditionalOnWebApplication
@ConditionalOnNotWebApplication
@ConditionalOnExpression
🟢 15. Actuator
@Endpoint
@ReadOperation
@WriteOperation
@DeleteOperation
@EndpointWebExtension
🟢 16. Internationalization / Formatting
@DateTimeFormat
@NumberFormat
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 22/2417/02/2026, 16:47 Spring Boot Annotations List
🟢 17. Testing
@RunWith
@ExtendWith
@Test
@BeforeEach
@AfterEach
@BeforeAll
@AfterAll
@SpringBootTest
@WebMvcTest
@DataJpaTest
@JdbcTest
@JsonTest
@RestClientTest
@AutoConfigureMockMvc
@AutoConfigureTestDatabase
@TestPropertySource
@ActiveProfiles
@DirtiesContext
⚠ Note:
There is no official single list of “every annotation” because Spring = multiple
frameworks + Jakarta EE + Spring Cloud + Testing + new
versions.
This list covers 95% of annotations used in enterprise Spring Boot projects.
If you
want, next I can give you this in:
✅ PDF cheat sheet
✅ Excel sheet
✅ Mind map diagram
✅ Top 50 most important annotations only
✅ Module-wise (spring-core, spring-web, spring-data, spring-security) list
Just say which one: PDF / EXCEL / DIAGRAM / TOP50 / M
ODULE-WISE
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 23/2417/02/2026, 16:47 Spring Boot Annotations List
https://chatgpt.com/c/69944d3b-e6c4-83a3-bde2-f701e83c8151 24/24