Naming conventions
Method parameter Names
java.lang.Exception
and subclasses:ex
java.awt.event
and subclasses:evt
java.sql.Connection
s:con
java.sql.PreparedStatement
s:stmt
java.sql.Statement
s:stmt
java.sql.ResultSet
:rs
- GUI elements in containers prepended by their type without
J for
JComponent
s, e.g.listKeywords
,buttonCancel
. So it's easier to find a specific element through code completion.
Resource Bundle keys
- Every key starts with the class' simple name, e.g.
"ThumbnailCache"
- After a dot one follows a type identifier, most common are:
- Info for information messages
- Error for warnings and errors
- Input for user input dialog text
- Confirm for confirmation messages
- DisplayName for strings on menu items etc.
- After a dot follows a individual message shortcut.
- Examples:
KeywordsHelper.Info.Rename
CopyToDirectoryDialog.Error.TargetDirectoryDoesNotExist
ModifySavedSearches.Input.NewName
DeleteImageFiles.Confirm.Delete
PopupMenuThumbnails.DisplayName.MenuPlugins
Author: Elmar Baumann
Write e-Mail
Status of this document: 2010-04-04