• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface => IF and Implementation => Impl ?

 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm wondering what should be used to name interfaces and implementation according to the coding standard.

At page "numbered" 16, it seems Interface should interface shoulnd not have "IF" or any special marker.

Java coding standard (pdf)

What do you think ? Should Interface end by "IF" and implementation by "Impl" ? Or is that bad ? or is that against the coding standad ?

Thanks in advance
Alex
 
John Stone
Ranch Hand
Posts: 332
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I personally like to name interfaces with "Ifc" at the end of name, and then name class without that "Ifc". That way you can tell if it is interface or not.

I think, that in Java most people choose to name interfaces with some regular name, and implementation classes with "Impl" at the end.
 
Romeo Son
Ranch Hand
Posts: 92
Android Eclipse IDE Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One can always look at Sun classes for similar questions as this one.
Take for example the java.util.List interface and one of its implementations,
java.util.ArrayList.
And there are plenty of other examples. One can see in their classes not just the naming conventions, but other aspects like the JavaDoc style comments for example.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic