tags:

views:

41

answers:

2

Hi ,

I have a 3 layer application(UI,Business Layer,Data Layer).My requirement is my datalayer should be only accessible by business layer,and the business layer should be only accessible by UI layer.

That means even if i add a reference of adtalayer in the UI layer,it should not be able to access the methods in Datalayer.

I should be able to create DLL's with access protection.

please suggest a solution for this?

Thanks

SC

A: 

Sounds to me like what you're looking for is called "policy injection". I'm not sure if this is the easiest or best way, but PostSharp will do what you want.

Chris McCall
+1  A: 

You can mark the constructors of key classes or methods in your business and data layers as internal and then use the InternalVisibleTo attribute to extend that access to the appropriate assemblies.

Joel Coehoorn