Subversion Repositories linid-dm

[/] [wui/] [branches/] [2.0/] [T5-java-codingstyle.txt] - Blame information for rev 505

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1 sbahloul
This file define the common rules and convention about the organization of the Java
2
code of Tapestry Pages and Components.
3
 
4
This classes consist of several kind of block.
5
Each kind of block must be preceded by an *visible* comment,
6
as show here after. The order of blocks is madatory.
7
Block may be omitted if there is no such code in the class, or let
8
empty so that everybody is sur that there no such kind of code
9
in the class.
10
 
11
Aa easy  copy&past :
12
 
13
        /* ***********************************************************
14
         *                         Parameters
15
         ************************************************************ */
16
 
17
        /* ***********************************************************
18
         *                      Injected services
19
         ************************************************************ */
20
 
21
        /* ***********************************************************
22
         *                      Injected components
23
         ************************************************************ */
24
 
25
        /* ***********************************************************
26
         *                Properties & ASO, etc
27
         ************************************************************ */
28
 
29
                                         /* ==== END OF PROPERTIES ==== */
30
 
31
        /* ***********************************************************
32
         *                       Phase processing
33
         ************************************************************ */
34
 
35
        /* ***********************************************************
36
         *                   Event handlers&processing
37
         ************************************************************ */
38
 
39
        /* ***********************************************************
40
         *                          Helpers
41
         ************************************************************ */
42
 
43
        /* ***********************************************************
44
         *                          Helpers
45
         ************************************************************ */
46
 
47
        /* ***********************************************************
48
         *                      Getters & Setters
49
         ************************************************************ */
50
 
51
Details in Kinds of block :
52
 
53
Parameters
54
===========
55
* Comment to copy&paste before :
56
 
57
        /* ***********************************************************
58
         *                         Parameters
59
         ************************************************************ */
60
* description
61
Parameter are component parameters : private attributes with
62
@Parameter annotation.
63
 
64
Injection
65
==========
66
* Comment to copy&paste before :
67
 
68
        /* ***********************************************************
69
         *                Injected services (properties, etc)
70
         ************************************************************ */
71
 
72
* description
73
Here goes injected service, properties, environnemental, etc.
74
One may define a block by kind of injection.
75
Each kind of injection should be set in after "Injected ".
76
 
77
Properties
78
===========
79
* Comment to copy&paste before :
80
 
81
        /* ***********************************************************
82
         *                         Properties
83
         ************************************************************ */
84
 
85
* description
86
Here goes attribute that are not parameters. These
87
attribute may be managed (with @Persist annotation, for ex).
88
 
89
Phase processing
90
=================
91
* Comment to copy&paste before :
92
 
93
        /* ***********************************************************
94
         *                       Phase processing
95
         ************************************************************ */
96
 
97
* description
98
Here goes method that deals with rendering phases, as describes here :
99
http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html
100
(such as method annotated with @setupRender, etc).
101
 
102
 
103
Events handling
104
================
105
* Comment to copy&paste before :
106
 
107
        /* ***********************************************************
108
         *                   Event handlers&processing
109
         ************************************************************ */
110
 
111
* description
112
Here goes event handling and methods alike ( onActivate, onPassivate).
113
 
114
Helpers
115
========
116
* Comment to copy&paste before :
117
 
118
        /* ***********************************************************
119
         *                          Helpers
120
         ************************************************************ */
121
 
122
* description
123
Here goes (private or protected) methods used elsewhere in the code as helper.
124
 
125
 
126
Javascript
127
=============
128
* Comment to copy&paste before :
129
 
130
        /* ***********************************************************
131
         *                          Javascript
132
         ************************************************************ */
133
 
134
* description
135
Here goes method that should render Javascript code. For now, Javascript
136
support in T5 is somewhat strange, so we have to do it by hand.
137
 
138
 
139
8/Getters / Setters
140
* Comment to copy&paste before :
141
 
142
        /* ***********************************************************
143
         *                      Getters & Setters
144
         ************************************************************ */
145
 
146
* description
147
Getters and setters for code used in template.
148