Sunday, October 16, 2005

On Namespaces

I'm patching in the code today. In the past I've never got namespaces correct.

They tend to be:


  • Poorly Named

  • Deepy Nested



I think I'm getting better lately though.

A general rule to try and follow is don't nest deeper than 3 steps.

For me it goes the first part is always the company name. Then the general division goes as follows:


EINFALL.GUI
EINFALL.Clock
EINFALL.Game
EINFALL.Engine
EINFALL.IO
EINFALL.Tests
EINFALL.Menu


These are all created to be as modular as possible - with the exception of IO. Though I did write the classes in there so as little as possible needs to be swapped around.

Game is the current namespace where I'm thowing plenty of stuff in.

No comments: