. NET Naming conventions

Source: Internet
Author: User

A simple and easy-to-ignore naming convention


1. Project namespace Specification
A. Define namespaces using meaningful names, such as product names or company names
B. Namespaces should be defined hierarchically
C, the first letter of all words to capitalize, the single plural of words to agree
Format: [Company name]. [Product name | project Name]. [Subsystem name | module name]. [...]
such as: Microsoft.Office.Tools.Word
Microsoft.Office.Tools.Excel
Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.GridControl
Microsoft.VisualStudio.Modeling
Microsoft.VisualBasic.Compatibility.Data
Infragistics.WebUI.UltraWebGrid
Infragistics.WebUI.WebSchedule
The first tier is the company name, such as: Microsoft
The second tier is the product name or project name, such as: Office
The second layer can continue to be subdivided according to the specific situation, for example, can be divided according to subsystems or functional modules, such as: Microsoft.VisualBasic.Compatibility.Data
The third layer should be consistent with the system architecture, such as: Client or Web, Entity, Data, Service, Agent, contract, etc.

2. Database naming specification
A, database name: project name or code + "DB"
B, view/table naming: Easy-to-understand uppercase English words
C, field name: Use a number of easy-to-understand uppercase words

The singular plural of words should be consistent (such as the uniform use of odd);
Prefix to be consistent, avoid confusion (such as table: T_, view: v_, column field: C_, also can be divided by System module), to avoid and DB reserved word repetition;
Depending on the database, the word is uniformly capitalized or lowercase (which can generally be capitalized), otherwise some databases must be prefixed to the SQL statement to be recognized.

Convention all text definitions use English letters, if you need to use Arabic numerals, the whole half-width.

There are a lot of specifications (coding specifications, design specifications ...), but there are still design/developers who will ignore it, listing only two points.
Why neglect? Do you have this situation: the project has been developed, the name of the project is not even known to be finalized!


This article is from the "Flying Pigeon biography, Flying Pigeon Book 2012:" blog, please be sure to keep this source http://ipmsg.blog.51cto.com/1051763/1550445

. NET Naming conventions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.