I have a small issue with namespace and class naming. Here is a practical example:

ResourceLayer.cs       - Public component that holds the manager and the map provider, implements an interface 
ResourceMapProvider.cs - Provides a bitmap representation of the resources
ResourceManager.cs     - Is a repository of resources with some utility methods
Resource.cs            - A resource entity

But I'm going to have a larger number of layers, each specialized so this is going to be replicated a lot.

I have no idea how to namespace it in a conceptually correct fashion. Here are my ideas and why I believe they don't work:

App.ResourceLayer - Same name as class, bad practice and had some scope issues

App.ResourceUtils - Good name, but ResourceLayer.cs doesn't really fit into the namespaces and I wouldn't know where to put it  

App.Resource - Same name as a class that would be in it, scoping issues (App.Resource.Resource) 

App.Resources - Confusing (App.Resources.Resource) , doesn't really fit the layer part (App.Resources.ResourceLayer) 

So, does anyone have any naming ideas?

  • Hmm , what do you mean?
    – overburn
    Oct 4, 2016 at 7:02
  • Maybe they're just examples but your class names are very vague. What would ResourceManager.cs do? And why do you have a class named ResourceLayer.cs? Wouldn't a layer constitute multiple classes? Maybe you can give us more info on the responsibilities of these classes because it's hard to help with namespacing without understanding what the classes do.
    – Alternatex
    Oct 4, 2016 at 7:10
  • I've added some basic descriptions. Ah, the "Layer" name is a concept of the application, I'm basically overlapping many data layers such as this in a visual way. It's not an architectural layer.
    – overburn
    Oct 4, 2016 at 7:18
  • If my understanding of your naming-and-layers-pattern is correct you are going to have another set of classes named for example ImageLayer.cs, ImageMapProvider,...? So your namespacing-ideas would go with App.lmageLayer or App.ImageUtils,..?
    – MJumper
    Oct 4, 2016 at 7:43
  • Yeah, there's going to be , for example, an "ElevationLayer" which will have those components as well (maybe more, maybe others , etc)
    – overburn
    Oct 4, 2016 at 7:48

2 Answers 2


Rename Resource.cs to ResourceEntity.cs and you can let it's namespace be Resource. Same with Elevation and all the others.

That solves the naming problem. Be sure you're comfortable with this cookie cutter design. It's easy to obsess on creating a predictable structure to work within and ignore problems caused because you insist on sticking with it rather than rethink the structure.


According to the C# naming guidelines, namespaces should be plural, eg. ResourceLayers rater than ResourceLayer. This avoids collisions between class and namespace name.

That said, you might not even need a separate namespace for each layer since in the naming scheme you suggest, the name of the layer is used in the names of all the components of the layer. So you don't really need a namespace to disambiguate. Having too many unnecessary namespaces leads to clutter.

  • Can you reference those guidelines somewhere? Oct 4, 2016 at 11:52
  • @AdamPlocher: I have added a link.
    – JacquesB
    Oct 4, 2016 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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