Classics World IT Department
JavaTM Naming Standards


Much of the code used to develop the ClassicsCD.com site is developed in Java due to Java’s increasing popularity as platform independent language.

Naming standards improve development and maintenance effectiveness by:

The following JavaTM naming conventions are used to develop ClassicsCD.com web site.


Identifier Type


Naming Standards


Examples

Packages Package names should consist of all lowercase characters and must begin with com.rational.cdshop.

All servlets are defined in the package com.rational.cdshop.servlets.

com.rational.cdshop.business

com.rational.cdshop.servlets.CDShopServlet.

 

Classes Class names should be nouns and use a combination of upper and lowercase characters. The first letter of each internal word should be capitalized. Class names should be simple and informative giving some indication of the class’s purpose.

For all classes that interface to a database should be of the following convention class XxxxDB.

All servlet classes for the ClassicsCD.com project should be of the following convention CDXxxxServlet.

class OrderItem;
class CDCatalogServlet;
Interfaces All Interface class names should begin with the letter I and should be capitalized like class names. interface IOrder
Methods Methods should be verbs, nouns and use a combination of upper and lowercase characters. The first letter of each internal word should be capitalized. class CreditCard

setType(int)

setNumber(number) setExpDate(String)
Variables Variables should be nouns and use a combination of upper and lowercase characters. The first letter should be lowercase and the first letter of each internal word capitalized. Naming should be intuitive for code comprehension by other team members.
class CreditCard

int type;

string number;
string expDate; string name;

Constants Variable names declared as class constants should capitalized. A variable name consisting of multiple words should combine the words using an underscore ("_"). Constants are always declared as static and final. static final int VISA_TYPE = 0;
 


Return to Classics IT Knowledge Base home page.