Coding conventions for the Apache Trinidad Podling
- Private members and methods use underscore (_) prefix
- Package-private use double underscore prefixes.
This is intentionally ugly; we strongly discourage the use of package-private access, and in general recommend everything receive the most limited access possible.
- Constants can be placed in uninstanciable classes if needed, always access them using fully qualified names. Do NOT use implements on interfaces defining constants, that practice is discouraged. Static imports should not be used either.
- Constants and attributes are defined at the end of the class files, after methods
- Constant names are in uppercase, with each words separated with an underscore (standard rule)
- Method and variable names are in lowercase except for the first letter of every word after the first forming them that should be in uppercase
Methods appear in the following order: constructor, public, protected, package, private.
- Generics are used, but not always. Apache Trinidad (formal ADF Faces) started as a JDK 1.2 codebase, so not used all over the place. We're converting piece-by-piece.
- no calls to System.out/err.println
- 2 space indent, no use of tabs allowed at all.
- Braces are always on new lines
- Using assert as #ifdef DEBUG (boolean debugEnaled = false; assert debugEnabled = true; if(debugEnabled)//do something) is forbidden.