Namespaces

  • DO organize namespaces with a clearly defined structure: .(|)..[.] Examples:
TSP.AssetManagement.Catalog.Api
TSP.AssetManagement.Catalog.Domain
TSP.AssetManagement.Catalog.Infrastructure
  • DO use PascalCasing, and separate namespace components with periods.

  • DO prefix namespace names with a company name to prevent namespaces from different companies from having the same name.

    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.

    Brand names and acronyms are exceptions to this rule, however.

    // Example
    TSP.AssetManagement.Catalog.FunctionalTests
    TSP.AssetManagement.Catalog.UnitTests
    
    // Exception
    TSP.AssetManagement.Catalog.Api
    
  • DO choose names that indicate logical grouping of classes with specific pattern.

  • DO NOT use the same name for a namespace and a type in that namespace.

    namespace TSP.AssetManagement.Catalog.Api;
    
    public class Api
    {
        // ...
    }
    

Learn More