This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Naming convention

 
Volker Abel
Greenhorn
Posts: 13
  • 0
  • 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
  • 0
  • 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
Pie
Posts: 3222
12
Android Java
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic