Search code examples
c#.netopen-sourcenamespaces

C# Open Source Project Namespace


I am considering releasing one of my class libraries written in C# as open source. Before doing that, I am trying to do some refactoring so that it meets the demands of the general public :)

I wonder what would be the best namespace schema to use? Basically, I see the following options:

  • namespace MyTool: This just doesn't really look like organized for me. I mean, (almost) all the namespaces in the .NET Framework are prefixed with System so I guess it is not really a standard way to do it.
  • namespace MyOrganization.MyTool: The problem with that there is just simply no "MyOrganization". It is written in my spare time.
  • namespace MyName.MyTool: I would prefer something more humble. I mean really, I don't want to have my name in the namespace.

Now there are a couple of related questions on Stackoverflow already, like this and this, but none of them really answer my question.

Any suggestions?


Solution

  • I'd go with something like:

    namespace OpenSourceProjectCodeName.MajorFunctionalArea
    

    For example:

    namespace VideoWizardMagicThing.Audio
    namespace VideoWizardMagicThing.Audio.Codecs
    namespace VideoWizardMagicThing.Video
    namespace VideoWizardMagicThing.Video.Codecs
    

    You don't have to go completely mad with namespaces and all you may need is one or two MajorFunctionalArea's. However without knowing how the project is structured or what it does it's hard to say.