Tagged articles
126 articles
Page 2 of 2
Architect's Tech Stack
Architect's Tech Stack
May 3, 2020 · Backend Development

Unified Exception Handling in Spring Boot: Reducing Try‑Catch Boilerplate with @ControllerAdvice, Assert Utilities, and Enum‑Based Error Codes

This article explains how to implement unified exception handling in Spring Boot using @ControllerAdvice and custom Assert utilities, demonstrates reducing repetitive try‑catch blocks with enum‑based error codes, and shows practical testing of various error scenarios including 404, validation, and database failures.

AssertUnified responseenum
0 likes · 22 min read
Unified Exception Handling in Spring Boot: Reducing Try‑Catch Boilerplate with @ControllerAdvice, Assert Utilities, and Enum‑Based Error Codes
Java Captain
Java Captain
May 1, 2020 · Backend Development

Unified Exception Handling in Spring Boot Using Assert and Enum-based Error Codes

This article demonstrates how to replace repetitive try‑catch blocks in Java Spring applications with a unified exception handling approach that leverages @ControllerAdvice, custom Assert utilities, and enum‑based error codes to produce clean, maintainable, and internationalized error responses across controllers and services.

AssertException HandlingJava
0 likes · 20 min read
Unified Exception Handling in Spring Boot Using Assert and Enum-based Error Codes
Programmer DD
Programmer DD
Jan 2, 2020 · Backend Development

Why Do Some Developers Hate Using Enums in API Design?

The article examines why enums, while type‑safe and convenient for input parameters, are often criticized in API return values due to their lack of extensibility and the risk of deserialization errors when newer enum constants appear after version upgrades.

Backend DevelopmentJavaapi-design
0 likes · 4 min read
Why Do Some Developers Hate Using Enums in API Design?
Java Captain
Java Captain
Jan 1, 2020 · Fundamentals

Why Enums Are Considered Poor Choices for API Return Values

The article explains why using enums as API return values is often criticized, highlighting their lack of extensibility, potential serialization errors when newer enum values appear, and contrasting this with the safety they provide as input parameters, illustrated with Java examples and community opinions.

JavaSoftware Architectureapi-design
0 likes · 4 min read
Why Enums Are Considered Poor Choices for API Return Values
Selected Java Interview Questions
Selected Java Interview Questions
Oct 20, 2019 · Fundamentals

Java Singleton Pattern Implementations and Variants

This article explains four main categories of Java singleton implementations—eager (hungry), lazy (lazy), holder, and enum—detailing their basic forms, variations, thread‑safety characteristics, performance trade‑offs, and code examples, while also discussing pitfalls such as reflection and serialization.

JavaSingletondesign pattern
0 likes · 10 min read
Java Singleton Pattern Implementations and Variants
Programmer DD
Programmer DD
Sep 3, 2019 · Backend Development

Mastering Java State Machines with Enums: A Practical Guide

This article explains how Java developers can replace cumbersome if‑else status handling with a finite state machine implemented via enums, illustrating concepts, design patterns, and a complete example of an order‑delivery workflow, complete with diagrams and sample code.

Backend DevelopmentJavadesign pattern
0 likes · 6 min read
Mastering Java State Machines with Enums: A Practical Guide
Programmer DD
Programmer DD
Aug 4, 2019 · Backend Development

Master MyBatis TypeHandler: Elegant Enum Mapping and Custom Handlers

Learn how to replace fragile numeric status codes with clean enum handling in Java using MyBatis TypeHandler, explore built‑in handlers like EnumOrdinalTypeHandler and EnumTypeHandler, and create custom handlers for seamless database‑Java type conversion, complete with configuration tips and practical examples.

JavaMyBatisORM
0 likes · 9 min read
Master MyBatis TypeHandler: Elegant Enum Mapping and Custom Handlers
Java Captain
Java Captain
Mar 9, 2019 · Fundamentals

Understanding Java Enums: Usage, Switch Cases, Singleton Implementation, and Database Integration

This article explores Java enums in depth, covering their basic definition, typical usage patterns such as iteration and switch statements, implementing singletons, integrating with databases via MyBatis type handlers, and addressing common misconceptions about memory consumption, illustrating each concept with clear code examples.

JavaMyBatisSingleton
0 likes · 7 min read
Understanding Java Enums: Usage, Switch Cases, Singleton Implementation, and Database Integration
Java Captain
Java Captain
Oct 2, 2018 · Fundamentals

Understanding the Singleton Design Pattern in Java: Lazy, Eager, Double‑Check, Volatile, Static Inner Class and Enum Implementations

This article explains the Singleton design pattern in Java, covering its definition, the differences between lazy and eager implementations, thread‑safety issues, multiple code versions (simple, synchronized, double‑checked locking, volatile), and alternative approaches using static inner classes and enums, while discussing atomic operations and instruction reordering.

JavaSingletondesign pattern
0 likes · 14 min read
Understanding the Singleton Design Pattern in Java: Lazy, Eager, Double‑Check, Volatile, Static Inner Class and Enum Implementations
Senior Brother's Insights
Senior Brother's Insights
Aug 23, 2018 · Fundamentals

Mastering the Singleton Pattern in Java: Eager, Lazy, Double‑Check, and More

Explore the GOF 23 design patterns with a deep dive into the Singleton pattern, covering its purpose, characteristics, comparison to static classes, and multiple Java implementations—including eager, lazy, double‑checked locking, volatile, static inner class, and enum approaches—plus Spring’s real‑world usage.

Design PatternsJavaSingleton
0 likes · 12 min read
Mastering the Singleton Pattern in Java: Eager, Lazy, Double‑Check, and More
Java Backend Technology
Java Backend Technology
Apr 17, 2018 · Backend Development

Mastering the Singleton Pattern in Java: Eager, Lazy, and Thread‑Safe Implementations

This article explains the concept of design patterns and dives deep into the Singleton pattern in Java, covering its purpose, eager and lazy implementations, thread‑safety challenges, double‑checked locking, volatile usage, static inner class, and enum approaches, while illustrating each with clear code examples and diagrams.

Double-Check LockingJavaSingleton
0 likes · 11 min read
Mastering the Singleton Pattern in Java: Eager, Lazy, and Thread‑Safe Implementations
Programmer DD
Programmer DD
Dec 6, 2017 · Fundamentals

Mastering Java Singleton: From Lazy Initialization to Enum with Thread‑Safety

This article walks through multiple Java Singleton implementations—lazy initialization, double‑checked locking, volatile‑protected, static‑inner‑class, and enum—explaining their thread‑safety characteristics, the pitfalls of instruction reordering, and how reflection and serialization can break or preserve the pattern.

JavaSingletondesign pattern
0 likes · 10 min read
Mastering Java Singleton: From Lazy Initialization to Enum with Thread‑Safety
Senior Brother's Insights
Senior Brother's Insights
Dec 4, 2017 · Fundamentals

Mastering Thread‑Safe Singleton in Java: Double‑Check, Static Holder, Enum & Reflection Hacks

Explore multiple Java singleton implementations—including a thread‑safe double‑checked locking version, a static inner‑class approach, an enum‑based solution, and a reflection‑based attack—while learning their key technical details, advantages, pitfalls, and how to protect against serialization and reflection vulnerabilities.

JavaReflectionSingleton
0 likes · 6 min read
Mastering Thread‑Safe Singleton in Java: Double‑Check, Static Holder, Enum & Reflection Hacks
Tencent TDS Service
Tencent TDS Service
Mar 9, 2017 · Mobile Development

Mastering the Singleton Pattern in Android: Pitfalls, Best Practices, and Real‑World Implementations

This article explores the Singleton design pattern in depth, covering its definition, various Java implementations, thread‑safety concerns, serialization, reflection and cloning pitfalls, Android‑specific considerations, and practical recommendations for using singletons effectively in mobile projects.

JavaSingletondesign pattern
0 likes · 38 min read
Mastering the Singleton Pattern in Android: Pitfalls, Best Practices, and Real‑World Implementations