473,587 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Source Tree Structure

Newbie to .NET from Java, have a question about requirements/conventions for
source tree layout. In Java there a convention-bordering-on-requirement that
a source file's location in the source tree be determined by the package it
belongs to. Java IDEs do this automatically. I haven't found any
documentation for this in dotnet. VS by default dumps new source files into
the root regardless of namespace. Are there any conventions for this? Thanks!
Nov 17 '05 #1
4 1958
No, there is no relation between namespaces and the source file locations in
..NET. By default, if you create a repertory and create a source file there,
VS.NET will add the name of the repertory to the namespace but it's not
mandatory and can be changed.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
"pearsons_11114 " <pe***********@ discussions.mic rosoft.com> wrote in message
news:FF******** *************** ***********@mic rosoft.com...
Newbie to .NET from Java, have a question about requirements/conventions
for
source tree layout. In Java there a convention-bordering-on-requirement
that
a source file's location in the source tree be determined by the package
it
belongs to. Java IDEs do this automatically. I haven't found any
documentation for this in dotnet. VS by default dumps new source files
into
the root regardless of namespace. Are there any conventions for this?
Thanks!

Nov 17 '05 #2
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.xx x.yyy" to the source?

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

"Sylvain Lafontaine" wrote:
No, there is no relation between namespaces and the source file locations in
..NET. By default, if you create a repertory and create a source file there,
VS.NET will add the name of the repertory to the namespace but it's not
mandatory and can be changed.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
"pearsons_11114 " <pe***********@ discussions.mic rosoft.com> wrote in message
news:FF******** *************** ***********@mic rosoft.com...
Newbie to .NET from Java, have a question about requirements/conventions
for
source tree layout. In Java there a convention-bordering-on-requirement
that
a source file's location in the source tree be determined by the package
it
belongs to. Java IDEs do this automatically. I haven't found any
documentation for this in dotnet. VS by default dumps new source files
into
the root regardless of namespace. Are there any conventions for this?
Thanks!


Nov 17 '05 #3
Repertory has the same meaning as Directory or as Folder.

You are right about your example, if /com is the root or the starting
directory of your solution. This is mandatory in Java but not in .NET.

I don't know if that is the typical convention followed by people but it
doesn't hurt to follow it. Also, this is for C#; it is possible that
VStudio for VB.NET follows a different convention.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
"pearsons_11114 " <pe***********@ discussions.mic rosoft.com> wrote in message
news:0C******** *************** ***********@mic rosoft.com...
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.xx x.yyy" to the source?

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

"Sylvain Lafontaine" wrote:
No, there is no relation between namespaces and the source file locations
in
..NET. By default, if you create a repertory and create a source file
there,
VS.NET will add the name of the repertory to the namespace but it's not
mandatory and can be changed.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
"pearsons_11114 " <pe***********@ discussions.mic rosoft.com> wrote in
message
news:FF******** *************** ***********@mic rosoft.com...
> Newbie to .NET from Java, have a question about
> requirements/conventions
> for
> source tree layout. In Java there a convention-bordering-on-requirement
> that
> a source file's location in the source tree be determined by the
> package
> it
> belongs to. Java IDEs do this automatically. I haven't found any
> documentation for this in dotnet. VS by default dumps new source files
> into
> the root regardless of namespace. Are there any conventions for this?
> Thanks!


Nov 17 '05 #4

"pearsons_11114 " <pe***********@ discussions.mic rosoft.com> wrote in message
news:0C******** *************** ***********@mic rosoft.com...
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.xx x.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.
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
5320
by: FISH | last post by:
Ever have one of those days when you're not sure if it's you who's gone mad, or the rest of the world? I have an Open Source project on SourceForge for communication with YSMG - Yahoo's IM protocol. I keep the project source in three directories, based upon the code's function: one for the network API code itself, one for the support APIs...
3
14025
by: Steve Johnson | last post by:
Been banging my head on this for two days now. Hope someone can help! My test program below is in the form of a single JSP, with a Node class build in. (All the coded needed to run is below.) The technical requirements: 1) Store tree data in the database so that it can be extracted as a tree structure. For test purposes,
1
7156
by: Srihari | last post by:
I'm trying to develop a tree structure using javascript. The node values of the tree are generating from a mysql table depending on login. The tree structure contains 3 sub levels. I developed static HTML tree using http://www.treeview.net. now i need to generate this tree dynamically. Can any one has code for this?
4
612
by: Stephan Tobies | last post by:
Hi everyone, I am looking for a good data structure that could be used to represent families of trees with shared sub-trees and copy-on-write semantics. On a very abstract level, I would like to have an API like this: Let Node be a suitably defined data structure. Then the following functions shall be supported:
1
2732
by: David Hirschfield | last post by:
I've written a tree-like data structure that stores arbitrary python objects. The objective was for the tree structure to allow any number of children per node, and any number of root nodes...and for it to be speedy for trees with thousands of nodes. At its core, the structure is just a list of lists arranged so that if node A has children...
5
2655
by: Kent Boogaart | last post by:
Hi, I have some hierarchical data (FAQs) that I would like to bind to. The basic structure is: FAQ Category + Categories + FAQs So an FAQ category has any number of sub-categories and any number of FAQs.
5
3709
by: hankypan1 | last post by:
Hi All, I need a tree data structure for my application. It is the non -cyclic simple tree where i can have any number of children node and each child can recursively become a sub tree like a normal tree. Now the thing is i can popullate my tree at compile time like a global data. Since i know my tree definition at compile time, instead...
8
1790
by: =?ISO-8859-1?Q?m=E9choui?= | last post by:
Problem: - You have tree structure (XML-like) that you don't want to create 100% in memory, because it just takes too long (for instance, you need a http request to request the information from a slow distant site). - But you want to be able to request data from it, such has "give me all nodes that are under a "//foo/bar" tree, and have a...
0
2194
by: mac | last post by:
I found that with memory allocating techniques used nowadays (addresses alignment, eg. on 32bit machines) one can detect loops in a tree structure very fast, without using extra memory. This is due to a possibility of storing extra information in unused bits of the tree pointers (it works for linked lists too). One can say it is dangerous or...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8347
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.