tags:

views:

54

answers:

3

Hi there,

Well i have just been through my rather large project and used correct namespacing (within the naming conventions) so i have things like Models, Service, UI etc.... all the standard stuff..

AND I HAVE DRAWN A BLANK :-)!!

I have quite a few enumerations, constants and things like that which i need to extract them from a generic class i have and insert them into a class/project of there own so i can add a reference to it from all my projects that need it.

Can anyone suggest a good naming convention for holding enumerations and constants etc.. I thought about using CompanyName.Product.Enumerations but there again its NOT just enumerations..

I was hoping for a little input or advise and good namespace naming structure for this sort of project (holding enumeration, collections, and constants)

Thanks in advance

+2  A: 

The enumerations should live in the same namespace as the types that use them - don't create namespaces that organize things by how they are designed.

Just think - would you create namespaces like this?

Comp.Project.Classes
Comp.Project.Structs
Comp.Project.Interfaces

No, because that doesn't mean anything and provides no contextual information about the types that are contained there. Enums are just like any other type - they belong in a namespace that has contextual meaning to the enum itself.

Andrew Hare
Thanks, yes very true, but the problem is i have 2 projects, one is base project/class... - one inherits from the other but has methods inside it already that can't be overriden ... hence both the Base and the inherited class have methods that need access to the same enums, constants etc
mark smith
A: 

Maybe some something like CompanyName.Product.Reference as assemblyname, then specify further using Reference.Constants, Reference.Enums etc?

Colin
A: 

well, usually I would recommend against seperating them. The same resons apply as why I don't like "toolbox" projects that end up as a code-dump.

Can't you simply let your other projects reference your current assembly? It sounds like you are seperating elements that are vital to your Business Rules, why not draw the name from that area?

Johannes Rudolph
True but i have 2 projects, one is a base class project and the other inherits from it.... hence both need access to the same enums, constants
mark smith
why don't put them in the base class poject?
Johannes Rudolph