Library interface naming

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
kontiky
Posts: 7
Joined: Wed Oct 19, 2005 11:08 am

Library interface naming

Post by kontiky » Mon Oct 24, 2005 3:28 pm

Why JFreeChart uses non standard for java interface naming?
Why interfaces not start with letter "I"?
It is difficult while reading code to understand what is e.g. CategoryItemLabelGenerator? Is it class? In reality it is interface.

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Post by Taqua » Mon Oct 24, 2005 3:42 pm

Hi,

that prefixed interface naming is a leftover from the old C++ ages. The Java class-library does not use that schema, and most projects don't use it either. When using a modern IDE, the syntax highlighting should be able to mark all occurences of interfaces, if needed.

As using interfaces is the same as using abstract classes (aside from that you have to 'implement' the one and 'extend' the other), it makes no sense to mark the type by its name here. The unclean semantics and the lack of a proper typing system in C++ may be helpfull there, but in Java this is as obsolete as declaring all used variables in C-Style at the beginning of the method.

Regards,
Thomas

kontiky
Posts: 7
Joined: Wed Oct 19, 2005 11:08 am

Post by kontiky » Mon Oct 24, 2005 3:50 pm

Sorry, start interface naming with "I" is our firm internal guideline.
Thanks!

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Post by Taqua » Mon Oct 24, 2005 4:26 pm

Hi,

I fully understand. Whenever I have to dive into code written according to a different coding style, I have these troubles too :)

Regards,
Thomas

Locked