|
From: Vincent M. <vm...@us...> - 2001-08-22 10:36:49
|
Update of /cvsroot/mockobjects/mockobjects-java/doc/xdocs
In directory usw-pr-cvs1:/tmp/cvs-serv15530
Modified Files:
coding_conventions.xml
Log Message:
updated coding conventions
Index: coding_conventions.xml
===================================================================
RCS file: /cvsroot/mockobjects/mockobjects-java/doc/xdocs/coding_conventions.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- coding_conventions.xml 2001/08/21 10:44:06 1.3
+++ coding_conventions.xml 2001/08/22 10:36:45 1.4
@@ -30,8 +30,8 @@
<p>
Below is a list of coding conventions that are specific to Mock
Objects, everything else not specificially mentioned here should
- follow the official <link
- href="http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html">Sun
+ follow the official <link href=
+ "http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html">Sun
Java Coding Conventions</link>.
</p>
@@ -42,15 +42,13 @@
<s2 title="1. Brackets">
<p>
- For class and method declaration, brackets should begin and end on a
- <strong>new</strong> line. Example :
+ For class and method declaration, brackets should begin on the
+ <strong>same</strong> line. Example :
</p>
<source><![CDATA[
-public class SomeClass
-{
- public void someMethod()
- {
+public class SomeClass {
+ public void someMethod() {
}
}
]]></source>
@@ -63,8 +61,7 @@
</p>
<source><![CDATA[
-public void someMethod()
-{
+public void someMethod() {
if (expression) {
} else if (other_expression) {
}
@@ -178,18 +175,16 @@
<s2 title="7. Class variables">
<p>
- Class variables should not have any prefix and <strong>must</strong>
- be referenced using the <code>this</code> object. Example :
+ Class variables should be prefixed with <strong>my</strong>.
+ Example :
</p>
<source><![CDATA[
-public class SomeClass
-{
- private String someString;
+public class SomeClass {
+ private String myString;
[...]
- public void someMethod()
- {
- logger.debug("Value = " + this.someString);
+ public void someMethod() {
+ logger.debug("Value = " + myString);
}
}
]]></source>
@@ -199,13 +194,12 @@
<s2 title="8. Parameter names">
<p>
- Method parameters should be prefixed by "<code>the</code>" (for
+ Method parameters should be prefixed by "<code>a</code>" (for
differentiating them from inner variables). For example :
</p>
<source><![CDATA[
-public void someMethod(String theClassName)
-{
+public void someMethod(String aClassName) {
String className; // inner variable
}
]]></source>
@@ -215,7 +209,7 @@
<s2 title="9. Line length">
<p>
- Avoid lines longer than 80 characters for Code, comments, ...
+ Avoid lines longer than 78 characters for Code, comments, ...
</p>
</s2>
@@ -230,6 +224,11 @@
<source><![CDATA[
@version $Id$
]]></source>
+
+ <note>
+ You just need to write <code>@version $Id$</code> and CVS will
+ add the rest during commits
+ </note>
</s2>
|