http://xml.apache.org/http://www.apache.org/http://www.w3.org/


Overview
Installation
Features
Resources
FAQ

Content Syndication
Customizer
iCalendar
WAP

Development
PSML
Disk Cache
How to Write Portlet
Developers Guide
Coding Standards

To Do List
Contributors
CVS Branches

Code Repository
Javadoc
Download
License


As more developers submit code to Jetspeed, it is important that we all adhere to the same types of coding styles. This document was created to provide a set of guidelines for future development.

Use of JavaDoc
  • Use javadoc on all methods.
  • If you define an interface and then provide and implementation of this interface use @see tags to point Javadoc back to the interface method. You should then keep all your Javadoc defined in the interface so that it isn't duplicated in your implementation.
  • Describe all return values (@returns), method parameters (@param) and Exceptions (@throws)
  • If you define a new method make sure to include a package.html which defines what this package does.
  • If you make a change to a method or class, please add yourself to the @author tags. Please also include your e-mail address.

Java Syntax

Please use spaces within methods, and parameters:


Instead of:

    this.test(true,true,"test",true);
    
please use:

    this.test( true, true, "test", true );
            

Use of brackets. Some developers have personal a preference to how they place brackets within their source code:


    if ( true ) {
        //body
    }
    
    or 
    
    if ( true ) 
    {
        //body
    }
    
            

Please choose whatever style you want for new files but you should maintain the existing style of source you wish to modify.

If you have a method with multiple parameters, seperate them across multiple lines.


    Instead of having a long list of parameters on one one line, break your parameter
    list across several lines:

        private final PortletSet getPortlets( Portlets portlets, RunData rundata, boolean application, boolean applicationsOnly ) {
        }
    
        private final PortletSet getPortlets( Portlets portlets, 
                                              RunData rundata, 
                                              boolean application, 
                                              boolean applicationsOnly ) {
        }


Misc.
  • File structuring. Try to keep everything organized according to the current directory structure. For example do no put documentation within the ./src/java directory.
  • Try not throw a basic java.lang.Exception. All Exceptions thrown within Jetspeed which describe an internal problem should extend org.apache.jetspeed.util.JetspeedException (see PortletException.java)


Copyright © 2000 The Apache Software Foundation. All Rights Reserved.