Nested Namespaces for Special Types

Problem
You want to know guidelines for organizing common application types.

Solution
Here are some guidelines for namespaces containing specific types:

1. Place modules and utility classes that may be reused in other applications in a compiled DLL or linked file under a second-level namespace called Utilities. Example: AutomatedQa.Utilities.
2. Group modules and utility classes that are specific to the current application in a third-level namespace called Helpers. Example: AutomatedQa.Navigation.Helpers.
3. Put design-time types, such as those used to implement custom designers, in a nested namespace called Design. Example: AutomatedQa.Windows.Forms.Design.
4. Data and business object types should be placed in third-level namespaces called DataObjects and BusinessObjects, respectively. Example: AutomatedQa.Pages.DataObjects, AutomatedQa.Pages.BusinessObjects.
5. Public types that should not be used by other assemblies should be placed in a nested namespace called Internal. Example: AutomatedQa.Pages.Internal.
6. Types for custom permissions should be grouped in a nested namespace called Permissions. Example: AutomatedQa.Pages.Permissions.
7. Organize types that are used to configure your application in a nested namespace called Configuration. Example: AutomatedQa.Pages.Configuration.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s