Namespace question

M

mp

I have a multi project solution
if I Right click solution in solution explorer | select Property | default
namespace = "Investments"

in the solution there are 3 projects
Investments.ViewLayer
Investments.PresentationLayer
Investments.Model (renamed from BusinessLayer)

Investments.ViewLayer is the 'startup project'

each of these projects properties have their respective namespaces match the
project name
eg:
in project Investments.ViewLayer,
the objects (.cs files) in that project have:
namespace Investments.ViewLayer
{...

and the properties for the projects likewise have assembly name and default
namespace matching as well

is that a normal way to handle namespaces?

....there's a follow up question waiting but i better take this a step at a
time
.... it involves References (oh no, not that again <g>) and Interfaces

thanks
mark
 
A

Arne Vajhøj

I have a multi project solution
if I Right click solution in solution explorer | select Property | default
namespace = "Investments"

in the solution there are 3 projects
Investments.ViewLayer
Investments.PresentationLayer
Investments.Model (renamed from BusinessLayer)

Investments.ViewLayer is the 'startup project'

each of these projects properties have their respective namespaces match the
project name
eg:
in project Investments.ViewLayer,
the objects (.cs files) in that project have:
namespace Investments.ViewLayer
{...

and the properties for the projects likewise have assembly name and default
namespace matching as well

is that a normal way to handle namespaces?

...there's a follow up question waiting but i better take this a step at a
time
... it involves References (oh no, not that again<g>) and Interfaces

MS has publicized a recommendation for namespaces:

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

Making that operational in your context that could be:

MP.solutionname.projectname

Like:

MP.Investments.ViewLayer
MP.Investments.PresentationLayer
MP.Investments.Model

(replace MP with something actual)

When it comes to assembly names then the obvious must be:

MP.solutionname.projectname.dll
solutionname.projectname.dll
projectname.dll

The first one is the most logical, but the other
are occasionally seen.

The last one is a very bad choice in your case, because
your project names are so generic as they are.

Arne
 
A

Arne Vajhøj

MS has publicized a recommendation for namespaces:

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

Oops - old .NET 1.1 link.

The new one is:

http://msdn.microsoft.com/en-us/library/ms229026.aspx
Making that operational in your context that could be:

MP.solutionname.projectname

Like:

MP.Investments.ViewLayer
MP.Investments.PresentationLayer
MP.Investments.Model

(replace MP with something actual)

When it comes to assembly names then the obvious must be:

MP.solutionname.projectname.dll
solutionname.projectname.dll
projectname.dll

The first one is the most logical, but the other
are occasionally seen.

The last one is a very bad choice in your case, because
your project names are so generic as they are.

The first one is also the closest to what is recommended by MS:

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

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top