Tagged articles

Static Final

3 articles · Page 1 of 1
samdeepthink
samdeepthink
Jun 1, 2026 · Backend Development

Why One ThreadLocal Instance Suffices for an Entire Business Scenario

The article explains that a single ThreadLocal object can be shared across dozens of threads because the actual data lives in each thread's own ThreadLocalMap, outlines how set/get work, highlights thread‑pool pitfalls such as stale data and memory leaks, and provides best‑practice guidelines for static declaration, proper removal, and using TransmittableThreadLocal for cross‑thread propagation.

Static FinalThread PoolThreadLocal
0 likes · 10 min read
Why One ThreadLocal Instance Suffices for an Entire Business Scenario
LuTiao Programming
LuTiao Programming
Dec 16, 2025 · Fundamentals

Stop Misusing Constants: Why Java Enums Are Replacing static final

The article explains why traditional static final String constants are error‑prone and demonstrates how Java enums—introduced in Java 5—provide stronger type safety, clearer semantics, built‑in methods, and safer switch handling, making them a superior modeling choice for fixed, related values.

EnumStatic FinalSwitch
0 likes · 8 min read
Stop Misusing Constants: Why Java Enums Are Replacing static final