On 7/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hello,

Do we have a section on the site about the coding conventions we're
supposed to follow? Currently ADF Faces seems to use the following:

Private members and methods use underscore (_) prefix ;


Yes.  In addition, package-private use double underscore prefixes.
This is intentionally ugly;  we strongly discourage the use of
package-private
access, and in general recommend everything receive the most limited
access possible.

Constants are imported using implements on a contant interface (Shouldn't
we use fully qualified name or static imports instead?) ;


This isn't a standard as such;  it was a common coding practice (esp.
UIConstants), but we're moving away from it.

Constants and attributes are defined at the end of the class files, after
methods ;


Yep.

Constant names are in uppercase, with each words separated with an
underscore (standard rule) ;



Yep.

Method and variable names are in lowercase except for the first letter of
every word after the first forming them that should be in uppercase ;


Yep.


Methods don't seem to appear in any specific order (any rule on this?) ;



They're *supposed* to go:  constructor, public, protected, package, private.
We've been lax in enforcing that.

Asbtract classes does not seems to be used much, instead they provide a
protected method with a dummy behavior to be overridden ;


It varies;  it's used here and there.

Generics are used, but not always (should we convert every classes we see
to use them?) ;


It started as a JDK 1.2 codebase, so not used all over the place.  We're
converting piece-by-piece.


@SuppressWarning("unchecked") is not used (should we start using this when
converting to generics is not an option? Eclipse whine much for some
classes because of this).


Happy to have it used where necessary.  Ditto @Override.  (Again, it
wasn't a Java 5.0 codebase 'til relatively recently.)

Is there any other rule to follow?


Some obvious ones - no calls to System.out/err.println, don't discard
exceptions (unless it's entirely intentional - log them instead).  Also,
2 space indent, no use of tabs allowed at all.  I'm sure I'll think of
others.

Can someone wikify this?

Thanks,
Adam

Reply via email to