views:

386

answers:

4

So I have logical entities (person, country, etc.), gui elements / controls, data and navigation controllers / managers, then things like quadtrees 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 step this mess.

+1  A: 

Try to avoid the "and other stuff" or "misc." categories, If you are putting things in these categories you are failing to really organize them at all.

Patcouch22
my thoughts, I just have a hard time finding a place for data structures that I use rarely, but are still necessary, like a QuadTree or BinaryTree...
kitsune
Hey, sorry I just noticed the comment box!! Just found this feature. I would try hard to find something that is a common thread between at least 2 of them. Unless it shares nothing in common with any other namespace then it can be categorized. But oultine rule #1 no A without a B. hope this helps
Patcouch22
+2  A: 

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
Lou Franco
A: 

I follow the Java / python ideal that namespaces should follow the directory structure.

mmattax
which would lead us to the following question: how you organize your directory structure :) I do the same, my namespaces are tied to the folder structure
kitsune
I believe I read a standard somewhere about domains...like starting with a top level domain (org, com. gov, mil) and going down to project name and it's subcomponents.
Thomas Owens
+1  A: 

I usually create a namespace for every single tiers, like UI, business logic and database. It forces me to separate the tiers. I create other namespaces inside them according to system components.

artur02