Subversion Repositories linid-dm

[/] [wui/] [branches/] [2.0/] [T5-java-codingstyle.txt] - Diff between revs 332 and 344

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 332 Rev 344
This file define the common rules and convention about the organization of the Java
This file define the common rules and convention about the organization of the Java
code of Tapestry Pages and Components.
code of Tapestry Pages and Components.
This classes consist of several kind of block.
This classes consist of several kind of block.
Each kind of block must be preceded by an *visible* comment,
Each kind of block must be preceded by an *visible* comment,
as show here after. The order of blocks is madatory.
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
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
empty so that everybody is sur that there no such kind of code
in the class.
in the class.
Aa easy  copy&past :
Aa easy  copy&past :
        /* ***********************************************************
        /* ***********************************************************
         *                         Parameters
         *                         Parameters
         ************************************************************ */
         ************************************************************ */
        /* ***********************************************************
        /* ***********************************************************
         *                      Injected services
         *                      Injected services
         ************************************************************ */
         ************************************************************ */
        /* ***********************************************************
        /* ***********************************************************
         *                      Injected components
         *                      Injected components
         ************************************************************ */
         ************************************************************ */
        /* ***********************************************************
        /* ***********************************************************
         *                Properties & ASO, etc
         *                Properties & ASO, etc
         ************************************************************ */
         ************************************************************ */
                                         /* ==== END OF PROPERTIES ==== */
                                         /* ==== END OF PROPERTIES ==== */
        /* ***********************************************************
        /* ***********************************************************
         *                       Phase processing
         *                       Phase processing
         ************************************************************ */
         ************************************************************ */
        /* ***********************************************************
        /* ***********************************************************
         *                   Event handlers&processing
         *                   Event handlers&processing
         ************************************************************ */
         ************************************************************ */
        /* ***********************************************************
        /* ***********************************************************
         *                          Helpers
         *                          Helpers
         ************************************************************ */
         ************************************************************ */
        /* ***********************************************************
        /* ***********************************************************
         *                          Helpers
         *                          Helpers
         ************************************************************ */
         ************************************************************ */
        /* ***********************************************************
        /* ***********************************************************
         *                      Getters & Setters
         *                      Getters & Setters
         ************************************************************ */
         ************************************************************ */
Details in Kinds of block :
Details in Kinds of block :
Parameters
Parameters
===========
===========
* Comment to copy&paste before :
* Comment to copy&paste before :
        /* ***********************************************************
        /* ***********************************************************
         *                         Parameters
         *                         Parameters
         ************************************************************ */
         ************************************************************ */
* description
* description
Parameter are component parameters : private attributes with
Parameter are component parameters : private attributes with
@Parameter annotation.
@Parameter annotation.
Injection
Injection
==========
==========
* Comment to copy&paste before :
* Comment to copy&paste before :
        /* ***********************************************************
        /* ***********************************************************
         *                Injected services (properties, etc)
         *                Injected services (properties, etc)
         ************************************************************ */
         ************************************************************ */
* description
* description
Here goes injected service, properties, environnemental, etc.
Here goes injected service, properties, environnemental, etc.
One may define a block by kind of injection.
One may define a block by kind of injection.
Each kind of injection should be set in after "Injected ".
Each kind of injection should be set in after "Injected ".
Properties
Properties
===========
===========
* Comment to copy&paste before :
* Comment to copy&paste before :
        /* ***********************************************************
        /* ***********************************************************
         *                         Properties
         *                         Properties
         ************************************************************ */
         ************************************************************ */
* description
* description
Here goes attribute that are not parameters. These
Here goes attribute that are not parameters. These
attribute may be managed (with @Persist annotation, for ex).
attribute may be managed (with @Persist annotation, for ex).
Phase processing
Phase processing
=================
=================
* Comment to copy&paste before :
* Comment to copy&paste before :
        /* ***********************************************************
        /* ***********************************************************
         *                       Phase processing
         *                       Phase processing
         ************************************************************ */
         ************************************************************ */
* description
* description
Here goes method that deals with rendering phases, as describes here :
Here goes method that deals with rendering phases, as describes here :
http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html
http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html
(such as method annotated with @setupRender, etc).
(such as method annotated with @setupRender, etc).
Events handling
Events handling
================
================
* Comment to copy&paste before :
* Comment to copy&paste before :
        /* ***********************************************************
        /* ***********************************************************
         *                   Event handlers&processing
         *                   Event handlers&processing
         ************************************************************ */
         ************************************************************ */
* description
* description
Here goes event handling and methods alike ( onActivate, onPassivate).
Here goes event handling and methods alike ( onActivate, onPassivate).
Helpers
Helpers
========
========
* Comment to copy&paste before :
* Comment to copy&paste before :
        /* ***********************************************************
        /* ***********************************************************
         *                          Helpers
         *                          Helpers
         ************************************************************ */
         ************************************************************ */
* description
* description
Here goes (private or protected) methods used elsewhere in the code as helper.
Here goes (private or protected) methods used elsewhere in the code as helper.
Javascript
Javascript
=============
=============
* Comment to copy&paste before :
* Comment to copy&paste before :
        /* ***********************************************************
        /* ***********************************************************
         *                          Javascript
         *                          Javascript
         ************************************************************ */
         ************************************************************ */
* description
* description
Here goes method that should render Javascript code. For now, Javascript
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.
support in T5 is somewhat strange, so we have to do it by hand.
8/Getters / Setters
8/Getters / Setters
* Comment to copy&paste before :
* Comment to copy&paste before :
        /* ***********************************************************
        /* ***********************************************************
         *                      Getters & Setters
         *                      Getters & Setters
         ************************************************************ */
         ************************************************************ */
* description
* description
Getters and setters for code used in template.
Getters and setters for code used in template.