Code Specification Common Specification
A. Name:
1. The naming requirement is meaningful and readable, that is, by naming it, you can see the namespace, the class, the function, what this variable is used for.
2. Try to use English as well as pinyin
3. Try not to use abbreviations
4. Recommended ReSharper, with its naming grammar basically no problem.
5. The name must be unified, the same name in different classes, different projects are expressed the same meaning
6. Database fields and Entity fields are consistent
Two. Class
1. A class can contain only one entity (Class)
2. The field name is consistent with the database name and is generally used by the build tool
3. The method of the class, in addition to inheriting the overridden method, the other is used static method, call convenient
Three. Decoupling and
1. Try to ensure the atomicity of methods and classes
2. One method only implements one function
3. Classes and classes, methods and methods of interaction, as far as possible through the third party, such as the need to call method A after method B, not directly in the method of a call B, but Add method C, let C to call a and B. This way, the coupling between A and B is lifted.
Code Specification Common Specification