Re: Source Tree Structure

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"pearsons_11114" <pearsons11114@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0CDC4916-CA17-49D4-A35E-296EDED92C32@xxxxxxxxxxxxxxxx
> Hmm, not sure I follow. I wasn't able to find anything on "repertory", a
> term
> I'm not familiar with. But I take what you said below to mean that VS will
> follow the same convention as Java for a pre-existing source tree? For
> example, with the following source file:
>
> /com/company/xxx/yyy/MyClass.cs
>
> VS will add a namespace statement of "com.company.xxx.yyy" to the source?

No, VS will not modify any source when you load it. You can define a root
namespace for all source files you create(which defaults to the project
name), but loaded source will always remain the same.

VS will also append sub-directories to the namespace, so for a root
namespace of X, if you create a source file in a folder within the project,
you will get X.FolderName as the namespace in the file.

>
> If so, does that mean that that's the typical convention that people
> follow?
> Just looking for a consensus opinion. Thanks!
>

I follow a convention something closer to

<assem>/<sub1>/<sub2>

so for a project named OConnell.Magic with the namespace
OConnell.Magic.Wands the directory structure would be

OConnell.Magic/Wands/

and the assembly would be named OConnell.Magic. My general rule is if I want
to go above the root namespace its time to create a new assembly.


.



Relevant Pages

  • Re: location of using, include, and namespaces statement
    ... > directive now apply to the client's source file, too, if he ever ... > And would it help or hurt to put the 'using' directives inside ... your'e quite right - if namespace pollution is a concern [I suppose it ... > the header when you're not looking. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Source Tree Structure
    ... Repertory has the same meaning as Directory or as Folder. ... VStudio for VB.NET follows a different convention. ... > VS will add a namespace statement of "com.company.xxx.yyy" to the source? ... there is no relation between namespaces and the source file locations ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: python , Boost and straight (but complex) C code
    ... I write the following C source file: ... namespace {// Avoid cluttering the global namespace. ... then I write the following Python source: ... Freedom is always the freedom of dissenters. ...
    (comp.lang.python)
  • Re: Source Tree Structure
    ... with the following source file: ... VS will add a namespace statement of "com.company.xxx.yyy" to the source? ... By default, if you create a repertory and create a source file there, ... >> Newbie to .NET from Java, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how do you find the root namespace at runtime?
    ... > contained within a deeper namespace than the root. ... Then don't use the startup object, use a different class that is not ...
    (microsoft.public.dotnet.languages.vb)