Java Class Checklist
- If this class is used by only 1 client, make it a private inner
class of
that client.
- Create Java class file
- Create Java class test file
- Add these files to version control repository
- Insert license preamble in both sources files
- Write some tests
- Is class or interface declared with minimum accessibility?
- Can class be declared final?
- If not, declare all methods final, initially. Make them
protected/package-private, or public only as needed.
- Declarations should be:
- private
- of interface, not of implementation.
- Assert all preconditions & postconditions that are not part
of specification.
- Assert all method invariants.
- Log as needed.
- Make sure all code adheres to coding conventions.
- Javadoc! Yes, it's a verb too.
- Should the class be
refactored? Are there design patterns that apply?