473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Namespaces and Folders

I have a namespace standard that I have to adhere to set by our development
staff:

[CompanyName.SolutionType.SolutionName.ProjectName]

So, an example:

MyCompany.Libraries.MyLibrary (When projectname == solutionname, we leave
the projectname off of the namespace).

Application:

MyCompany.Applications.MyApp.WebUI -> Web UI
MyCompany.Applications.MyApp.DAL -> Data Access Layer
MyCompany.Applications.MyApp.Schema -> Schema
et cetera ...

Now, for folders, we have standards similar to:

Solution
Project
classes
modules
data
Now, in the schema project, we have datasets under the data folder. In
VB.Net, this was good, we would dimension a variable in our other projects
(UI, WebUI, DAL, BLL, et cetera) similar to:

Dim ds As Schema.MyDataSet = New Schema.MyDataSet()

But in C#, because of the way it places the datasets under the namespace of
the parent folder, the way to create the same variable would be:

Dim ds As Schema.data.MyDataSet = New Schema.data.MyDataSet()

The above goes against the standards...not that it's all that bad, but we
don't want it like this. Is there a way, without manually editing the
autogenerated dataset code files, to keep the project namespace without
adding the foldername to the namespace inside classes added to the project,
or autogenerated code (such as the dataset)?

Thanks in advance...

Mythran
Nov 16 '05 #1
3 1858
In Visual Studio projects, you can set the default namespace. That may work
for you.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:ug**************@TK2MSFTNGP15.phx.gbl...
I have a namespace standard that I have to adhere to set by our development
staff:

[CompanyName.SolutionType.SolutionName.ProjectName]

So, an example:

MyCompany.Libraries.MyLibrary (When projectname == solutionname, we leave
the projectname off of the namespace).

Application:

MyCompany.Applications.MyApp.WebUI -> Web UI
MyCompany.Applications.MyApp.DAL -> Data Access Layer
MyCompany.Applications.MyApp.Schema -> Schema
et cetera ...

Now, for folders, we have standards similar to:

Solution
Project
classes
modules
data
Now, in the schema project, we have datasets under the data folder. In
VB.Net, this was good, we would dimension a variable in our other projects
(UI, WebUI, DAL, BLL, et cetera) similar to:

Dim ds As Schema.MyDataSet = New Schema.MyDataSet()

But in C#, because of the way it places the datasets under the namespace
of the parent folder, the way to create the same variable would be:

Dim ds As Schema.data.MyDataSet = New Schema.data.MyDataSet()

The above goes against the standards...not that it's all that bad, but we
don't want it like this. Is there a way, without manually editing the
autogenerated dataset code files, to keep the project namespace without
adding the foldername to the namespace inside classes added to the
project, or autogenerated code (such as the dataset)?

Thanks in advance...

Mythran

Nov 16 '05 #2
"Nick Malik [Microsoft]" <ni*******@hotmail.nospam.com> wrote in message
news:lc********************@comcast.com...
In Visual Studio projects, you can set the default namespace. That may
work for you.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--


I know this. That is how I get the
MyCompany.Applications.MySolution.MyProject part of the namespace...but the
..Net ide always adds the folder to the namespace when I don't want this at
all. Why does it force you to use the folder name as part of the namespace
(as in they autogenerate it for you and it is automatically part of the
namespace for autogenerated typed datasets which can be changed but makes
maintenance more difficult).

Why would there not be an option to turn that "feature" off? I have nothing
against Microsoft, but dang, couldn't they have thought far enough ahead on
this? (Yeah, I am one of the few that like ms products...even though I do
come from the *nix environment).

Any way around this?

Thanks,

Mythran
Nov 16 '05 #3
You can set the namespace specifically for a dataset by using the property
« Custom Tool Namespace » of the XSD file.

S. L.

"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:uR**************@TK2MSFTNGP14.phx.gbl...
"Nick Malik [Microsoft]" <ni*******@hotmail.nospam.com> wrote in message
news:lc********************@comcast.com...
In Visual Studio projects, you can set the default namespace. That may
work for you.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--


I know this. That is how I get the
MyCompany.Applications.MySolution.MyProject part of the namespace...but
the .Net ide always adds the folder to the namespace when I don't want
this at all. Why does it force you to use the folder name as part of the
namespace (as in they autogenerate it for you and it is automatically part
of the namespace for autogenerated typed datasets which can be changed but
makes maintenance more difficult).

Why would there not be an option to turn that "feature" off? I have
nothing against Microsoft, but dang, couldn't they have thought far enough
ahead on this? (Yeah, I am one of the few that like ms products...even
though I do come from the *nix environment).

Any way around this?

Thanks,

Mythran

Nov 16 '05 #4

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

Similar topics

11
by: Random | last post by:
I'm confused about the proper use and usefulness of namespaces. I beleive I understand the purpose is so the developer can put classes within namespaces to essentially organize your code. And I...
1
by: Yehia A.Salam | last post by:
Hello, I got confused with all the folders generated by VS and the way it handles namespaces, my project simply consists of a control library and an application that uses it, my namespaces is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...

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.