[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/doublez0902/JavaGuide/master/docs/java/java-naming-conventions.md [Back]  [Original]

> https://www.cnblogs.com/liqiangchn/p/12000361.html 

5

Java

## Java

JavaUpperCamelCaselowerCamelCaseUPPER_CAMEL_UNSER_SCORE****

|    |                                                          |                                              |
| :----: | :----------------------------------------------------------: | :--------------------------------------------: |
|  |              -               |                  spring-cloud                  |
|    |                                                      |              com.alibaba.fastjson              |
|    |                                                | Feature, ParserConfig,DefaultFieldDeserializer |
|  |  |               password, userName               |
|  |                '_'                 |               CACHE_EXPIRED_TIME               |
|    |                                                        |        read(), readObject(), getById()         |

## 

************ springframeworkdeepspace

 

|           |                              |                                                          |
| :-------------: | :----------------------------: | :----------------------------------------------------------: |
| indionem  | indi.... | copyright |
|      pers       |  pers....  | copyright |
|      priv       |  priv....  | copyright |
|      team       |  team....  | copyright |
|         |  com....   |           copyright            |

## 

********CloneableCallableTestHashMapTest

XMLHttpRequestfastjsonJSONObjectgoogleJsonObjectRequest

|            |                                       |                                                            |
| -------------- | ----------------------------------------- | ------------------------------------------------------------ |
|          | Abstract  Base                    | BaseUserService                                              |
|          | Enum                              | GenderEnum                                                   |
|          | Utils                             | StringUtils                                                  |
|          | Exception                             | RuntimeException                                             |
|      | + Impl                              | UserServiceImpl                                              |
|    | /DO/DTO/VO/DAO                            | UserDAO  UserDo UserDao                        |
|  | BuilderFactory                        | ThreadFactory |
|  | HandlerPredicate, Validator             | handlepredicatevalidate |
|          | Test                                  | UserServiceTest UserService                |
| MVC        | ControllerServiceServiceImplDAO | UserManageControllerUserManageDAO                          |

## 

**** **** + 

### 4.1 

Prefix-Suffix-Alone-

|    |    |                                                          |             |
| ------ | ------ | ------------------------------------------------------------ | ------------- |
| Prefix | is     |                                        | isValid       |
| Prefix | can    | ****                                 | canRemove     |
| Prefix | should | ****,******** | shouldMigrate |
| Prefix | has    | ****                           | hasObservers  |
| Prefix | needs  | ****                         | needsMigrate  |

### 4.2 

|      |                                                  |              |
| -------- | ---------------------------------------------------- | -------------- |
| ensure   | error code | ensureCapacity |
| validate | error code | validateInputs |

### 4.3 

|    |       |                                       |                      |
| ------ | --------- | ----------------------------------------- | ---------------------- |
| Suffix | IfNeeded  |     | drawIfNeeded           |
| Prefix | might     |                                       | mightCreate            |
| Prefix | try       | errorcode | tryCreate              |
| Suffix | OrDefault |                 | getOrDefault           |
| Suffix | OrElse    |     | getOrElse              |
| Prefix | force     | error     | forceCreate, forceStop |

### 4.4 

|             |          |                                          |                     |
| --------------- | ------------ | -------------------------------------------- | --------------------- |
| Prefix          | blocking     |                                  | blockingGetUser       |
| Suffix          | InBackground |                              | doInBackground        |
| Suffix          | Async        |                                      | sendAsync             |
| Suffix          | Sync         |                    | sendSync              |
| Prefix or Alone | schedule     | JobTask                            | schedule, scheduleJob |
| Prefix or Alone | post         |                                          | postJob               |
| Prefix or Alone | execute      |  | execute, executeTask  |
| Prefix or Alone | start        |                                          | start, startJob       |
| Prefix or Alone | cancel       |                                  | cancel, cancelJob     |
| Prefix or Alone | stop         |                                          | stop, stopJob         |

### 4.5 

|    |    |                        |            |
| ------ | ------ | -------------------------- | ------------ |
| Prefix | on     |              | onCompleted  |
| Prefix | before |              | beforeUpdate |
| Prefix | pre    |                        | preUpdate    |
| Prefix | will   |                        | willUpdate   |
| Prefix | after  |              | afterUpdate  |
| Prefix | post   |                        | postUpdate   |
| Prefix | did    |                        | didUpdate    |
| Prefix | should |  | shouldUpdate |

### 4.6 

|        |                            |               |
| ---------- | ------------------------------ | --------------- |
| initialize |  | initialize      |
| pause      |                            | onPause pause |
| stop       |                            | onStopstop    |
| abandon    |                      | abandon         |
| destroy    |                            | destroy         |
| dispose    |                            | dispose         |

### 4.7 

|      |                          |          |
| -------- | ---------------------------- | ---------- |
| contains |  | contains   |
| add      |                          | addJob     |
| append   |                          | appendJob  |
| insert   | n                  | insertJob  |
| put      | key          | putJob     |
| remove   |                      | removeJob  |
| enqueue  |            | enqueueJob |
| dequeue  |        | dequeueJob |
| push     |                    | pushJob    |
| pop      |              | popJob     |
| peek     |            | peekJob    |
| find     |            | findById   |

### 4.8 

|    |                                    |             |
| ------ | -------------------------------------- | ------------- |
| create |                                  | createAccount |
| new    |                                  | newAccount    |
| from   |  | fromConfig    |
| to     |                                    | toString      |
| update |                            | updateAccount |
| load   |                                    | loadAccount   |
| fetch  |                                | fetchAccount  |
| delete |                                    | deleteAccount |
| remove |                                    | removeAccount |
| save   |                                    | saveAccount   |
| store  |                                    | storeAccount  |
| commit |                                    | commitChange  |
| apply  |                              | applyChange   |
| clear  |              | clearAll      |
| reset  |              | resetAll      |

### 4.9 

|            |               |
| -------------- | ----------------- |
| get        | set           |
| add        | remove        |
| create     | destory       |
| start      | stop          |
| open       | close         |
| read       | write         |
| load       | save          |
| create     | destroy       |
| begin      | end           |
| backup     | restore       |
| import     | export        |
| split      | merge         |
| inject     | extract       |
| attach     | detach        |
| bind       | separate      |
| view       | browse        |
| edit       | modify        |
| select     | mark          |
| copy       | paste         |
| undo       | redo          |
| insert     | delete        |
| add        | append        |
| clean      | clear         |
| index      | sort          |
| find       | search        |
| increase   | decrease      |
| play       | pause         |
| launch     | run           |
| compile    | execute       |
| debug      | trace         |
| observe    | listen        |
| build      | publish       |
| input      | output        |
| encode     | decode        |
| encrypt    | decrypt       |
| compress   | decompress  |
| pack       | unpack        |
| parse      | emit          |
| connect    | disconnect    |
| send       | receive       |
| download   | upload        |
| refresh    | synchronize   |
| update     | revert        |
| lock       | unlock        |
| check out  | check in      |
| submit     | commit        |
| push         | pull            |
| expand     | collapse      |
| begin      | end           |
| start      | finish        |
| enter      | exit          |
| abort      | quit          |
| obsolete   | depreciate    |
| collect    | aggregate     |

## &

### 5.1 

 computedValuesindex

pojois( is_ )

### 5.2 

CONSTANT_CASE

finalpublic static finalprivate static final 

```java
/**
 * demo
 *
 * @author Jann Lee
 * @date 2019-12-07 00:25
 **/
public class HelloWorld {

    /**
     * ()
     */
    public static final long USER_MESSAGE_CACHE_EXPIRE_TIME = 3600;
    
      /**
     * (
     */
    public static final long MESSAGE_CACHE_TIME = 3600;
    
    /**
     * 
     */
    private static final String ERROR_MESSAGE = " error message";

    /**
     * 
     */
    private int currentUserId;

    /**
     *  {@code message} 
     * 
     * @param message 
     */
    public void sayHello(final String message){
        System.out.println("Hello world!");
    }

}
```

,****

## [#](https://www.cnblogs.com/liqiangchn/p/12000361.html#450918152)

1. 
    BeiJing HangZhou
    validateCanShu
2. 
3. jdkjava
4. for(4), to(2), from, withof
   User4RedisDOgetUserInfoFromRedisconvertJson2Map

## 

### 6.1 



1. Nothing is strange
   
2. Less is more
   

```java
// id
getMessageById(id)
```

1. Advance with the time
   

### 6.2 

javadocjavadocJavaAPIjavadocIDEAEclipse

#### a. 

package-info.java

```java
/**
 * 
 * 1. 
 * AndroidIOS; 2G3G4Gwifi
 *
 * 2. 
 * chromechromedriverOS
 *
 *  {@link cn.mycookies.landingpagecheck.meta.NetWorkSpeedEnum}
 * 
 * @author cruder
 * @time 2019/12/7 20:3 
 */
package cn.mycookies.landingpagecheck;
```

#### b. 

javadoc

```java
/**
* Copyright (C), 2019-2020, Jann  balabala...
*
* .....
*
* @author    
* @date      
* @version   
*/
```

#### c. 



```java
/**  */
private String userName;
/**
 * 
 */
private String password;
```

#### d. 



```java
/**
  * ...
  *
  * @param xxx 	 1 null
  * @return  
  * @throws    
  */
```

#### e. 



```java
 /**
  * 
  *
  * @param xxx 	 1 null
  * @throws    
  */
```



1. 
2. 1

```java
id = 1;// 
//
int age = 18;
// 
String name;
/**
 * 1. 
 * 
 * 2. 
 */
```

## 





- 
- https://www.cnblogs.com/wangcp-2014/p/10215620.html
- https://qiita.com/KeithYokoma/items/2193cf79ba76563e3db6
- https://google.github.io/styleguide/javaguide.html#s2.1-file-name

Web Proxy Viewer  |  New URL  |  Original Page