6

I have come across both the following approaches.

Method 1

Method 2

To my understanding the Model and the View doesn't communicate with each other and all communications should be done through controllers thus Method 1 is the proper way. But I have come across both approaches on various articles online.

What is the proper way to implement the MVC Architecture?

Thank You

Michael
  • 2,631
  • 2
  • 24
  • 40
Janak
  • 460
  • 5
  • 15
  • 1
    You may (or may not) get a better response from [CS StackExchange](http://cs.stackexchange.com/). – adamdc78 Mar 27 '16 at 02:58
  • Your misunderstanding regarding what MVC actually is probably stems from you meing exposed to ASP.NET MVC framework (which started out as a Rails clone). All of the rails-like architectures stems from simplified version of [page controller](http://martinfowler.com/eaaCatalog/pageController.html) concept (which already was an extreme simplification, designed for web, circa 2000). But, **to answer your question**: neither of those diagrams represent MVC. The arrows are all wrong. – tereško Mar 27 '16 at 04:02

1 Answers1

2

i think the 1st diagram is actually an MVP (model view presenter). see this question which eventually links here and contains this diagram for an VMP pattern with a passive view: enter image description here

Community
  • 1
  • 1
radai
  • 23,949
  • 10
  • 71
  • 115
  • I went through the answer provided in that stack question; in the MVC explanation given he hasn't explained the Model but has stated "one other big difference about MVC is that the View does not directly bind to the Model" – Janak Mar 27 '16 at 03:31
  • You should also probably link to the [original paper](http://www.wildcrest.com/Potel/Portfolio/mvp.pdf), which actually defined MVP. – tereško Mar 27 '16 at 03:51
  • @Janak you rarely see people attempting to explain Model, because even a basic description takes several pages. And to do it properly, you would end up writing an entire book. Well ... one could argue, that some people already have: [poeaa](http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420) and [ddd](http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215) books – tereško Mar 27 '16 at 03:55
  • @Janak - to me Model is the most intuitive component. its the object that represents the problem domain. so if i was writing a Zoo application it would be class Animal (or struct, depends on the language). it is the domain model class that holds the data and support some sort of event registration mechanism to notify listeners of changes to this data. – radai Mar 28 '16 at 19:24