<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.developerdotstar.com/community" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>developer.* Blogs - Organizing .NET Namespaces - Comments</title>
 <link>http://www.developerdotstar.com/community/node/131</link>
 <description>Comments for &quot;Organizing .NET Namespaces&quot;</description>
 <language>en</language>
<item>
 <title>Great...</title>
 <link>http://www.developerdotstar.com/community/node/131#comment-1255</link>
 <description>&lt;p&gt;Great article, well written and in total agreement with all my design principles.&lt;/p&gt;
&lt;p&gt;Congrats...&lt;/p&gt;
</description>
 <pubDate>Mon, 10 Jul 2006 08:50:17 -0700</pubDate>
 <dc:creator>ChrisG</dc:creator>
 <guid isPermaLink="false">comment 1255 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Response</title>
 <link>http://www.developerdotstar.com/community/node/131#comment-669</link>
 <description>&lt;p&gt;In order, here are my responses.&lt;/p&gt;
&lt;p&gt;#1) You&#039;ve said you know the difference between the three items you mention, but I&#039;ll re-iterate anyway so we&#039;re on the same page. I think of them like this:&lt;/p&gt;
&lt;p&gt;Project = source code organized via a &quot;project&quot; file that is then included in a solution in Visual Studio.&lt;/p&gt;
&lt;p&gt;Assembly = the compiled output of a project.&lt;/p&gt;
&lt;p&gt;Namespace = a logical grouping of common functionality.&lt;/p&gt;
&lt;p&gt;Given the above, one project can contain code belonging to multiple namespaces if necessary. And since the assembly is the compiled output of a project, so can the assembly.&lt;/p&gt;
&lt;p&gt;#2) No. The way I&#039;ve worked until very recently is to, as much as possible, create one project for every namespace I need. Similarly, if using VS.NET, only one project will go into a solution file. This keeps the code seperated out into the most cohesive chunks possible for ease of maintenance. I have had to combine namespaces into a single assembly before, and that might not be a problem if you work in a traditional build-n-ship software company. But I&#039;ve found that it creates nightmares in a highly volatile web shop where multiple development efforts can bottleneck on the same project because too much functionality is tied up in it. The only time I would combine namespaces into a single assembly is to deal with an otherwise circular relationship that can&#039;t be factored out of the design....and that should almost never happen.&lt;/p&gt;
&lt;p&gt;Having said that, I&#039;m sure it&#039;s possible to get VS.NET to copy your built assemblies to a common directory from which all of your projects reference their dependent assemblies. Then when you build, all your other projects using that common directory will be automatically updated when you refresh their references or recompile them in turn. Similarly, you could create one monolithic solution file that contains all of your namespace projects, and specify the build order in the solution so that everything gets built at compile time. This has the pleasant side effect of also telling you when you&#039;ve unwittingly introduced a circular reference somewhere. This is the strategy I&#039;ve been using more recently since I&#039;ve started working with .NET 2.0.&lt;/p&gt;
&lt;p&gt;#3) If Assembly B needs to use classes in Assembly A, you have to add a reference. Your hunch is correct that your business class assemblies should reference the data namespace and not the other way around. Nor should you consider tightly coupling the data classes with the business classes as in compiling them into the same assembly. I&#039;m not exactly sure what you mean when you say you map the output of your data readers to your business classes, but if your business classes are building statements or feeding sproc calls via the data layer to the database, they should be the ones handling the output of the data reader and then transforming that into a &quot;state&quot; class that&#039;s handed back to the caller from the application layer.&lt;/p&gt;
&lt;p&gt;Feel free to post a pseudo-code example if you want.&lt;/p&gt;
</description>
 <pubDate>Wed, 07 Dec 2005 12:53:26 -0800</pubDate>
 <dc:creator>trevor.conn</dc:creator>
 <guid isPermaLink="false">comment 669 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Great article.  I have a</title>
 <link>http://www.developerdotstar.com/community/node/131#comment-667</link>
 <description>&lt;p&gt;Great article.  &lt;/p&gt;
&lt;p&gt;I have a few questions that I was hoping you would answer.  &lt;/p&gt;
&lt;p&gt;1.  I am a little confused by the differences between a .NET project, an assembly and a namespace.  I know what each of these are, but it seems that I am constantly having to add references so that one assembly can see another.&lt;/p&gt;
&lt;p&gt;2.  In your example, did you create one project (CompanyName) and then create folders under the CompanyName project so that namespaces like CompanyName.Web.UI.Private can see CompanyName.Web.UI without adding references to CompanyName.Web.UI.Private?&lt;/p&gt;
&lt;p&gt;3.  Is there a way for CompanyName.Data to see CompanyName.Customer without adding references?&lt;/p&gt;
&lt;p&gt;I am asking these question because I have created as separate projects:&lt;/p&gt;
&lt;p&gt;CompanyName&lt;br /&gt;
CompanyName.Web.UI&lt;br /&gt;
CompanyName.Business&lt;br /&gt;
CompanyName.Data&lt;/p&gt;
&lt;p&gt;On my current project I need to map the output of datareaders from my data classes to my business classes.  This would suggest that I have a reference from Data to Business.  I was always under the impression that it should be the other way around.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description>
 <pubDate>Wed, 07 Dec 2005 09:19:02 -0800</pubDate>
 <dc:creator>Guest</dc:creator>
 <guid isPermaLink="false">comment 667 at http://www.developerdotstar.com/community</guid>
</item>
<item>
 <title>Organizing .NET Namespaces</title>
 <link>http://www.developerdotstar.com/community/node/131</link>
 <description>&lt;p&gt;A couple months ago I posted the following entry on a discussion forum myself and some friends participate in. A buddy was asking for tips on how to transition this massive VB/COM+ project over to .NET and how he should start thinking about structuring functionality into namespaces assemblies. I&#039;m just going to post it here in case it proves helpful for anyone else. I haven&#039;t really revised this post at all, so it may read sort of open-ended. Anyone with questions is welcome to ask.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.developerdotstar.com/community/node/131&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.developerdotstar.com/community/node/131#comment</comments>
 <category domain="http://www.developerdotstar.com/community/taxonomy/term/16">.NET</category>
 <pubDate>Sun, 20 Feb 2005 16:30:20 -0800</pubDate>
 <dc:creator>trevor.conn</dc:creator>
 <guid isPermaLink="false">131 at http://www.developerdotstar.com/community</guid>
</item>
</channel>
</rss>
