Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

English in not my native language, therefore it is a little more difficult to pick a good name for a namespace. One example to make you see my problem a bit better:

We have a set of classes that have to do with the way a company is organized (we can create organizational charts with it). Currently the namespace is CFW.CoreSystem.Organizational. Is this a good name?

What is linguistically the best way to name a namespace? (CFW.CoreSystem.Configuration is better than CFW.CoreSystem.Configurables).

[Moved it from StackOverflow]

share|improve this question

1 Answer 1

up vote 7 down vote accepted

The name chosen for a namespace should indicate the functionality made available by types in the namespace. For example, the System.Net.Sockets namespace contains types that enable developers to use sockets to communicate over networks.

The general format for a namespace name is as follows:

<Company>.(<Product>|<Technology>)[.<Feature>][.<Subnamespace>]

For example, Microsoft.WindowsMobile.DirectX.

Do use Pascal casing, and separate namespace components with periods (for example, Microsoft.Office.PowerPoint). If your brand employs nontraditional casing, you should follow the casing defined by your brand, even if it deviates from normal namespace casing.

Consider using plural namespace names where appropriate. For example, use System.Collections instead of System.Collection. Brand names and acronyms are exceptions to this rule, however. For example, use System.IO instead of System.IOs.

Do not use the same name for a namespace and a type in that namespace. For example, do not use Debug for a namespace name and also provide a class named Debug in the same namespace. Several compilers require such types to be fully qualified.

There are lots of Do or Do'not detail on MSDN regarding Naming of namespace, Assemblies etc. Check this out for Namespaces

CFW.CoreSystem.Configuration is better.

The Namespace CFW.CoreSystem.Organizational is pretty good but CFW.CoreSystem.Organization is much better to write.

share|improve this answer
    
I know the guidelines... but as a non native English speaker I was wondering why Configuration is better than Configurable? –  Kees C. Bakker Nov 26 '11 at 13:50
1  
It's more common to use nouns in namespaces. I see you're Dutch, so maybe it's more understandable when I say it in Dutch: het is gebruikelijk om zelfstandige naamwoorden te gebruiken in namespaces. In jouw geval zou Configurables vertalen naar 'configureerbaarheden' en Configuration naar 'configuratie'. Waarbij de tweede optie toch iets beter klinkt. –  Tom van Enckevort Nov 26 '11 at 14:15
    
@kees I'd say Configuration is better because the namespace contains functionality regarding the application Configuration - it could also contain relevant utilities and the like. Configurables tells me that everything within that namespace is something that is configurable. Which might not be the case. –  Arve Systad Nov 26 '11 at 18:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.