views:

2110

answers:

3

What's the difference between the two..??

+5  A: 

Assuming that you are talking about .NET (with relation to Visual Studio) then the root namespace is what each class you create in a visual studio project will become part of. It is also the base for any sub-namespaces that are automatically assinged when you create a class inside of a project folder.

So with a base namsepace of ACMECorp.Bombs all of your classes would become part of the ACMECorp.Bombs namespace so the class GravityBomb would have a full name of ACMECorp.Bombs.GravityBomb. A class called FlyingBomb created in a project folder called GuidedBombs would have a full type name of ACMECorp.Bombs.GuidedBombs.FlyingBomb.

The Assembly name is simply the name of the compiled file that your code will be compiled to as either an executable or library etc..

A question that i often see on this is should your assembly name be the same as the root namespace and also be the same as your project name (again in visual studio). I used to be of the mind set that you should have a project name the same as the assembly name the same as the root namespace just as is the default with visual studio. However if you need to do some major refactoring and renaming this can become a pain in the bum, especially if you are using source control (as you then should start renaming the project folders).

My suggestion would be that your project name is simply a descriptive name of the contents of the project. Your assembly name should consist of the technology area and compnent description or company name and technology area (depending on your preferance), and your root namespace should be as described by the Microsoft naming standards so:

Project: Biometric Device Access Assembly: BiometricFramework.DeviceAccess.dll Namespace: ACME.BiometricFramework.DeviceAccess

Some refernce material for you:

http://blogs.msdn.com/brada/archive/2003/04/19/49992.aspx

http://msdn.microsoft.com/en-us/library/ms229026.aspx

http://msdn.microsoft.com/en-us/library/ms229048.aspx

A: 

Thanks!!, Yes I was talking about .NET.

Have you used a namesspace split across multiple assembly? Why ever we would do that?

MOZILLA
A: 

In the .NET Framework, the System namespace is split over a number of assemblies, notably mscorlib.dll & System.dll

James Curran