[Code Specifications] Common naming conventions

1. For java only , the package name uses the inverted domain suffix plus a custom package name, using lowercase letters. Products use the name of the product plus the module name.

Format:

com.yhxf. callme2 . userinfo

 

2. The class name and interface use the complete English description of the class meaning. The first letter of each English word is uppercase and the rest of the letters are lowercase . Example:

OrderInformation,  CustomerList, LogManager, LogConfig, SmpTransaction

 

3. The method name uses the complete English description of the class meaning: in java , the first letter of the first word is lowercase, in C# , the first letter of the first word is capitalized, the first letter of the remaining words is capitalized, and the rest of the letters are lowercase. mixed method.

Example (java): Example (C#):

private void calculateRate();
public void addNewOrder();

private void CalculateRate();
public void AddNewOrder();

 

4. The attribute name should be described in English with complete meaning: the first letter of the word should be lowercase, the first letter of the remaining words should be uppercase, and the rest of the words should be lowercase. The property name cannot be the same as the method name.

private string customerName;
 private int orderNumber;
 private string smpSession;

 

5. Use all uppercase English descriptions for constant names, and separate English words with underscores. Example:

public final static  int MAX_VALUE = 1000;
 public final static String DEFAULT_START_DATE = "2001-12-08";


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324478735&siteId=291194637