Generating namespaces

One common problem I find is that developers do not understand the difference between deployment units and namespaces. The most common confusion is that these can often be the same, so they keep creating new assemblies.

However just fire up the object browser and take a look at the system assemblies. In particular look at system.dll and mscorlib.dll. Notice how the System.Web namespace is spread over mscorlib.dll, system.dll and system.web.dll.  Notice how System.Diagnostics is not a separate dll just part of system.dll.

So instead of creating a new project, create a new folder. Projects create deployment complexity, whereas folders simplify projects by grouping things together. While you are still working inside a single project you can still move things around, and you haven’t needed to change all sorts of deployment scripts. Consider this diagram

If you think that the blue shapes relate to assemblies, consider instead that they might simply be namespaces.

Only create projects and separate assemblies once you have multiple applications and there is reuse. Having something reused in multiple applications is where multiple assemblies starts, not before. This diagram shows again namespaces, where the reusable parts are shipped in a single assembly.

Advertisement