New answers tagged java
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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 ...
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 ...
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 ...
Top 50 recent answers are included
Related Tags
java × 4807design-patterns × 485
design × 476
object-oriented × 466
object-oriented-design × 228
architecture × 193
c# × 172
c++ × 153
spring × 150
interfaces × 141
exceptions × 140
programming-practices × 131
android × 121
multithreading × 118
unit-testing × 111
algorithms × 107
rest × 104
coding-style × 98
inheritance × 94
java-ee × 91
performance × 90
programming-languages × 79
database × 77
testing × 77
api-design × 76