Wednesday, May 31, 2006

Java interfaces convention

IPortletDefinition or PortletDefinition.
Reasons to drop the I's
  • JavaDoc and IDEs like Eclipse differentiate interfaces from classes sufficiently. The Java typing does not also need to be reflected in the type name because our IDEs already give us sufficient visual clues.
  • Follow the Sun conventions with the goal of minimizing the "impedance mismatch" between our code-base and the JDK, i.e., our APIs should look like they could be in the JDK. This strategy is helpful pedagogically.
  • Keeping with the norm of other open source and java projects.
Reasons to keep the I's
  • For the sake of consistency between different versions
  • To make it easier to tell which files represent java interfaces when viewing files in a list outside of JavaDoc or an IDE like Eclipse, or in Eclipse views which do not illustrate the difference with icons.
  • To make it easier to identify java interfaces when looking at java code itself.
  • Having the extra I doesn't present a real burden.

The ideot's mission

Knowledge is power - learn it and become a powerman.