Tagged articles
127 articles
Page 2 of 2
Top Architect
Top Architect
Jun 9, 2020 · Backend Development

Unified Exception Handling in Spring Boot Using @ControllerAdvice, Assert, and Enum‑Based Error Codes

The article explains how to replace repetitive try‑catch blocks with a unified exception handling mechanism in Spring Boot by leveraging @ControllerAdvice, custom BaseException, enum‑driven error codes, Assert utilities, and standardized response objects to improve code readability and maintainability.

AssertEnumException Handling
0 likes · 21 min read
Unified Exception Handling in Spring Boot Using @ControllerAdvice, Assert, and Enum‑Based Error Codes
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.

AssertEnumUnified response
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.

AssertEnumException Handling
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 DevelopmentEnumJava
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.

EnumJavaSoftware Architecture
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.

EnumJavaSingleton
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 DevelopmentEnumJava
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.

EnumJavaMyBatis
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.

DatabaseEnumJava
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.

EnumJavaSingleton
0 likes · 14 min read
Understanding the Singleton Design Pattern in Java: Lazy, Eager, Double‑Check, Volatile, Static Inner Class and Enum Implementations
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 LockingEnumJava
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.

EnumJavaSingleton
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.

EnumJavaReflection
0 likes · 6 min read
Mastering Thread‑Safe Singleton in Java: Double‑Check, Static Holder, Enum & Reflection Hacks