Quantcast
Channel: Best Practices - HowToDoInJava
Browsing latest articles
Browse All 26 View Live

5 class design principles [S.O.L.I.D.] in java

Classes are the building blocks of your java application. If these blocks are not strong, your building (i.e. application) is going to face the tough time in future. This essentially means that not so...

View Article


8 signs of bad unit test cases

If you have been in software development for a long time, then you can easily relate with the importance of unit testing. Experts say that most of bugs can be captured in unit testing phase itself,...

View Article


How to correctly set result path in struts 2

Here, result path means the location of JSP files or other view files which Struts 2 will resolve after executing the code in Action classes. These result paths are mentioned in “location” of @Result...

View Article

Best practices to improve JDBC performance

Java database connectivity (JDBC) is the JavaSoft specification of a standard application programming interface (API) that allows Java programs to access database management systems. The JDBC API...

View Article

Do not specify version numbers in Spring schema references

If you have worked on Spring projects, then you must have seen spring configuration files where in header you specify the schema references for various spring modules. In schema references, we mention...

View Article


Java Serialization – Dos and don’ts for correct serialization

Java Serialization - Dos and don'ts for correct serialization and deserialization. Learn to use serialVersionUID, readObject and writeObject with example. The post Java Serialization – Dos and don’ts...

View Article

Performance Comparison – Different For Loops in Java

For loop is very common control flow statement in programming languages such as java. I am not going to describe the basics of “for loop” as it is beyond the scope of this article and most of us are...

View Article

Use Array instead of Vector.elementAt() for Better Performance

Vector is a another legacy implementation of List interface provided with java bundle. It is almost similar to ArrayList expect it is synchronized also. It has its own advantages as well as...

View Article


Top 20 Java Exception Handling Best Practices

Learn the top Java exception handling best practices to follow in any Java application. These best practices are application for kind of java applications. The post Top 20 Java Exception Handling Best...

View Article


Java ConcurrentHashMap Best Practices

The ConcurrentHashMap is very similar to the HashMap class, except that ConcurrentHashMap offers internally maintained concurrency. It means you do not need to have synchronized blocks when accessing...

View Article

Java Naming Conventions

Java naming conventions are sort of guidelines which application programmers are expected to follow to produce a consistent and readable code throughout the application. If teams do not not follow...

View Article

Java Custom Exceptions and Best Practices

We have been using handling java custom exceptions in our code for almost every industry standard application. Usual approach is to create some custom exception classes extending the base The post Java...

View Article

Unit Testing Best Practices

It is overwhelmingly easy to write bad unit tests that add very little value to a project while astronomically inflating the cost of code changes. This post will go through the JUnit best practices we...

View Article


Unit Testing DAO Layer

If you are working in a project built on Spring, hibernate or JPA, and you want to unit test it’s data access layer (DAO) then information given in this tutorial may help you. As we are going to test...

View Article

Java Web Application Performance Improvement

Web application’s performance is very critical for the success of the project, in any company and with any client. You should have a good thought process about possible bottlenecks and their solutions....

View Article


FIRST Principles for Writing Good Unit Tests

In any application, which solves real-world problems, having problems in its unit tests – is the least desirable thing. Good written tests are assets while badly written tests are burden to your...

View Article
Browsing latest articles
Browse All 26 View Live