<p>I am using an ASP.NET MVC project and everytime I add a class to a folder it makes really long namespaces.  </p>

<p><strong>Example</strong>: </p>

<pre><code>Project = Tully.Saps.Data  
Folder = DataAccess/Interfaces  
Namespace = Tully.Saps.Data.DataAccess.Interfaces

Folder = DataAccess/MbNetRepositories  
Namespace = Tully.Saps.Data.DataAccess.MbNetRepositories
</code></pre>

<p><strong>Question</strong>:<br>
Is it best to leave the namespace alone and add the using clause to the classes that access it or change the namespace to Tully.Saps.Data for everything in this project?</p>

[{'answer_id': 66683, 'author': 'Stu', 'author_id': 414, 'author_profile': 'https://Stackoverflow.com/users/414', 'pm_score': 2, 'selected': True, 'text': "<p>Leave them alone and add the usings. You're asking for trouble manually changing things like that (harder to debug, inconsistent with other projects, et cetera).</p>\n"}, {'answer_id': 66685, 'author': 'Redbaron', 'author_id': 41, 'author_profile': 'https://Stackoverflow.com/users/41', 'pm_score': 0, 'selected': False, 'text': '<p>It is really up to you how you want to deal with it. If you are only going to be accessing a member of a namespace once or twice, then adding the "using" statement really doesn\'t do much for you. </p>\n\n<p>If you are going to use it multiple times then reducing the namespace chain is probably going to make things easier to read.</p>\n\n<p>You could always change the namespace so it doesn\'t add the new folder name if you are just looking to logically group files together, without creating a new namespace.</p>\n'}, {'answer_id': 66752, 'author': 'Sklivvz', 'author_id': 7028, 'author_profile': 'https://Stackoverflow.com/users/7028', 'pm_score': 0, 'selected': False, 'text': '<p>According to FXCop, and I agree:</p>\n<blockquote>\n<p><strong>Avoid namespaces with few types</strong></p>\n<p>A namespace should generally have more than <strong>five</strong> types.</p>\n</blockquote>\n<p>also (and this applies to the &quot;single namespace&quot; suggestion -- which is <em>almost</em> the same to say as no namespace)</p>\n<blockquote>\n<p><strong>Declare types in namespaces</strong></p>\n<p>A type should be defined inside a namespace to avoid duplication.</p>\n</blockquote>\n'}, {'answer_id': 66859, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<ul>\n<li>Namespaces </li>\n</ul>\n\n<p>.Namespaces help us to define the "scope" of a set of entities in our object model or our application. This makes them a software design decision not a folder structure decision. For example, in an MVC application it would make good sense to have Model/View/Controller folders and related namespaces. So, while it is possible, in some cases, that the folder structure will match the namespace pattern we decide to use in our development, it is not required and may not be what we desire. Each namespace should be a case-by-case decision</p>\n\n<ul>\n<li>using statements</li>\n</ul>\n\n<p>To define using statements for a namespace is a seperate decision based on how often the object in that namespace will be referred to in code and should not in any way affect our namespace creation practice.</p>\n'}, {'answer_id': 69260, 'author': 'Haoest', 'author_id': 10088, 'author_profile': 'https://Stackoverflow.com/users/10088', 'pm_score': 0, 'selected': False, 'text': "<p>Leave it. It's one great example of how your IDE is dictating your coding style. </p>\n"}, {'answer_id': 69295, 'author': 'Bill', 'author_id': 9887, 'author_profile': 'https://Stackoverflow.com/users/9887', 'pm_score': 0, 'selected': False, 'text': '<p>Just because the tool (Visual Studio) you are using has decided that each folder needs a new Namespace doesn\'t mean you do.<br>\nI personally tend to leave my "Data" projects as a single Namespace.  If I have a subfolder called "Model" I don\'t want those files in the Something.Data.Model Namespace, I want them in Something.Data.</p>\n'}]
['https://Stackoverflow.com/questions/66635', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9938/']