|
RIFE : Code conventions
This page last changed on Apr 08, 2006 by atao.
Code conventionsThe rules are set in two parts, style and programming practices. About style, are listed only rules that differ from [1] or are unspecified. Ref.:
StyleCommentsPackage comment ([2])Each package must have its own package-level doc comment source file. The minimal template is: <html>
<body>
Provides interfaces and classes for IoC capable properties that resolve and obtain their values at run-time.
</body>
</html>
Usually, the comment will have some links: <html> <body> Provides classes and interfaces for the mail queue. <h2>Related Documentation</h2> For overviews, tutorials, examples, guides, and documentation, please see: <ul> <li><a href="http://rifers.org/wiki/display/RIFE/Mail+queue">[Wiki] Mail queue</a></li> </ul> </body> </html> Class file comment ([1], chap. 3)Each class file must start with: /* * Copyright 2001-2006 Geert Bevin <gbevin[remove] at uwyn dot com> * Distributed under the terms of either: * - the common development and distribution license (CDDL), v1.0; or * - the GNU Lesser General Public License, v2.1 or later * $Id$ */ If there are many contributors, add them after the first one: /* * Copyright 2001-2006 Geert Bevin <gbevin[remove] at uwyn dot com>; and * Bertrand Durand <bdurand[remove] at icietpartout dot com> [...] Import statements ([1], chap. 3)The usual order is first the non JDK imports and then the JDK ones. Also, first the wildcart imports and then the single ones. As soon as there are 5 single ones of the same package, they become a wildcart import. Indentation ([1], chap. 4)
Statement ([1], chap. 7)See also ([1], ยง 6.4) Compound statements are statements that contain lists of statements enclosed in braces "{ statements }".
Exception:
Blank space ([1], chap. 8)
Naming Conventions ([1], chap. 9)
public void yourMethod() { String this_is_my_string = "value"; }
public void yourMethod(String theMethodParameter) { ... }
private Object mParameter = null; private String mName = null;
public static Object sParameter = null;
public final static Object PARAMETER = null; Miscellaneous Practices
Programming practices
if (null == parameter || 123 == value) { ... }
if ("sometext".equals(text)) { ... } |
| Document generated by Confluence on Oct 19, 2010 14:56 |