New answers tagged java
1
vote
What is the best way to comment a deprecated class in Java?
What you do not do is remove any documentation.
Think about it: The class is deprecated so I want to replace all its uses. And I want to do that without breaking anything. To replace uses of the class ...
1
vote
Should business logic classes be POJO only?
I think the term POJO is a distraction. It was basically a joke:
... We wondered why people were so against using regular objects in their systems and concluded that it was because simple objects ...
8
votes
Accepted
Should business logic classes be POJO only?
I read about three-tier architecture and I have a question: I read that in business logic (that is, what is in logic tier) there should be bare Java classes,
These bare Java classes are called POJO's ...
2
votes
Should business logic classes be POJO only?
Spring is just a library/framework, is there any difference between Spring and the JDK, at the end of the day both are just code written by someone else...
If you take your argument to the next ...
1
vote
Accepted
Feasibility of using different java version for different project with different compatibility properties
For command line use JEnv: https://www.jenv.be/
It allows you to set the JDK to use on a per directory/project basis.
TIP: You can commit the .java-version file to source control, so only the first ...
2
votes
How does the MVC pattern actually work?
I’m completely lost on what actually belongs in each layer and the best way to organize the code as a whole.
You have come to a crucial realization: MVC is not a comprehensive software architecture.
...
1
vote
The best way to handle exceptions?
I think a good approach here would be to use a try-catch block in your method to print the stack trace and return null if an exception occurs
Something like this:
import com.opencsv.bean....
5
votes
The best way to handle exceptions?
Since I only want the error and stack trace to be printed in the console and the application to be terminated, what is the best approach to deal with this?
If you don't want to handle a checked ...
13
votes
The best way to handle exceptions?
Sometimes the best way to handle an exception is not at all.
Since I only want the error and stack trace to be printed in the console and the application to be terminated, what is the best approach ...
5
votes
The best way to handle exceptions?
Let the exceptions bubble up to your caller, by just adding a throws clause to the ler() method.
If someone calls your ler() method, it's important for them to know whether that was successful, ...
13
votes
The best way to handle exceptions?
For the purposes of this method that returns a list, just don't catch exceptions. Let it throw.
Unhandled exceptions in your application still need to be handled, but the error handling occurs much ...
3
votes
How does the MVC pattern actually work?
In short: Views send UI Events to Controllers, Controllers figure out from Events what to send to Models, and Models, once processed data from Controllers, let Views know data has changed.
The short ...
0
votes
Allowing users to add their own custom fields in a Spring MVC Hibernate application - What's an ideal approach?
Consider map approach, creating field on runtime in database in my opinion is a bad practice.
With map approach you can enable dynamic-like field in database where key can be your field name and value ...
Top 50 recent answers are included
Related Tags
java × 4986design-patterns × 505
design × 497
object-oriented × 485
object-oriented-design × 248
architecture × 205
c# × 175
spring × 159
c++ × 153
interfaces × 153
exceptions × 147
programming-practices × 135
android × 124
multithreading × 123
unit-testing × 114
rest × 112
algorithms × 108
coding-style × 105
inheritance × 99
performance × 91
java-ee × 91
api-design × 86
programming-languages × 82
database × 81
testing × 80