Hot answers tagged

3 votes

Mock a bean with 10 methods when I only use one?

A number of options come to mind: Decompose ServiceTwo into an additional interface that ServiceTwo inherits from. This new parent interface would define the two methods that ServiceOne needs, or a ...
user avatar
3 votes

What is the alternative to checked exceptions in API/interface design?

First, a lot of programmers don't realize that being forced to handle specific exceptions is not the bad part of checked exceptions. The main idea is a good one. The problem is that you have to either ...
user avatar
1 vote

What is the alternative to checked exceptions in API/interface design?

I think you have to look again at what "exceptions are meant to be". If you think of exceptions as "exceptional things which cannot be handled" then the idea of returning them as ...
user avatar
  • 63.9k

Only top scored, non community-wiki answers of a minimum length are eligible