This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.
The license (Mozilla version 1.0) can be read at the MMBase site. See http://www.mmbase.org/license
Table of Contents
The following is a short summary of coding standards that need to be applied to source code.
All future sources need to conform to these standards.
These conventions were based on suggestions from the following documents:
Code Conventions for the JavaTM Programming Language
This is the basis for these guidelines. Unless otherwise specified, the conventions described here follow those as outlined in the above document.
AmbySoft Inc. Coding Standards for Java
This document contains several suggestions which were used to expand the standard conventions, especially for naming identifiers.
Ottinger's Rules for Variable and Class Naming
This document also contains suggestions for naming, focused on improving the readability of your code.
Use Single line documentation (// ...) for in-code documentation.
Single line comments should be on their own line, preceding the statement concerned. The exception is local variables declaration, where the line comment may follow directly behind the declaration.
Required javadoc tags:
For a class/interface:
@author (by alphabetical order)
@version (versions should be annotated with @version $Id: codingstandards.xml,v 1.6 2004/02/17 10:21:13 gerard Exp $ , so that CVS can insert the correct version number.)
For a member function:
@param
@return
@exception
From version 1.5 of MMBase and onwards, new classes and member functions should contain the @sincetag (i.e. @since MMBase-1.6)
The version to use during development will be defined by the MMC.
Use Single line documentation (// ...) for in-code documentation.
Single line comments should be on their own line, preceding the statement concerned. The exception is local variables declaration, where the line comment may follow directly behind the declaration.
Names should be full English descriptors where possible. They should be smaller than 20 characters and unique within the context.
Interface names may be :
Case:
Indentation is four spaces for each block. Do not use tabs.
This deviates from some standards, there are differences in how people use tabs or how editors show them. The alternate would be to use ONLY tabs (which is not likely to work).
Placing of braces for blocks follow the C-standard :
statement {
otherstatement;
}
Elements in a class should be ordered in the following way:
This is part of the MMBase documentation.
For questions and remarks about this documentation mail to: documentation@mmbase.org