I'm working on a new project design and would love feedback/criticism of this approach. Here's an example of the type of issue I've come across:
I'd like to create a class to contain details about a particular machine ("Example.Machine" class). I would also like to reference software that is installed on that machine.
Should I design these components as Example.Machine.Software or Example.Software? When I try the first approach, I get errors because "Machine" is not a namespace, it's a class.
Any constructive feedback would be appreciated. And the example I've given here is not specific to my design, so please don't give "you should be using X namespace, don't design your own"-style answers. My question is more of a broad "how the heck do you plan namespaces?" than anything else. ;)

1 answers
I usually use project_name.physical_attribute.functional_attribute kind of convention.
So, if I was working on a webpage for Courses
I would have a namespace
project_name.web.pages.courses or something like that.
Then if I had controls I would use
project_name.web.controls.control_name
HTH,
Harry C
answered 2 years ago by:
0
That's encouraging, because I use pretty much the same convention for pages & controls.
But what convention do you use for the class libraries that your web pages & controls reference? In your example, you may have a web page that instantiates a course, and you may have a control that does the same. So I would imagine you might have a separate class library project that has a project_name.classroom.course class & a project_name.classroom.student class. But what if you wanted to reference the attributes of the classroom -- would it look like project_name.classroom.classroom or would it just be project_name.classroom?
I think the answer is that there will never be a class that has the same name as a namespace, but I could be completely off base, so I'm looking for a pat on the back or a good slap in the face. ;)
answered 2 years ago by:
0
This post was imported from csharpfriends, if you have a similiar question please ask it again.
All previous members have been migrated, hope you enjoy the new platform!