Guidelines

First, there are basic code standards documented for Java here: Java Code Conventions. Like most coding guidelines, these are quite reasonable and differ only in minor details from other guidelines.

The web page Java Programming Style Guidelines also has nice tips. Note that we do not prefix instance variable names with underscores; instead, we use Eclipse syntax coloring to make ivars easily visible.

We use the prefix fetch in method names in entity implementation classes to perform object navigations that are not already defined by Hibernate mappings.

Here are some additional notes:

All code should be:


   List someList = new ArrayList();
   ...
   Map someMap = new HashMap();
   ...

This lets you change your mind about implementation (for example, ArrayList to LinkedList) without breaking any code.