Namespaces?

R

Rob Meade

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 :eek:)

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
 
R

Robbe Morris [C# MVP]

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.
 
R

Rob Meade

...
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
 

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

Similar Threads

Not a question, just proud and wanted to share this 1
GAC and namespaces 1
#include and namespaces 20
namespaces 3
2.0 Namespaces 2
Nested namespaces 0
Indentation styles for namespaces? 3
Namespaces 2

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top