aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Naming convention Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Naming convention" Watch "Naming convention" New topic
Author

Naming convention

Volker Abel
Greenhorn

Joined: Nov 07, 2008
Posts: 13
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

Joined: Dec 28, 2007
Posts: 2268
    
    3

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.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2628
    
    9

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.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Naming convention