Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Naming conventions in C# compared to Java

The standard naming convention in the Java world is to name packages, classes and methods according to:

com.domainname.productname (package)
com.domainname.productname.ClassName (class)
com.domainname.productname.ClassName.isUpperCase(String str) (method)

What is the C#/.NET standard naming convention for the above cases?

like image 933
knorv Avatar asked Jan 24 '09 19:01

knorv


1 Answers

AKU's answer should help you out:

.NET namespaces

He links to Microsoft's guidelines:

http://msdn.microsoft.com/en-us/library/893ke618(VS.71).aspx

You should consider reading the the rest of the guidelines starting here:

http://msdn.microsoft.com/en-us/library/czefa0ke(VS.71).aspx

The remainder of the post is also very informative:

.NET namespaces

In your case you would go with:

CompanyName.ProductName
CompanyName.ProductName.ClassName
CompanyName.ClassName.IsUpperCase(string str)

The .NET guidelines don't follow the Java style of using reversed FQ domain names to specify namespaces, and I've yet to see a commercial component such as Telerik or Infragistics for example follow anything other the guidelines than the MS ones.

like image 188
Kev Avatar answered Sep 22 '22 05:09

Kev