I'm working on a small simple MVC 3 project. I have three layers basically.
Layer One - UI - Controllers, Views
Layer Two - Models
Layer Three - Business rules.
With Layer One - UI - I created a reference to Models and Business Rules.
With Business Rules, I created a series of Interfaces and I applied those interfaces to the Controllers in UI. I used Ninject Dependency Injection.
Simple so far - the basic idea works but this is where I'm stuck.
I created a WCF as a separate project. The WCF works just fine in preliminary tests but I came to the conclusion that I'm not doing a true separation of code in the controller.
In Layer One (UI) I added a web reference to the WCF and brought back a list of items in a simple Controller command like this:
Using (WCF w = new WCF()
..flood the view. Blah blah.
It works but I know my gut is telling me that this is the "wrong approach" when it comes to true coding of separation of layers.
I'm struggling with the idea of passing the reference to the WCF to Layer Two (business rules) via Injection. (Ninject Dependency Injection)
Basically, I could add a reference to the UI FROM the business layer but I already added a reference to the Business Layer from the UI - this would cause a "circular reference" which I suspect is a no-no.
I've been trying to find articles to tackle this method but alas...
Can anyone shed some light on this as to what articles I should review?