views:

30

answers:

1

By "Vertically partitioned", I mean having namespaces named after modules rather than "layers"

So,

  • MyApp.Core
  • MyApp.Accounting
  • MyApp.OrderManagement
  • MyApp.HR

instead of,

  • MyApp.UI
  • MyApp.Business
  • MyApp.Data

The only issue I am running into is that sometimes those assemblies might have a part of the namespace that is same as a type name.

Let's say I create an Account related module and I name it MyApp.Account.dll with the base namespace being MyApp.Account. Inevitably, I need to create a class named Account. Then I have to use namespace or type aliases.

Other than being very creative with names, has anyone else experience cutting assemblies this way and dealt with name collision issues?

+4  A: 

In the past, I've dealt with this two ways:

1) Pluralizing the namespaces or making them gerunds where appropriate (adding an -ing suffix). For example, MyApp.Orders can safely contain an Order class. (Similarly, stick with "MyApp.Accounting" rather than "MyApp.Account").

2) By appending Domain to the namespace (a bit unsatisfying, but effective).

Jeff Sternal