1

What is the better way to name a new interface ? Would you write HasName or Nameable?

Is there a general computer science standard, or only a Java habbit ?

  • AFAIK there is no standard and thus primarily opinion based. There are several conventions/systems and each have their pros and cons so just chose one thats appropriate (or chose more if necessary). You just should find a system that works for you and stick with it. – Thomas Oct 07 '16 at 12:23
  • Check this answer http://stackoverflow.com/questions/2814805/java-interfaces-implementation-naming-convention – Jota Ge Oct 07 '16 at 12:25

1 Answers1

3

As Google Java Style Guide suggests:

Interface names may be nouns or noun phrases (for example, List).

But may sometimes be adjectives or adjective phrases instead (for example, Readable). They should end with -able or -ible whenever the interface provides a capability.

Interface names follow the same capitalization convention as class names:

public interface Serializable {...}
public interface SystemPanel {...}
Andy Turner
  • 131,952
  • 11
  • 151
  • 228
DimaSan
  • 11,496
  • 11
  • 63
  • 74