STREAM API / CATATAN</>↗Stream API06 Jul 2026
Using Java Streams readably is mostly about using them where they express intent clearly and avoiding “clever” pipelines that hide business logic. Good uses of Streams Streams are great when you are doing simple collection transformations: List<String> activeUserEmails = users.stream() .filter(User::isActive) .map(User::getEmail) .toList(); This reads almost like a sentence: From users, keep active ones, get […]
SPRING BOOT / CATATAN</>↗Spring Boot05 Jul 2026
The “right way” to build a REST API in Java with Spring Boot is not just about making URLs return JSON. A good REST API should be: Cleanly structured Easy to test Easy to maintain Validated properly Consistent in error handling Separated into controller, service, repository, entity, and DTO layers Built around HTTP semantics, not […]
DOCKER / CATATAN</>↗Docker04 Jul 2026
Containerizing and Deploying a Java Application with Docker A typical Java Docker workflow is: Build the Java application Package it as a JAR Create a Docker image Run the container locally Push the image to a registry Deploy it to a server or cloud platform 1. Build Your Java Application If your project uses Maven, […]
BASIC / CATATAN</>↗Basic04 Jul 2026
Understanding Java’s Evolution from Java 8 to Java 25 A good way to understand Java’s evolution from Java 8 to Java 25 is to view it in phases: Java 8 established modern Java’s functional-programming foundation. Java 9–11 reshaped the platform and release model. Java 12–17 modernized the language with records, pattern matching, text blocks, and […]
SPRING / CATATAN</>↗Spring04 Jul 2026
Typical Spring Layer Organization A clean Spring application usually separates code into controller, service, repository, and model/entity layers. com.example.app ├── AppApplication.java ├── controller │ └── UserController.java ├── service │ └── UserService.java ├── repository │ └── UserRepository.java ├── entity │ └── User.java └── dto ├── CreateUserRequest.java └── UserResponse.java The usual request flow is: HTTP Request ↓ […]
SPRING / CATATAN</>↗Spring04 Jul 2026
In Spring, transactions are usually managed with the @Transactional annotation. A transaction makes sure that a group of database operations is either: all succeed, or all fail and roll back This is important when one business operation changes multiple records or tables. 1. Enable Transaction Management If you are using Spring Boot with Spring Data […]