473,467 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Namespaces?

Hi all,

I was wondering if someone could offer me some advice with namespaces...

Primarily when and where to use them - you're explanations will need to be
aimed at the namespace-newbie :o)

I started a project this evening where I was given my classes namespace
declarations, but started to run into problems when some of the namespace
declarations contained a word that I had used as a class name...

For example...

Namespace Test.Me.Do

End Namespace
Now, if I had a class called "Do" - it'd get a "squiggle" in VS2005...

My main reason for using them really was to help, whilst developing my
application the type of "thing" I was dealing with...so a better example
(than the one above) might have been...

Namespace TrainingCompany.Courses

End Namespace

That namespace is declared at the top of my "Course" class - when using this
in code I can now create a nice to read object:

Dim Course As TrainingCompany.Courses.Course
Any advice appreciated..

Rob

May 25 '06 #1
2 894
I think typically this is done as:

CompanyName.ProductName.BusinessLogicTopicArea

In your case:

ACME.Anvil.Training

Then individual classes like Course, CourseSchedule,
Trainer, Location, CourseScheduleInstance, blah blah blah

You may or may not have these put into different names
other than the one above. This was just intended to give
you an idea.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp

"Rob Meade" <te*********************@edaem.bbor> wrote in message
news:__******************@text.news.blueyonder.co. uk...
Hi all,

I was wondering if someone could offer me some advice with namespaces...

Primarily when and where to use them - you're explanations will need to be
aimed at the namespace-newbie :o)

I started a project this evening where I was given my classes namespace
declarations, but started to run into problems when some of the namespace
declarations contained a word that I had used as a class name...

For example...

Namespace Test.Me.Do

End Namespace
Now, if I had a class called "Do" - it'd get a "squiggle" in VS2005...

My main reason for using them really was to help, whilst developing my
application the type of "thing" I was dealing with...so a better example
(than the one above) might have been...

Namespace TrainingCompany.Courses

End Namespace

That namespace is declared at the top of my "Course" class - when using
this in code I can now create a nice to read object:

Dim Course As TrainingCompany.Courses.Course
Any advice appreciated..

Rob

May 26 '06 #2
"Robbe Morris [C# MVP]" wrote ...
I think typically this is done as:

CompanyName.ProductName.BusinessLogicTopicArea

In your case:

ACME.Anvil.Training

Then individual classes like Course, CourseSchedule,
Trainer, Location, CourseScheduleInstance, blah blah blah

You may or may not have these put into different names
other than the one above. This was just intended to give
you an idea.


Hi Robbe,

Many thanks for your reply and information - I'll give that ago this evening
and see if I can make your model "fit" as it were...

Thanks again

Rob
May 26 '06 #3

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

Similar topics

18
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
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...
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...
22
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: 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
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.