Skip to main content

All Questions

1 vote
2 answers
140 views

Are the exceptions used in BeanValidation/JAX-RS's ExceptionMapper an anti pattern?

I am reading a lot about patterns and code structure and something that bothers me is BeanValidation's way to handle errors. I like Java and think that BeanValidation is easy to use, but it seems to ...
Apollo's user avatar
  • 121
1 vote
2 answers
163 views

Is passing an ErrorMessage to be populated inside the receiving method an anti-pattern?

I come from a Java background, and my colleague is from .NET. We are working on a Java project and I saw him create a method like this: public Object myMethod(Object[] param1, ErrorMessage ...
lemuel's user avatar
  • 131
34 votes
8 answers
15k views

Is throwing an exception an anti-pattern here?

I just had a discussion over a design choice after a code review. I wonder what your opinions are. There's this Preferences class, which is a bucket for key-value pairs. Null values are legal (that'...
Konrad Morawski's user avatar