Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

any ideas on this... i've got a web application and was thinking of having namespaces like...

 

companyname.datamanager

companyname.booking

companyname.vehicle

 

these would also be the class names or very similar to...

 

there are a many examples with namespaces such as

 

companyname.datatier.booking

companyname.datatier.vehicle

 

i dont see the point in this... maybe there is when you have bigger applications than we have... or if you ever intend to split the different tiers on to different machines.. which i dont ever see happening

 

any data managing happens in the datamanager class/namespace

 

do i really need to split the namespaces the "Microsoft" way??

 

are there any other good reasons or articles people know of on how to organise things?

  • *Experts*
Posted
Namespaces were mainly made so there was no conflicts with the names of the object. But they provide great organization too, for example lets say you dont know the name of some class but you know it should be in System.IO becuase it does something with a file, you look through that namespace instead of all 3500 classess. You dont really need them for small projects, but iff it gets bigger it can be a lot of help.
Posted

ok so would you be suggesting not to use namespaces at all?

 

or just a companyname namespace?

 

the basic object model we got is about 10 classes each will inherit from DataManager..

 

i can see that it doesn't really help "the organisation" of the classes to split that up into namespaces and i cant see us having huge numbers of classes in the future

 

does anyone think different - just trying to get other peoples ideas on how anyone else has put together solutions

  • *Experts*
Posted

If there are only a few classes (maybe up to 15 or so), and you can stick them all in one namespace, then do that. If the classes start getting confusing, then start splitting them up.

 

For example, if you have written some Socket wrapper and helper classes for your project, you might consider putting those in the namespace "MyCompany.Sockets" and you might want to put data object classes in "MyCompany.DataObjects".

 

You organize it how you are comfortable with it; there's no required way to do it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...