Shepherd Advanced Notes
Author

Shepherd Advanced Notes

Dedicated to sharing advanced Java technical insights, daily work snippets, and the power of persistent effort.

127
Articles
0
Likes
403
Views
0
Comments
Recent Articles

Latest from Shepherd Advanced Notes

100 recent articles max
Shepherd Advanced Notes
Shepherd Advanced Notes
Aug 23, 2024 · Backend Development

Which Spring MVC Extension Points Parse Parameters and Handle Return Values?

This article explains the purpose and usage of Spring MVC’s HandlerMethodArgumentResolver and HandlerMethodReturnValueHandler extension points, demonstrates how to implement custom argument resolvers and return‑value handlers, discusses common pitfalls such as handler ordering, and shows how to replace the default processors to achieve unified request and response processing.

HandlerMethodArgumentResolverHandlerMethodReturnValueHandlerJava
0 likes · 16 min read
Which Spring MVC Extension Points Parse Parameters and Handle Return Values?
Shepherd Advanced Notes
Shepherd Advanced Notes
Aug 19, 2024 · Backend Development

Real-World Java Stream API: From Theory to Practical Code

This article walks through Java Stream fundamentals, showing how to replace verbose loops with concise Stream pipelines, compares map and flatMap, explains intermediate and terminal operations such as filter, sorted, distinct, limit, peek, foreach, and collect, demonstrates parallel streams, highlights common pitfalls, and summarizes the advantages and disadvantages of using Stream APIs in everyday development.

CollectJavaStream API
0 likes · 21 min read
Real-World Java Stream API: From Theory to Practical Code
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 31, 2024 · Backend Development

Understanding Redis Cache Penetration, Breakdown, and Avalanche: Differences and Solutions

The article explains the concepts of Redis cache penetration, cache breakdown, and cache avalanche, compares their causes, and provides practical mitigation techniques such as parameter validation, null‑key caching, Bloom filters, rate limiting, hot‑data pre‑warming, and multi‑level caching to protect database stability.

Bloom FilterCache PrewarmingRate Limiting
0 likes · 9 min read
Understanding Redis Cache Penetration, Breakdown, and Avalanche: Differences and Solutions
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 26, 2024 · Databases

How to Ensure MySQL‑Redis Data Synchronization Consistency (High‑Frequency Interview Question)

The article analyzes the challenges of keeping MySQL and Redis data consistent under high concurrency, compares four write‑order strategies, explains why they can cause stale cache data, and presents recommended solutions such as Cache‑Aside, distributed locks, message queues, and Canal‑based binlog syncing.

CanalData ConsistencyMySQL
0 likes · 11 min read
How to Ensure MySQL‑Redis Data Synchronization Consistency (High‑Frequency Interview Question)
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 24, 2024 · Backend Development

11 Ways to Implement Delayed Tasks – 16k Words, 28 Diagrams

This article surveys eleven Java‑based delayed‑task solutions—including DelayQueue, Timer, ScheduledThreadPoolExecutor, RocketMQ, RabbitMQ, Redis key‑expiration, Redisson, Netty’s HashedWheelTimer, Hutool SystemTimer, Quartz, and a simple polling loop—providing code demos, implementation principles, and practical pros and cons for each approach.

DelayQueueRabbitMQRedis
0 likes · 25 min read
11 Ways to Implement Delayed Tasks – 16k Words, 28 Diagrams
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 16, 2024 · Information Security

Why Developers Are Abandoning JWT for Authentication and Authorization

The article examines JWT's benefits such as statelessness and CSRF protection, then details its drawbacks—including revocation difficulty, XSS risk, and token size—and presents practical solutions like blacklists, short lifetimes, and refresh‑token strategies, helping readers decide when to use JWT versus session‑based authentication.

AuthenticationCSRFJWT
0 likes · 14 min read
Why Developers Are Abandoning JWT for Authentication and Authorization
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 12, 2024 · Backend Development

Mastering Spring MVC’s RequestBodyAdvice and ResponseBodyAdvice: Usage and Implementation Details

This article explains the purpose, core methods, and practical implementation of Spring MVC’s RequestBodyAdvice and ResponseBodyAdvice extension points, including code examples for request decryption, signature verification, response encryption, unified result wrapping, and the underlying request‑processing flow within the framework.

API SecurityRequestBodyAdviceResponseBodyAdvice
0 likes · 23 min read
Mastering Spring MVC’s RequestBodyAdvice and ResponseBodyAdvice: Usage and Implementation Details
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 5, 2024 · Backend Development

Why Switch to LocalDateTime? Master Java 8 Date/Time API and Avoid Common Pitfalls

This article explains why the legacy java.util.Date and Calendar APIs are problematic, demonstrates common bugs such as integer overflow, year‑format issues, and SimpleDateFormat thread‑safety, and shows how Java 8's immutable java.time classes like LocalDate, LocalDateTime and DateTimeFormatter provide clear, safe, and concise solutions with practical code examples.

JavaJava 8LocalDateTime
0 likes · 21 min read
Why Switch to LocalDateTime? Master Java 8 Date/Time API and Avoid Common Pitfalls
Shepherd Advanced Notes
Shepherd Advanced Notes
Jul 1, 2024 · Fundamentals

18 Essential Practices for Effectively Reading Open‑Source Code

The article outlines why reading source code matters—interview prep, skill growth, design insight—and presents a step‑by‑step guide of 18 practical habits, from mastering the JDK and design patterns to exploring demos, focusing on purpose, main flows, and thoughtful annotation.

Design PatternsJavaOpen source
0 likes · 14 min read
18 Essential Practices for Effectively Reading Open‑Source Code
Shepherd Advanced Notes
Shepherd Advanced Notes
Jun 24, 2024 · Backend Development

Understanding @ControllerAdvice: Usage and Underlying Implementation in Spring MVC

The article explains how @ControllerAdvice, a specialization of @Component, enables global exception handling, data binding, and model attribute preprocessing in Spring MVC, demonstrates practical code examples for @ExceptionHandler, @InitBinder, and @ModelAttribute, and dives into the DispatcherServlet internals that make these features work.

@ExceptionHandlerControllerAdviceInitBinder
0 likes · 15 min read
Understanding @ControllerAdvice: Usage and Underlying Implementation in Spring MVC