Domain Model Namespace naming conventions?

To prevent a particular folder forcing its contents to use the folder name as a namespace part, you can right-click the folder, choose "Properties" and then change "Namespace Provider" to False That would need to be done to all the folders to which it applies though, so I'm not sure if that's really answered your question fully Edit : looks like ReSharper adds this functionality.

To prevent a particular folder forcing its contents to use the folder name as a namespace part, you can right-click the folder, choose "Properties" and then change "Namespace Provider" to False. That would need to be done to all the folders to which it applies though, so I'm not sure if that's really answered your question fully. Edit: looks like ReSharper adds this functionality.

The only property I see is folder name... I have found that Namespace Provider is a ReSharper property. – awrigley Jan 13 at 10:13 Hmm, yes you are right. Sorry - I haven't got a machine without R# installed to check with before answering and I assumed it was a VS thing.

I assume a R#-specific answer is not a viable solution for you? – Mark Embling Jan 13 at 13:03 No answers quite fit the bill, but this answer brought ReSharper into focus. So have given it the biscuit.

– awrigley Jan 16 at 11:35.

Coaxing your IDE to use a naming convention that suits your particular environment is good practice. You can use the default namespace box in the Application tab of the project properties to change the namespace that VS automatically inserts in your class files.

Thanks, grenade: +1 for the bit about good practice. However, your tip about the default namespace name won't stop VS adding the folder name onto my default namespace name. (NOTE: the default namespace name defaults to the project name which is fine with me; my issue is with the IDE adding the folder name to the namespace declaration).

– awrigley Jan 12 at 16:39.

I'm not sure if it possible to configure in VS2010 to disable this.. but I would not do that. If your code file placed in Domain folder, its namespace should be Company.Domain. If domain has sub folder Services, namespace should be Company.Domain.Services.It is a good (and whats important - common, practice).

You better stick to the rules, over violating them :).

1 alexanderb: it is always good to question the rules. The rules are not always good: I started with MS Access and VBA and took an instant dislike to the "standard", ie, Leszynski naming convention. It doesn't port anywhere out of Access and doesn't take account of modern intellisense.

But so be it, I listen. – awrigley Jan 12 at 16:44.

My suggestions to use singular ending while naming namespaces, folders and classes. For example namespace ES.eLearning.Domain. Services would be preffered as ES.eLearning.Domain.

Service // Just a small thing that might make the code (namespace) shorter and easier to read at the same time. PS. On the other hand ASP.NET MVC does not follow this "rule": Content Controllers Models Scripts Views But nothing keeps you "renaming" them in the source code anyway.

1 @J Pollack: I disagree with that one. I think of a namespace as something that holds things, eg, Services, or FileTypes. For example, Text is just one of many FileTypes.

– awrigley Feb 11 at 12:39 Well I just wanted to show there is another way. In database context it makes sense. Using plural table names, writing a query that gives something like: SELECT tags.Name, tags.

Description FROM tags WHERE tags. Xxx = YYY; and the "tags.Name" looks a little weird because it's looks like an attribute access in a lot of language. Excuse the off topic :) – J Pollack Feb 11 at 12:57.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions