Information Technology Reference
In-Depth Information
Namespace Names
As you saw, the name of a namespace can contain the name of the company that created the
assembly. The name is also used to help programmers get a quick idea of the kinds of types
defined in the namespace.
Some important points about the names of namespaces are the following:
￿
A namespace name can be any valid identifier.
￿
A namespace name can include the period character, which is used to organize types
into hierarchies.
For example, the following are the names of some of the namespaces in the .NET BCL:
System
System.IO
System.Data
Microsoft.CSharp
System.Drawing
Microsoft.VisualBasic
System.Drawing.Drawing2D
Microsoft.VisualBasic.IO
Namespace naming guidelines suggest the following:
￿
Start namespace names with the company name.
￿
Follow the company name with the technology name.
￿
Do not name a namespace with the same name as a class or type.
For example, the software development department of the Acme Widget Company devel-
ops software in the following three namespaces, as shown in the following code:
￿ AcmeWidgets.SuperWidget
￿ AcmeWidgets.Media
￿ AcmeWidgets.Games
namespace AcmeWidgets.SuperWidget.SPDComponent
{
class SPDBase ...
...
}
Search WWH ::




Custom Search