...
- Each method in the interface should have an @Authorized annotation on it
Code Block |
---|
@Authorized(OpenmrsConstants.PRIV_EDIT_THINGS) |
...
- All service interfaces should extend org.openmrs.api.OpenmrsService
- All service implementation classes should extend org.openmrs.api.BaseOpenmrsService
Commenting
Tip |
---|
In Eclipse, Alt-Shift-J is your friend...or Alt-Command-J on a Mac. |
- Service interface:
- Should have class level comment explaining a typical use case
- Each method should have comment about what it does, each parameter explained, and return value explained
- Deprecated methods should be marked in the javadoc and given a comment about why and what replaces it.
- Service implementation:
- The class comment on the should explain and point back at the interface
- Each method should simply point at the interface
- DAO interface
- Should have class level comment should point back at the interface
- Each method comment should simply point at the interface
- DAO implementation
- Class level comment should point at DAO and service interface
- Each method should point at service interface (and daoDAO?)
General
- Enumerations should be used instead of numerical constants
...