Posts

The tools of Validation: Testing, Errors and Organization

Mastering data validation in Java and Spring. Part 4: Learn how to test validation logic, return structured API error responses, and organize validation code in Spring Boot projects. Covers Bean Validation, custom constraints, and the three layers of validation: Boundary, Domain, and Persistence.

The tools of validation: Bean validation and custom constraints

Mastering data validation in Java and Spring. Part 3: Learn the difference between @Valid and @Validated, and how to write custom constraints for domain-specific rules like Swedish personal numbers.

The Architecture of Validation: Separating Boundaries From Business Logic

Mastering data validation in Java and Spring. Part 2: How to separate boundary validation, domain invariants, and persistence rules to create maintainable architecture.

The Cost of Scattered Validation Logic

Mastering data validation in Java and Spring. Part 1: How to stop scattered null checks and defensive plumbing from complicating your business logic.

Using Enums to Make Flat File Parsing in Java More Maintainable

Stop using magic numbers in Java. Learn how to improve delimited file parsing readability and maintainability using Enum field mapping. Refactoring guide.