ssh development standards (summarized by myself)

1. The transaction is defined in the Service layer (of course, it can be defined in the Dao layer according to the situation)
2. No hql statement can appear in the Service layer
3. No logic code can appear in the Action, and the encapsulated methods in the Service must be called
uniformly 4. Try not to directly call Action Dao, inject Dao
5. Persistent object properties must use encapsulation types, especially numeric types must use encapsulation types.
6. For the status or other identifying attributes in the persistent object, use 0 to indicate no, 1 to indicate yes, and it is best to use numeric types
7. The status 0 and 1 in the persistent object must define constants, and the page compares the persistent object 8. The object
variable naming convention adopts the camel case nomenclature.
9. Method naming, do not start with get or set unless it is necessary for special needs.
10. spring bean scope Setting
11. Level 2 caching strategy
12. Spring transaction strategy
13. Page static strategy
14. Object attributes and methods must start with a small letter, and there cannot be more than two consecutive uppercase letters after the first letter of the attribute, such as pID
15. Declare Long Type constants should be followed by an uppercase L and not a lowercase l.
16. Browser compatibility testing, do not use IETest or other IE testing tools that integrate the kernel, it is better to use a separate browser
17. New fields available for test data modification In the way of adding, do not delete the original fields, so that the old version of the application can also be tested with this database.
18. When building the project framework, remember to set the project character code first.
19. Be sure to match log4j. log
20. Delete spring's asm-2.2.3.jar
21. Use database connection pool
22. Strings must be
trimmed 23. If even one line should add {}
24. Use StringBuffer for spelling
as much as possible 25. Use table aliases in sql Use the first three letters of the table uniformly to prevent repetition
. 26. Try not to use in and not in subqueries in sql.
27. Use objects as parameters for method parameters.
28. Commonly used methods are statically placed in a public util class.
29. Commonly used The date format string is placed in a public class in a static way.
30. Frequently used methods should be synchronized and static modifiers, and the variables in the method should be static as much as possible.
31. Frequently changing storage must not be modified with static
32. Classes
33. After the class new is finished and used, it should be explicitly made = null
34. Try\catch exceptions should be thrown upwards, and let the caller handle the exceptions 35.
Attribute annotations are placed in
36. It is best to deploy resource files and log files when deploying applications. In short, they are always increasing. For example, the upload directory must be separated from the application and should not be placed in the same directory.
37. Applications should be regularly backed up 38.web
. Each class must be annotated in xml
39. Opening links in the for loop causes waste of database link resources
40. Code manual transactions, updates and deletions must be
committed
42. Objects must be used if there are more than 2 method parameters.
43. Use more than two characters for variables as much as possible.
44. It is best to use the database time. When the database creates a time field, set default.
45. The test should establish the same environment and the data should be consistent. , there is no problem with the code test, just consider the problem of the
database 46. The database fields and pojo attribute fields should be consistent
47. For the interface of real-time update, it is best not to save the data to the database
48. Everyone writes a separate class to prevent svn conflicts
49. JS controls such as jquery, it is best not to refer to the min compressed version.
50. The field after the select should be aliased.
51. The method name and the variable name cannot be the same name.
52. The code line cannot be too wide
. 53. There cannot be two classes in a java file. 54. Use
annotation tags to
reduce get ,
set .Common component class names end with the component type name. 60. The function name cannot exceed 15 characters. 61. The data class should be re-headed toString, hashcode, and equals methods. 62. There should be no try, catch in the loop. , smartIDE, infusion, codect









<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
不要用
<filter-mapping>
<filter-name>RemoteLoginFilter</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>

测试用例数据sql准备

@echo On
svnserve -d -r d:\svn\icss

@echo On
@Rem 删除SVN版本控制目录
@PROMPT [Com]#
@for /r . %%a in (.) do @if exist "%%a\.svn" rd /s /q "%%a\.svn"
@Rem for /r . %%a in (.) do @if exist "%%a\.svn" @echo "%%a\.svn"
@echo Mission Completed.
@pause



http://blog.csdn.net/xumengxing/article/details/14476007

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326989878&siteId=291194637