Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do you organize your namespaces?

So I have logical entities (person, country, etc.), GUI elements / controls, data and navigation controllers / managers, then things like quad-trees and timers, and I always struggle with cleanly separating these things into logical namespaces.

I usually have something like this:

  • Leviathan.GUI.Controls
  • Leviathan.GUI.Views
  • Leviathan.Entities
  • Leviathan.Controllers (data and other stuff)
  • Leviathan.Helpers (trees and other stuff)

Are there any good guides on this? I need to stop this mess.

like image 210
kitsune Avatar asked Sep 23 '08 19:09

kitsune


People also ask

What are Organised in the namespace?

NET Framework classes are organized in namespaces, to be used more clearly and to avoid chaos. Furthermore, custom namespaces are extensively used by programmers, both to organize their work and to avoid naming collisions.

How do you define namespaces?

A namespace is a declarative region that provides a scope to the identifiers (the names of types, functions, variables, etc) inside it. Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries.


1 Answers

For applications

Company.Product.Tier.Sub.Sub

where I like to get Tier from Model, View, Controller or other established names (Data)

But for our controls, we end up with

Company.Product.LogicalFeatureGrouping

or

Company.Product.Addon

sometimes it's

Company.Product.LogicalFeatureGrouping.Addon
like image 187
Lou Franco Avatar answered Sep 30 '22 02:09

Lou Franco