- Lessen the hibernate 'magic'. Never return a hibernate magical object - Ben Wolfe
- Get rid of the need for sessions (opensession/closesession). This goes with previous point about hibernate magical objects. - Ben Wolfe
- Get rid of the static Context. Inject everything like standard spring apps in order to take advantage of other tools, mocks in unit tests, etc - Ben Wolfe
- Do not return retired metadata by default – ~bmamlin
- In API 1.x, metadata lists – e.g., getConceptAnswers() – include retired values by default, which can encourage use of values that are no longer valid.
- More use of
finalkeyword for parameters – ~bmamlin
- Attention to multithreading support – ~bmamlin
- Use Long instead of Integer for internal identifiers -- ~bmamlin
- Part of our goal for supporting 2+ million patients in OpenMRS will require supporting tables that contain over 2 billion rows
- Use absolute times (i.e., UTC) everywhere within the API.
- We can always provide convenient means for timestamps to be rendered in the current timezone; however, all stored values should be in UTC in order to eliminate issues with transferring data across timezones or implementation headaches in locations that observe DST.
- Follow lessons given byBloch's Google Tech Talk (slides) – ~bmamlin
- Don't let implementation details "leak" into API
- Self-Explanatory, Consistency, Symmetry
- Strong javadocs
- Avoid long parameter lists (break up method or create helper class to hold parameters)
- Avoid return values that demand exception processing (return zero-length array or empty value, not null)
- Favor unchecked exceptions