标签:
The last four refer as members
Signature
Accessiblity modifier (Default:internal)
class keyword
Class Name
XML documents comments
Fields
A variable in the class
Hold the data
Properties
Getter and Setter functions
Guard access to the fields (backing fields)
Methods
Function
Behaviors and Operations
Do
Class naming: Define the meaningful name, Use a noun, Use PascalCasing
Add XML document comments
Ensure the class has well-defined purpose
Create one class per code file
Use properties to encapsulate fields
Use methods for logic
Add properties above the methods
Avoid
Class naming: Abbreviations Prefixes Underscores
Large class
C# Best Practices - Building Good Classes
标签:
原文地址:http://www.cnblogs.com/lmfy/p/5109170.html