The most practical Java pattern used in real production systems: Record Builder for immutable DTOs:
In real-world Java projects (Spring Boot APIs, microservices, event-driven systems, data pipelines), we create dozens of DTOs every week for requests, responses, events, and projections.
The best modern pattern in 2026:
Records (immutable by default) Builder pattern for flexible construction while keeping immutability.
Benefits:
- Immutable → thread-safe and predictable
- No boilerplate getters/setters
- Builder gives nice fluent API for optional fields
- Works perfectly with Jackson, MapStruct, validation, etc.
Realistic production example below: