473,322 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

namespace conventions

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.
Nov 16 '05 #1
5 8272
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Flip" <[remove]ph******@hotmail.com> wrote in message
news:uI**************@TK2MSFTNGP15.phx.gbl...
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.

Nov 16 '05 #2
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

"Flip" <[remove]ph******@hotmail.com> wrote in message
news:uI**************@TK2MSFTNGP15.phx.gbl...
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.

Nov 16 '05 #3
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! :>
Nov 16 '05 #4
Flip,
In addition to the other comments.

The "Design Guidelines for Class Library Developers"
http://msdn.microsoft.com/library/de...Guidelines.asp
Covers Namespace naming conventions:

http://msdn.microsoft.com/library/de...Guidelines.asp

Hope this helps
Jay

"Flip" <[remove]ph******@hotmail.com> wrote in message
news:uI**************@TK2MSFTNGP15.phx.gbl...
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.

Nov 16 '05 #5
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message

Thank you Jay. I'll take a look at these links over lunch! :>
Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dave Slinn | last post by:
Any advice on how to organize my core class library project into sub-namespaces? What are the general rules of thumb regarding cross-namespace references? Can I have a class in namespace A have a...
0
by: Steven Blair | last post by:
Hi, quick question regarding namspaces. Here is an exmaple of a little project I am working on. I have a GUI, a Business Layer dll and a Database dll. What is the best strategy for naming...
14
by: gilad | last post by:
Hi, I have just released the initial beta of a C# project called 'aumplib'. aumplib is a C# namespace which is made up of a set of classes that interface several prominent open source audio...
3
by: gilad | last post by:
This is to announce the beta 2 release of Aumplib. After garnering comments from this newsgroup, I have modified the code to use a more standard style convention. Aumplib is a C# namespace which...
2
by: UJ | last post by:
What's the general feeling on using the using keyword versus spelling the type out completely. For instance, do most people put a using in so they can just say MyNewType or do people not use...
12
by: Keith Patrick | last post by:
Can someone tell me the difference in terms of actual implications using: namespace MyNamespace { using System; class MyClass {...} } vs. using System;
1
by: mrpubnight | last post by:
Hi everyone, just hoping to get some opinions from those who have been using/creating namespaces for a while. Currently I have our namespace as follows: CompanyName.Location.Client.Class So...
16
by: thefritz_j | last post by:
We just converted our VS2003 1.1 VB web project (which was working fine) to VS2005 2.0 and now I get: Parser Error Message: Could not load type '<Namespace>.'. Source Error: Line 1: <%@...
12
by: Taras_96 | last post by:
Hi everyone, AFAIK external linkage allows you to refer to variables/functions outside of the current translation unit. A variable in an unnamed namespace is similar to declaring a static...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.