General Style
- Standard Java coding conventions (download the PDF, because the HTML version is very badly formatted in some places)
- Also read http://dev.magnolia-cms.com/~gjoseph/on-code-readability
Indention
- Tab policy: spaces only
- Indentation: 4 spaces
- Maximum line width: 120 (no strong rule here - don't put exceptions declarations on new lines just to respect this, for instance)
Naming
- We preferably don't use abbreviations in classnames (only exception to that rule is MgnlSomething)
If-statements
- Single-line if-statements: we always use curly braces
- Unnecessary else-branch: if the else is not necessary (e.g. because if-branch always returns or throws an exception) we omit it
Overrides
- for optimal refactoring support we use the @Override for all methods that override methods declared in superclasses/implemented interface
- Hint: you might want to adapt compiler settings of your IDE to show Errors on missing @Override's (Eclipse and Idea provide that option)
$NON-NLS-1$
- if you come across a //$NON-NLS-1$ please just delete it - that's legacy stuff created by Eclipse - we don't want to keep that!
Overview
Content Tools
Apps
Activity