1. The code can be reused as much as possible, but the layers cannot be too many. Otherwise, it is not easy to maintain the code. For example, add a method SaveTestDoDate () that everyone can call (), in other cases, code robustness can be called. Consider some unexpected code. If you want to use an object, you must first determine whether it is empty or whether it exists, that is, anti-stay, in addition, a prompt is provided to avoid any adverse effects caused by changes made by the original party, and to facilitate maintenance and identify errors. For example, js: If you want to obtain an object obj, first determine whether the obj exists. If not, alter the corresponding prompt content, in this step, we seldom do this. If the method for obtaining obj is changed, we can immediately find out the cause. Www.2cto. com3 should not be hard-coded as much as possible, from the database or the enum value, and take the corresponding value in the database or enmu when judging. For example: switch (iocnSkin) {// do not use hard encoding, for example, case 1: // it should be like this case (int) EnmumSkin. folder: in Case 1, it does not indicate a folder but a test case. Therefore, many changes are involved and the code maintenance is inconvenient. If the value of enmu is written, you only need to change the value of enmu elsewhere. Here is an example.