Where should I define Enums?
- by Ciel
Hi:
I'm setting up a new app, with a Repository layer/assembly, a Services layer/assembly, and a UI assembly.
So I end up with namespaces such as:
App.UI
App.Biz.Services
App.Data.Repositories
And then I have enums for the args that are used by all 3 layers. Only place that makes sense is to put them in the Cross cutting assembly. (define them in Data layer too low, as UI should have no direct ref to them, defined in Services, too high for Repository layer, which shouldn't be referencing upwards).
But...which namespace in Common? Namespaces should mostly be used to define concerns, rather than Type... I've always used something like:
namespace App.Common.Enums {...}
but it's always felt a bit of a hack that works for me, but not well in a large org where everybody is generating Enums, and if we put them all in Enums folder it's going to make the code folder harder to understand later.
Any suggestions?