THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Coding Guidelines
Coding Guidelines describe the guidelines of code contribution for the Contributors and Committers.
This is a living document and is still being discussed on the Wink mailing lists. Please feel free to discuss and modify the guidelines.
Coding
Backward Compatibility
- The project must keep backward compatibility between minor versions, unless the change is required to fix a bug.
- The project should keep backward compatibility between major versions, if possible.
- In order to reduce amount of potential backward compatibility problems, follow the following guidelines:
- Expose as few APIs as possible to user.
- Prefer exposing interfaces, to exposing classes.
- The internal classes, must have the internal word in its name (e.g. org.apache.wink.internal)
- Remember: it's always possible to move a class from internal package outside, but it's never possible to move the classes to internal, after they were released.
- Classes that are exposed to user only by their class name (e.g. servlets, listeners, spring beans) should be located in the internal package. However, they must contain a javadoc clarification that their name must not be changed.
Potential Programming Problems
- Never call methods that can be overridden by a subclass from the constructor.
- If you call any method from the constructor, either declare the whole class final.
- Or make method private, or final, or static.
Logging
- In general logging is a good idea.
- Use Commons Logging.
- For debug messages, call
if (log.isDebugEnabled())
prior to callinglog.debug()
.
Formatting
- In perfect world all people, who contribute code, use the same IDE with the same formatting preferences.
- It should be a good idea to attach a formatter profile for Eclipse that we expect contributors to use.
- Anyway for people, who don't use Eclipse, or want to keep their formatting preferences, let's define some basic rules:
- Do not use Tab. For indentation use only spaces. Indentation size is 4 spaces.
- Maximum line width: 100 characters.