Tagged articles

fail-fast

6 articles · Page 1 of 1
Dabaoshi
Dabaoshi
Aug 11, 2026 · Fundamentals

Why the Iterator Pattern Is the Most Used Yet Unnoticed Design Pattern in Java

The article explains how the Iterator pattern, built into Java as Iterable and Iterator interfaces, lets you traverse any collection uniformly without exposing its internal structure, demonstrates the fail‑fast mechanism, and shows when custom collections should implement Iterable.

CollectionDesign PatternIterable
0 likes · 13 min read
Why the Iterator Pattern Is the Most Used Yet Unnoticed Design Pattern in Java
Programmer DD
Programmer DD
Oct 24, 2021 · Fundamentals

Why Adding or Removing Elements Inside a Java foreach Loop Fails

This article explains why modifying a collection during a Java foreach loop triggers a ConcurrentModificationException, explores the underlying fail‑fast mechanism in ArrayList, and demonstrates safe alternatives such as using an Iterator's remove method or a CopyOnWriteArrayList.

ConcurrentModificationExceptionIteratorJava
0 likes · 9 min read
Why Adding or Removing Elements Inside a Java foreach Loop Fails
Selected Java Interview Questions
Selected Java Interview Questions
Sep 30, 2021 · Fundamentals

Understanding the Role of modCount in Java HashMap's Fail‑Fast Mechanism

The article clarifies that the modCount field in java.util.HashMap is used to implement the fail‑fast iterator behavior, explains why the field was volatile in early JDK versions but not in later ones, and shows that ConcurrentModificationException can be thrown even in single‑threaded scenarios when the iterator detects structural changes.

ConcurrentModificationExceptionHashMapJDK
0 likes · 5 min read
Understanding the Role of modCount in Java HashMap's Fail‑Fast Mechanism
ITFLY8 Architecture Home
ITFLY8 Architecture Home
May 5, 2018 · Backend Development

How Dazhong Dianping Scaled Its Payment Gateway: Backend Architecture and Fail‑Fast Lessons

Facing rapid business growth, Dazhong Dianping’s payment gateway evolved through usable, flexible, and highly available stages, employing service splitting, master‑slave databases, fail‑fast mechanisms, and comprehensive monitoring to achieve 99.99% availability and handle peak traffic during major sales events.

Backendfail-fastpayment gateway
0 likes · 14 min read
How Dazhong Dianping Scaled Its Payment Gateway: Backend Architecture and Fail‑Fast Lessons