Subversion Repositories linid-dm

[/] [wui/] [tags/] [2.0/] [T5-java-codingstyle.txt] - Rev 332

Compare with Previous | Blame | View Log

This file define the common rules and convention about the organization of the Java
code of Tapestry Pages and Components.

This classes consist of several kind of block. 
Each kind of block must be preceded by an *visible* comment,
as show here after. The order of blocks is madatory.
Block may be omitted if there is no such code in the class, or let 
empty so that everybody is sur that there no such kind of code
in the class.

Aa easy  copy&past :

        /* ***********************************************************
         *                         Parameters
         ************************************************************ */

        /* ***********************************************************
         *                      Injected services
         ************************************************************ */

        /* ***********************************************************
         *                      Injected components
         ************************************************************ */
         
        /* ***********************************************************
         *                Properties & ASO, etc
         ************************************************************ */
         
                                         /* ==== END OF PROPERTIES ==== */
         
        /* ***********************************************************
         *                       Phase processing
         ************************************************************ */
         
        /* ***********************************************************
         *                   Event handlers&processing
         ************************************************************ */

        /* ***********************************************************
         *                          Helpers
         ************************************************************ */        
        
        /* ***********************************************************
         *                          Helpers
         ************************************************************ */
        
        /* ***********************************************************
         *                      Getters & Setters
         ************************************************************ */ 
         
Details in Kinds of block :

Parameters 
===========
* Comment to copy&paste before :

        /* ***********************************************************
         *                         Parameters
         ************************************************************ */
* description
Parameter are component parameters : private attributes with 
@Parameter annotation.

Injection
==========
* Comment to copy&paste before :

        /* ***********************************************************
         *                Injected services (properties, etc)
         ************************************************************ */  

* description
Here goes injected service, properties, environnemental, etc.
One may define a block by kind of injection. 
Each kind of injection should be set in after "Injected ".

Properties
===========
* Comment to copy&paste before :

        /* ***********************************************************
         *                         Properties
         ************************************************************ */

* description
Here goes attribute that are not parameters. These
attribute may be managed (with @Persist annotation, for ex).

Phase processing
=================
* Comment to copy&paste before :

        /* ***********************************************************
         *                       Phase processing
         ************************************************************ */

* description
Here goes method that deals with rendering phases, as describes here :
http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html
(such as method annotated with @setupRender, etc).


Events handling
================
* Comment to copy&paste before :

        /* ***********************************************************
         *                   Event handlers&processing
         ************************************************************ */

* description
Here goes event handling and methods alike ( onActivate, onPassivate).

Helpers
========
* Comment to copy&paste before :

        /* ***********************************************************
         *                          Helpers
         ************************************************************ */
         
* description
Here goes (private or protected) methods used elsewhere in the code as helper. 


Javascript
=============
* Comment to copy&paste before :

        /* ***********************************************************
         *                          Javascript
         ************************************************************ */
         
* description
Here goes method that should render Javascript code. For now, Javascript
support in T5 is somewhat strange, so we have to do it by hand.


8/Getters / Setters
* Comment to copy&paste before :

        /* ***********************************************************
         *                      Getters & Setters
         ************************************************************ */

* description
Getters and setters for code used in template.
         

Compare with Previous | Blame | View Log