1 |
Coding rules for GZigZag -*- Text -*- |
Coding rules for Gzz -*- Text -*- |
2 |
======================== |
======================== |
3 |
Tuomas Lukka |
Tuomas Lukka |
4 |
Antti-Juhani Kaijanaho |
Antti-Juhani Kaijanaho |
9 |
Java code for this project. |
Java code for this project. |
10 |
|
|
11 |
- each Java file should contain the boilerplate copyright and |
- each Java file should contain the boilerplate copyright and |
12 |
license notice (see e.g. Java/ZZCell.java). |
license notice (see e.g. gzz/Cell.java). |
13 |
|
|
14 |
- all of the classes should be in a package. The packages are |
- all of the classes should be in a package (under gzz). |
|
org.gzigzag -- general core stuff |
|
|
org.gzigzag.module -- modules |
|
|
org.gzigzag.dimension -- dimensions for use with DimSpace |
|
15 |
|
|
16 |
- The main Java/ subdirectory may only depend on the JDK 1.1.8 APIs. |
- The main Java/ subdirectory may only depend on the JDK 1.1.8 APIs. |
17 |
Swing is not allowed |
Swing is not allowed |
18 |
The java.util Collections API |
The java.util Collections API |
19 |
(found in JDK 1.2, kaffe and as a separate download for 1.1) |
(found in JDK 1.2, kaffe and as a separate download for 1.1) |
20 |
IS allowed. |
IS allowed. |
21 |
|
|
22 |
There is also Java/exp for experimental things that touch the core |
There is also Java/exp for experimental things that touch the core |
25 |
Modules/ can depend on anything, as long as the dependency is documented. |
Modules/ can depend on anything, as long as the dependency is documented. |
26 |
Nothing in the main Java/ subdirectory may depend on anything in Modules/ |
Nothing in the main Java/ subdirectory may depend on anything in Modules/ |
27 |
This ensures that we retain portability and easy installation. All the user |
This ensures that we retain portability and easy installation. All the user |
28 |
has to do is to give up on a module that has an odd dependency, not the whole |
has to do is to give up on a module that has an odd dependency, not the whole |
29 |
system. |
system. |
30 |
|
|
31 |
Note that all modules need not be in the Modules/ subdirectory: for instance, |
Note that all modules need not be in the Modules/ subdirectory: for instance, |
45 |
|
|
46 |
instead. |
instead. |
47 |
|
|
48 |
This will pull in the version identifier from the CVS file. |
This will pull in the version identifier from the CVS file. |
49 |
XXX IT SHOULD PROBABLY BE INCLUDED IN THE JAVADOC AS WELL! |
XXX IT SHOULD PROBABLY BE INCLUDED IN THE JAVADOC AS WELL! |
50 |
|
|
51 |
- For debugging log messages, use the code |
- For debugging log messages, use the code |
53 |
public static boolean dbg = false; |
public static boolean dbg = false; |
54 |
protected static void p(String s) { ZZLogger.log(s); } |
protected static void p(String s) { ZZLogger.log(s); } |
55 |
... |
... |
56 |
if(dbg) p("Debug message"); |
if(dbg) p("Debug message"); |
57 |
|
|
58 |
to print out messages. The System.out.println() is too verbose to insert |
to print out messages. The System.out.println() is too verbose to insert |
59 |
into code. This code can be added to the beginning of any class. |
into code. This code can be added to the beginning of any class. |
60 |
|
|
61 |
NOTE THE CHANGE FROM PREVIOUS: due to Java's handling of certain String |
NOTE THE CHANGE FROM PREVIOUS: due to Java's handling of certain String |
62 |
concenations, we now prefer not to use separate methods for non-debugged |
concenations, we now prefer not to use separate methods for non-debugged |
63 |
and debugged logging. The former way used resources needlessly on |
and debugged logging. The former way used resources needlessly on |
64 |
every log message -- even if debugging was turned off. |
every log message -- even if debugging was turned off. |
65 |
|
|
66 |
NOTE THE CHANGE FROM PREVIOUS: there is NO "final" qualifier for dbg, |
NOTE THE CHANGE FROM PREVIOUS: there is NO "final" qualifier for dbg, |
67 |
as a non-final dbg can be used on the commandline to switch debugging |
as a non-final dbg can be used on the commandline to switch debugging |
93 |
caches without any cleaning). |
caches without any cleaning). |
94 |
|
|
95 |
One of the considerations here is that Kaffe JVM provides a completely |
One of the considerations here is that Kaffe JVM provides a completely |
96 |
free platform on which we can run the free GZigZag. If SUN or someone else |
free platform on which we can run the free Gzz. If SUN or someone else |
97 |
ever releases their Java implementation under a free license, the situation |
ever releases their Java implementation under a free license, the situation |
98 |
is completely different. |
is completely different. |
99 |
|
|