New answers tagged

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
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
1 vote
Accepted

Does it make sense to use byte instead of int in Java?

The rule basically consisted of checking a range between 1 and 12 Bytes don't have a range between 1 and 12. Therefore, by using a byte, you don't make your code or your intentions clearer in any way....
user avatar
1 vote

What are the advantages of externalizing application configurations?

It all boils down to changing application behavior without rebuilding. But, the reasons you might do this have to do this are helpful to consider, and they can help you determine what values should be ...
user avatar
  • 13.1k
0 votes

What are the advantages of externalizing application configurations?

"The advantage it state is that one can change the configuration without redeploying the application" This is a debatable advantage. I think the real advantages of externalising config are ...
user avatar
  • 63.9k
1 vote

What are the advantages of externalizing application configurations?

The 12-Factor App is a good intro to building services, even if it predates the microservice craze. One of its core points is the difference between the software and a deployment/instance of this ...
user avatar
  • 123k
2 votes

What are the advantages of externalizing application configurations?

There are many reasons to externalize configuration. Changing configs without redeploying is a good reason for sure, but consider the impact of storing config settings in a text file in version ...
user avatar
4 votes
Accepted

Unit testing parts that use a Value Object that is being created by a Factory

how to write unit tests for the Services that depend on this Value Object without actually using the Factory in the unit tests? You add more layers of indirection. If you have "services that ...
user avatar

Top 50 recent answers are included