SPRING CORE / NOTES</>↗Spring Core06 Jul 2026
In a Spring application, some logic does not belong to just one business feature. For example: Logging method calls Measuring execution time Checking security rules Managing transactions Auditing user actions Handling repeated exception logic These are called cross-cutting concerns because they “cut across” many parts of your application. Instead of copying the same logging, auditing, […]
SPRING CORE / NOTES</>↗Spring Core06 Jul 2026
In Spring, events let one part of your application publish something that happened, while other parts react to it without being tightly coupled. Typical use cases: Send an email after user registration Clear a cache after data changes Audit an action Trigger async background processing React to transaction completion Spring has built-in support through: ApplicationEventPublisher […]
SPRING CORE / NOTES</>↗Spring Core06 Jul 2026
Writing Unit Tests for Spring Components For Spring components, you usually want to test business logic without starting the full Spring application context. That means using JUnit 5 and Mockito for most unit tests. Use Spring’s test support only when you need Spring-specific behavior such as dependency injection, MVC request handling, configuration binding, or persistence […]
SPRING SECURITY / NOTES</>↗Spring Security06 Jul 2026
Securing a Java web application typically means adding: Authentication — verifying who the user is. Authorization — deciding what the authenticated user can access. Session/token protection — keeping the login state secure. Transport and application hardening — HTTPS, CSRF protection, password hashing, etc. Since your stack includes Spring MVC / Spring Data JPA / Jakarta […]
STREAM API / NOTES</>↗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 / NOTES</>↗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 […]