Live data from Hacker News

Java Bean Validation Is an Anti-Pattern (2022)

backendhance.com

1–2 of 2 posts

Re: Java Bean Validation Is an Anti-Pattern (2022)

#2
I find annotation-based programming of any kind to be fraught. It looks great, but it's prone to hard-to-fix bugs. The bugs usually result in something not happening, and because the control flow isn't top-to-bottom, you have no idea when it "didn't happen". There's no place you can put a breakpoint, unless it's deep down in the source code of some kind of container.

As much as this kind of mix-in looks like it's very natural and ordered, I prefer not to use it, because I find it makes for brittle code that's hard to maintain.