5

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.

4

4 回答 4

3

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
于 2008-09-23T19:13:08.293 回答
2

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.

于 2008-09-23T19:13:07.233 回答
1

我通常为每一层创建一个命名空间,比如 UI、业务逻辑和数据库。它迫使我分开层级。我根据系统组件在其中创建其他命名空间。

于 2008-09-23T19:23:08.003 回答
0

我遵循命名空间应该遵循目录结构的 Java/python 理想。

于 2008-09-23T19:19:45.640 回答