views:

306

answers:

5

I've designed an MVC (in .NET) where the View has no link to the Model. It only knows about the Controller. The traditional MVC pattern has all parts communicating with each other. In my case, the Controller is basically a mediator. This keeps any exceptions or logic out of the View. It has zero dependency on the Model. Is this no longer an MVC?

A: 

In the strictest of sense, no. But does it have a WAY for the view to communicate with the Model if needed without changing the architecture/interfaces?

[For instance if you have a TalkToModel() method implemented, even though you dont use it YET, its an MVC in my view.]

Mostlyharmless
'For instace if you have a TalkToModel() method Implemented/Declared...'
Mostlyharmless
A: 

The View (EXE) doesn't include any references to the Model. So those would first need to be added and then the appropriate calls made (methods implemented). But, what is controller for then? Seems MVC is a step lower on the quality ladder since it dirties up the View.

Isn't communication with the Model possible with any View? Is what I've done better than MVC? Is there a name for this (MVC - V<=>M)?

4thSpace
A: 

I guess rather than MVC, it's just VC then, eh? ;)

In MVC implementations, the view subscribes to changes in the model, and acts on the controller; the controller makes changes on the model, which get propagated to the views by way of their reference to the model. In your case, it sounds more like you've buried your model in your controller (after all, you've got to get your data from somewhere); that's not necessarily bad or anything, but it's also not MVC in the strict sense.

Christian Nunciato
+16  A: 
Simucal
I'm not sure why my answer was voted down..
Simucal
I just voted it up. Thanks.
4thSpace
@4thspace, no problem. I actually prefer passive view. It is less complex, easier to unit test, etc, etc.
Simucal
I agree. It's a great design. The View is really stupid, which I like ;)
4thSpace
A: 

Your approach seems a lot like MVP, but I couldn't say for sure without more details.

Don Branson