SPRING CORE / CATATAN</>↗Spring Core05 Jul 2025
Circular dependencies in Spring occur when two or more beans depend on each other, forming a cycle. For example, if BeanA depends on BeanB, and BeanB needs BeanA, a circular dependency is formed. Here are several ways to resolve such issues: 1. Using @Lazy Annotation Spring allows injecting dependencies lazily. The @Lazy annotation delays the […]
SPRING BOOT / CATATAN</>↗Spring Boot04 Jul 2025
Creating a simple REST API using Spring Boot can be a smooth process, and it is entirely possible to get it done in under 10 minutes. Here’s a step-by-step guide to building your first REST API: 1. Setup Your Spring Boot Project Go to Spring Initializr. Configure the project: Project: Maven. Language: Java. Spring Boot […]
SPRING CORE / CATATAN</>↗Spring Core03 Jul 2025
Spring Profiles provide a flexible way to load environment-specific configurations in a Spring-based application. Here’s a step-by-step guide on how to use them: Steps to Inject Environment-Specific Values Using Spring Profiles Define Profile-Specific Properties Files Create separate property files for different environments (e.g., development, testing, production). Make sure to name them with a clear convention. […]
SPRING BOOT / CATATAN</>↗Spring Boot02 Jul 2025
Dependency Injection (DI) is a fundamental concept in Spring Boot that facilitates the management of dependencies between various components in your application. Spring Boot primarily uses the @Autowired annotation to enable automatic wiring of beans. Below, I’ll explain how Dependency Injection works using @Autowired in Spring Boot, step by step. What is Dependency Injection? Instead […]
SPRING CORE / CATATAN</>↗Spring Core01 Jul 2025
In Spring, the lifecycle of a bean can be managed, and you can hook into these lifecycle phases using annotations like @PostConstruct and @PreDestroy. @PostConstruct: This annotation is part of Jakarta annotations (not proprietary to Spring). It is used to execute initialization logic after the bean’s properties have been set (i.e., after dependency injection is […]
SPRING BOOT / CATATAN</>↗Spring Boot30 Jun 2025
The @SpringBootApplication annotation is a cornerstone of any Spring Boot application. It simplifies the configuration process and integrates core functionalities of Spring Boot in a single, convenient annotation. Here’s a comprehensive explanation to help you understand its importance and functionality: What is @SpringBootApplication? @SpringBootApplication is a composite annotation that combines three common Spring annotations to […]