namespace conventions

  • Thread starter Thread starter Flip
  • Start date Start date
F

Flip

In java, it is recommended using a package naming convention of your domain
name (or something similar). For example com.mycompany.screenscrapper. Is
there a similar type of convention suggested for namespaces in c#/.net?

Thanks.
 
Flip,

I don't believe there is a convention for namespace naming, other than
the fact that it should be Pascal named. However, having a company
identifier, then going down based on smaller and smaller categories is not a
bad idea. If you prefix with your company name (I don't think the com part
is necessary, really), then when you create your own Windows.Forms package,
it won't be misconstrued somewhere else.

Hope this helps.
 
Our namespaces go something like the following:

CompanyName.SolutionType.SolutionName

CompanyName.SolutionType.SolutionName.ProjectName

with the exception of WebControls where the SolutionName of the webcontrol is the
same as the project name (IE: MyCompany.WebControls.DatePicker.DatePicker
wouldn't look so good, so it's ns is just MyCompany.WebControls.DatePicker. The
DatePicker has a sample application which falls under
MyCompany.WebControls.DatePicker.DatePickerSample).

Diff SolutionType types:
Applications
Libraries
WebControls
Controls

Hope this helps...

Mythran
 
WOW! That was fast! :> Thank you both Nicholas and Mythran! Both of your
postings shed some light on conventions/recommendations. I always wondered
about the "com." part if everyone is doing it, uh, why do it? :>

Thanks again! :>
 
Back
Top