Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Naming convention

 
Volker Abel
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello out there

a question about naming interfaces: I personally prefer to name interfaces with a "I" as first letter, e.g. IService, IDatabaseAccess, ... so you can see by its name that something is an interface.

Sun coding conventions seem neither to forbid nor to encourage that either saying only "Interface names should be capitalized like class names.", but their examples do not have an "I" (RasterDelegate, Storing).

How do you think about this?

Regards,
Volker.

P.S.: I tried to search the forum for similar topics, but the search mechanisms seem not to be capable for this kind of search.
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, partner. I thought a lot about this, but I decided not to put an I in front of interfaces' names, because the interfaces that come with the Java language do not have it. For instance, there's no IActionListener, IRequestDispatcher or IHttpSession. But I think that if you decide to do so, it shouldn't be a problem.
 
K. Tsang
Bartender
Posts: 3585
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having an "I" in front of interfaces may be nice but as Rob said the API doesn't follow that. For the assignment Sun's provided interface is called DBMain for me anyway. So for interfaces, I start mine as DBxxxx such as DBRemote for my remote interface.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic