I can arrange my code in assemblies to enforce proper namespace dependancies:
Company.Product.Domain assembly
Company.Product.DataAccessLayer assembly
-References Company.Product.Domain
Company.Product.Application assembly
-References Company.Product.Domain
-References Company.Product.DataAccessLayer
Because circular assembly reference is not possible, I can be sure I am not referring to the DAL from within the Domain for example.
But this leads to a large number of assemblies when you have multiple domains, I'd like to simply use namespaces to organise the project like so:
Company.Product assembly
-Company.Product.Domain namespace
-Company.Product.DataAccessLayer namespace
-Company.Product.Application namespace
Is there any way I can prevent, or warn of namespace dependancies I don't want.
I have resharper if there is a "Code Inspection->Custom Pattern" solution someone knows of.