Shepherd Advanced Notes
Author

Shepherd Advanced Notes

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

122
Articles
0
Likes
0
Views
0
Comments
Recent Articles

Latest from Shepherd Advanced Notes

100 recent articles max
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 24, 2024 · Backend Development

How to Properly Configure ThreadPoolExecutor Parameters in Java

This article explains the background, creation, and detailed parameters of Java's ThreadPoolExecutor, walks through its task execution flow, warns against using Executors factory methods, and provides practical formulas for setting core pool sizes based on CPU‑bound or I/O‑bound workloads.

CPUExecutorServiceI/O
0 likes · 15 min read
How to Properly Configure ThreadPoolExecutor Parameters in Java
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 20, 2024 · Backend Development

Why You Should Stop Reinventing Utility Classes and Use Hutool (or Guava) Instead

The article introduces the open‑source Java utility library Hutool, compares it with Guava, lists its modules, shows how to install it via Maven, and provides concrete code examples for HTTP requests, random codes, date handling, string manipulation, number operations, map utilities, encryption, captcha generation, and data desensitization, demonstrating how it can reduce boiler‑plate and speed up development.

Code examplesDateUtilHTTP
0 likes · 11 min read
Why You Should Stop Reinventing Utility Classes and Use Hutool (or Guava) Instead
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 10, 2024 · Fundamentals

Deep Dive into Guava: A Powerful Toolkit for Java Developers

This article provides a comprehensive guide to Google Guava, covering its core modules such as collections, concurrency, string utilities, I/O, caching, event bus, functional programming, reflection, and best‑practice code examples that demonstrate how to simplify and strengthen Java development.

CacheCollectionsEventBus
0 likes · 31 min read
Deep Dive into Guava: A Powerful Toolkit for Java Developers
Shepherd Advanced Notes
Shepherd Advanced Notes
Sep 6, 2024 · Fundamentals

Long vs BigDecimal for Monetary Values: Which Is Safer?

The article examines the long‑standing debate over using Long or BigDecimal to represent monetary amounts, presents ten community‑sourced approaches with visual illustrations, analyzes the underlying precision problem, and concludes with a recommendation favoring BigDecimal for accurate financial calculations.

BigDecimalData TypesFinancial Computing
0 likes · 9 min read
Long vs BigDecimal for Monetary Values: Which Is Safer?
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.

CollectFunctional ProgrammingJava
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 AvalancheCache Breakdown
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.

Cache AsideCanalData Consistency
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.

DelayQueueQuartzRabbitMQ
0 likes · 25 min read
11 Ways to Implement Delayed Tasks – 16k Words, 28 Diagrams