Standard Java guidelines are expected to be followed.
Class names are capitalized (example: MyClass
).
Methods start with a lower-case character (example: myMethod
).
Static final variables used as constants
are in upper-case (example: MY_CONSTANT
).
Private member variables (both instance and static) are named with a leading underscore
(example: _myVariable
). Public member variables are to be avoided.
Naming in transition | |
---|---|
I've resisted the leading underscore syntax for a long time; the rationale behind it is to make it possible, at a glance, to visually seperate instance variables from local variables and parameters. Previously, I've always maintained that the problem was methods that were too large; lately I've changed my mind ... the underscore naming helps when debugging and helps avoid a number of naming collisions. At the time of this writing, 2.1-beta-1, very little of the code used the new naming. Over time, mixed in with other bug fixes, renaming will occur (Eclipse helps with this greatly). New code will be written to conform. |
Interfaces in Tapestry are prefixed with the letter 'I' (example: IRequestCycle
).
Implementations (often in a different package)
strip off the 'I' (example: RequestCycle
). Interfaces related to JavaBean events
do not start with an 'I' (example: PageDetachListener
).
Base classes, classes which are concrete and functional, but often extended, are prefixed with 'Base' (example:
BaseComponent
). Abstract classes are prefixed with 'Abstract' (example:
AbstractEngine
). Classes which are functional and only rarely subclassed are often
prefixed with 'Default' (example: DefaultScriptSource
).
The base package for the framework JAR (tapestry-3.0.jar
) is org.apache.tapestry
.
The base package for the contrib JAR (tapestry-contrib-3.0.jar
) is org.apache.tapestry.contrib
.