What are MVP and MVC and what is the difference?

543,127

Solution 1

Model-View-Presenter

In MVP, the Presenter contains the UI business logic for the View. All invocations from the View delegate directly to the Presenter. The Presenter is also decoupled directly from the View and talks to it through an interface. This is to allow mocking of the View in a unit test. One common attribute of MVP is that there has to be a lot of two-way dispatching. For example, when someone clicks the "Save" button, the event handler delegates to the Presenter's "OnSave" method. Once the save is completed, the Presenter will then call back the View through its interface so that the View can display that the save has completed.

MVP tends to be a very natural pattern for achieving separated presentation in WebForms. The reason is that the View is always created first by the ASP.NET runtime. You can find out more about both variants.

Two primary variations

Passive View: The View is as dumb as possible and contains almost zero logic. A Presenter is a middle man that talks to the View and the Model. The View and Model are completely shielded from one another. The Model may raise events, but the Presenter subscribes to them for updating the View. In Passive View there is no direct data binding, instead, the View exposes setter properties that the Presenter uses to set the data. All state is managed in the Presenter and not the View.

  • Pro: maximum testability surface; clean separation of the View and Model
  • Con: more work (for example all the setter properties) as you are doing all the data binding yourself.

Supervising Controller: The Presenter handles user gestures. The View binds to the Model directly through data binding. In this case, it's the Presenter's job to pass off the Model to the View so that it can bind to it. The Presenter will also contain logic for gestures like pressing a button, navigation, etc.

  • Pro: by leveraging data binding the amount of code is reduced.
  • Con: there's a less testable surface (because of data binding), and there's less encapsulation in the View since it talks directly to the Model.

Model-View-Controller

In the MVC, the Controller is responsible for determining which View to display in response to any action including when the application loads. This differs from MVP where actions route through the View to the Presenter. In MVC, every action in the View correlates with a call to a Controller along with an action. In the web, each action involves a call to a URL on the other side of which there is a Controller who responds. Once that Controller has completed its processing, it will return the correct View. The sequence continues in that manner throughout the life of the application:

    Action in the View
        -> Call to Controller
        -> Controller Logic
        -> Controller returns the View.

One other big difference about MVC is that the View does not directly bind to the Model. The view simply renders and is completely stateless. In implementations of MVC, the View usually will not have any logic in the code behind. This is contrary to MVP where it is absolutely necessary because, if the View does not delegate to the Presenter, it will never get called.

Presentation Model

One other pattern to look at is the Presentation Model pattern. In this pattern, there is no Presenter. Instead, the View binds directly to a Presentation Model. The Presentation Model is a Model crafted specifically for the View. This means this Model can expose properties that one would never put on a domain model as it would be a violation of separation-of-concerns. In this case, the Presentation Model binds to the domain model and may subscribe to events coming from that Model. The View then subscribes to events coming from the Presentation Model and updates itself accordingly. The Presentation Model can expose commands which the view uses for invoking actions. The advantage of this approach is that you can essentially remove the code-behind altogether as the PM completely encapsulates all of the behavior for the view. This pattern is a very strong candidate for use in WPF applications and is also called Model-View-ViewModel.

There is a MSDN article about the Presentation Model and a section in the Composite Application Guidance for WPF (former Prism) about Separated Presentation Patterns

Solution 2

This is an oversimplification of the many variants of these design patterns, but this is how I like to think about the differences between the two.

MVC

MVC

MVP

enter image description here

Solution 3

I blogged about this a while back, quoting on Todd Snyder's excellent post on the difference between the two:

Here are the key differences between the patterns:

MVP Pattern

  • View is more loosely coupled to the model. The presenter is responsible for binding the model to the view.
  • Easier to unit test because interaction with the view is through an interface
  • Usually view to presenter map one to one. Complex views may have multi presenters.

MVC Pattern

  • Controller are based on behaviors and can be shared across views
  • Can be responsible for determining which view to display

It is the best explanation on the web I could find.

Solution 4

Here are illustrations which represent communication flow

enter image description here

enter image description here

Solution 5

MVP is not necessarily a scenario where the View is in charge (see Taligent's MVP for example).
I find it unfortunate that people are still preaching this as a pattern (View in charge) as opposed to an anti-pattern as it contradicts "It's just a view" (Pragmatic Programmer). "It's just a view" states that the final view shown to the user is a secondary concern of the application. Microsoft's MVP pattern renders re-use of Views much more difficult and conveniently excuses Microsoft's designer from encouraging bad practice.

To be perfectly frank, I think the underlying concerns of MVC hold true for any MVP implementation and the differences are almost entirely semantic. As long as you are following separation of concerns between the view (that displays the data), the controller (that initialises and controls user interaction) and the model (the underlying data and/or services)) then you are achieving the benefits of MVC. If you are achieving the benefits then who really cares whether your pattern is MVC, MVP or Supervising Controller? The only real pattern remains as MVC, the rest are just differing flavours of it.

Consider this highly exciting article that comprehensively lists a number of these differing implementations. You may note that they're all basically doing the same thing but slightly differently.

I personally think MVP has only been recently re-introduced as a catchy term to either reduce arguments between semantic bigots who argue whether something is truly MVC or not or to justify Microsofts Rapid Application Development tools. Neither of these reasons in my books justify its existence as a separate design pattern.

Share:
543,127
Mike Minutillo
Author by

Mike Minutillo

Mike is a Software Consultant / Team lead with 8 years of industry experience building data-driven web applications. His current focus is on reducing friction in the development process and improving his skills by helping those around him. He is having fun seeding Stack Overflow with questions that everyone should know.

Updated on July 14, 2022

Comments

  • Mike Minutillo
    Mike Minutillo almost 2 years

    When looking beyond the RAD (drag-drop and configure) way of building user interfaces that many tools encourage you are likely to come across three design patterns called Model-View-Controller, Model-View-Presenter and Model-View-ViewModel. My question has three parts to it:

    1. What issues do these patterns address?
    2. How are they similar?
    3. How are they different?
    • givanse
      givanse over 7 years
    • still_dreaming_1
      still_dreaming_1 over 6 years
      IDK, but supposedly for the original MVC, it was meant to be used in the small. Each button, label, etc, had its' own view and controller object, or at least that is what Uncle Bob claims. I think he was talking about Smalltalk. Look up his talks on YouTube, they are fascinating.
    • the_prole
      the_prole over 6 years
      MVP adds an extra layer of indirection by splitting the View-Controller into a View and a Presenter...
    • Ali Nem
      Ali Nem about 6 years
      The main difference is that in MVC the Controller does not pass any data from the Model to the View. It just notifies the View to get the data from the Model itself. However, in MVP, there is no connection between the View and Model. The Presenter itself gets any data needed from the Model and passes it to the View to show. More to this together with an android sample in all architecture patterns is here: digigene.com/category/android/android-architecture
    • Hasan El-Hefnawy
      Hasan El-Hefnawy almost 5 years
      They are called architectural patterns not design patterns. If you want to know the difference, check this
  • Lotus Notes
    Lotus Notes about 14 years
    "View does not know about Controller." I think you mean that view has no contact directly with the model?
  • Jason Jenkins
    Jason Jenkins about 14 years
    view should never know about the model in eiether one.
  • Michael
    Michael about 13 years
    I've read several answers and blogs about the differences between MVC/MVP/MVVM/etc'. In effect, when you are down to business, it's all the same. It doesn't really matter whether you have an interface or not, and whether you are using a setter (or any other language feature). It appears that the difference between these patterns was born from the difference of various frameworks' implementations, rather than a matter of concept.
  • Bill K
    Bill K over 12 years
    I don't understand how in the view can be coupled more or less closely to the model when in both cases the entire point is to completely decouple them. I'm not implying you said something wrong--just confused as to what you mean.
  • Admin
    Admin almost 12 years
    I wouldn't call MVP an anti-pattern, as later in the post "..the rest [including MVP] are just differing flavours of [MVC]..", which would imply that if MVP was an anti-pattern, so was MVC... it's just a flavor for a different framework's approach. (Now, some specific MVP implementations might be more or less desirable than some specific MVC implementations for different tasks...)
  • Admin
    Admin almost 12 years
    I am confused by this answer (as with the accepted one) as then MVC (after "View" chosen) = MVP? In that case, how is it different than a MVP showing a different Tabbed Page (e.g. hide other Tabs); the "View" is now different? (Granted each Tab could have it's own MVP, but then why couldn't each Panel? Each Button?)
  • tereško
    tereško almost 12 years
    MVC and MVP are patterns, not frameworks. If you honestly think, that topic was about .NET framework, then it is like hearing "the internet" and thinking it is about IE.
  • Matt Mitchell
    Matt Mitchell almost 12 years
    Pretty sure the question has evolved significantly from when it was first asked back in 2008. Additionally, looking back at my answer (and this was 4 years ago so I have not a lot more context than you) I'd say I start generally and then use .NET MVC as a concrete example.
  • Jon Limjap
    Jon Limjap almost 12 years
    @pst: with MVP it's really 1 View = 1 Presenter. With MVC, the Controller can govern multiple views. That's it, really. With the "tabs" model imagine each tab having its own Presenter as opposed to having one Controller for all tabs.
  • Hibou57
    Hibou57 about 11 years
    @Quibblsome: “I personally think MVP has only been recently re-introduced as a catchy term to either reduce arguments between semantic bigots who argue whether something is truly MVC or not […] Neither of these reasons in my books justify its existence as a separate design pattern.” . It differs enough to make it distinct. In MVP, the view may be anything fulfilling a predefined interface (the View in MVP is a standalone component). In MVC, the Controller is made for a particular view (if relation's arities may make someone feel that's worth another term).
  • Hibou57
    Hibou57 about 11 years
    @Brian: “The View, in most cases, creates it's Presenter.” . I mostly seen the opposite, with the Presenter launching both the Model and the View. Well, the View may launch the Presenter too, but that point is not really the most distinctive. What matters the most happens later during lifetime.
  • Quibblesome
    Quibblesome about 11 years
    @Hibou57, there is nothing to stop MVC from referencing the view as an interface or creating a generic controller for several different views.
  • Admin
    Admin over 10 years
    This is a great depiction of the schematic, showing the abstraction and complete isolation of any GUI related (view stuff) from the API of the presenter. One minor point: A master presenter could be used where there is only one presenter, rather than one per view, but your diagram is the cleanest. IMO, the biggest difference between MVC/MVP is that MVP tries to keep the view totally void of anything other than display of the current 'view state' (view data), while also disallowing the view any knowledge of Model objects. Thus the interfaces, needing to be there, to inject that state.
  • Acsor
    Acsor over 10 years
    Awesome reply, mainly for your picture which shows exactly the existence of a single controller in MVC.
  • Acsor
    Acsor over 10 years
    Originally there are two types of controllers: the one which you said to be shared across multiple views, and those who are views specific, mainly purposed for adapting the interface of the shared controller.
  • splungebob
    splungebob about 10 years
    Good picture. I use MVP quite a lot, so I'd like to make one point. In my experience, the Presenters need to talk to one another quite often. Same is true for the Models (or Business objects). Because of these additional "blue lines" of communication that would be in your MVP pic, the Presenter-Model relationships can become quite entangled. Therefore, I tend to keep a one-to-one Presenter-Model relationship vs. a one-to-many. Yes, it requires some additional delegate methods on the Model, but it reduces many headaches if the API of the Model changes or needs refactoring.
  • huggie
    huggie about 10 years
    @JonLimjap What does it mean by one view anyway? In the context of iOS programming, is it one-screenful? Does this make iOS's controller more like MVP than MVC? (On the other hand you can also have multiple iOS controllers per screen)
  • Samuel A. Falvo II
    Samuel A. Falvo II about 10 years
    @quibblesome actually, there is. Controllers are, by definition, tightly bound to their corresponding views, for their job is to interpret human gestures (key presses, mouse updates, etc) into events for individual controls on a window. This is why you have a strict one controller, one view relationship. Controllers were never intended for form-wide use. For form-wide use, Application Model (aka Presentation Model) came into existence, which better suits that purpose. Since non-Smalltalk GUIs don't rely on MVC to implement controls, MVC makes relatively little sense in practice.
  • Samuel A. Falvo II
    Samuel A. Falvo II about 10 years
    The MVC example is wrong; there's a strict 1:1 relationship between views and controllers. By definition, a controller interprets human gesture input to produce events for the model and view alike for a single control. More simply, MVC was intended for use with individual widgets only. One widget, one view, one control.
  • Quibblesome
    Quibblesome about 10 years
    Samuel please clarify what you're talking about. Unless you're telling me the history of the team that "invented" MVC then I'm incredibly dubious about your text. If you're just talking about WinForm then there are other ways of doing things and I've created WinForm projects where control bindings are managed by the controller, not "individual controls".
  • Brian Rizo
    Brian Rizo almost 9 years
    I have a question regarding the MVC diagram. I don't get the part where the view goes out to fetch data .I would think the controller would forward to the view with the data needed.
  • Jonathan
    Jonathan over 8 years
    If a user clicks a button, how is that not interacting with the view? I feel like in MVC, the user interacts with the view more than the controller
  • M4rk
    M4rk over 8 years
    In the MVC the Model is never called directly from the view
  • Shawn Mehan
    Shawn Mehan over 8 years
    This is an inaccurate answer. Do not be misled. as @rodi writes, there is no interaction between the View and Model.
  • Jay
    Jay over 8 years
    The MVC image is inaccurate or at best misleading, please do not pay any attention to this answer.
  • Rob P.
    Rob P. over 8 years
    I know this is an old answer - but could anyone respond on @JonathanLeaders point? I'm coming from a winforms background unless you did some very unique coding, when you click the UI/View gets knowledge of that click before anything else. At least, as far as I know?
  • StuperUser
    StuperUser over 8 years
    @SamuelA.FalvoII not always, there is a 1:Many between controllers and views in ASP.NET MVC: stackoverflow.com/questions/1673301/…
  • Samuel A. Falvo II
    Samuel A. Falvo II over 8 years
    @StuperUser -- Not sure what I was thinking when I wrote that. You're right, of course, and looking back on what I wrote, I have to wonder if I had some other context in mind which I failed to articulate. Thanks for the correction.
  • Luca Fülbier
    Luca Fülbier over 8 years
    I liked this answer the most. Shows exactly how the two patterns differ in general design. The implementation via data binding, oberserver pattern, etc is up to the language and it's features in the end.
  • Luca Fülbier
    Luca Fülbier over 8 years
    @RobP. I think these kinds of charts always tend to be either too complex, or too simple. Imo the flow of the MVP chart also holds true for a MVC application. There might be variations, depending on the languages features (data binding / observer), but in the end the idea is to decouple the view from the data/logic of the application.
  • Marian Paździoch
    Marian Paździoch about 8 years
    "Todd Snyder's excellent post on the difference between the two:" byt the question was about three not TWO.
  • Marian Paździoch
    Marian Paździoch about 8 years
    "View is more loosely coupled to the model" is is coupled at all?
  • cubuspl42
    cubuspl42 almost 8 years
    @JonathanLeaders People have really different things in mind when they say "MVC". Person who created this chart had probably classic Web MVC in mind, where the "user input" are HTTP requests, and "view returned to user" is a rendered HTML page. So any interaction between a user and a view are "not existent" from the perspective of an author of classical Web MVC app.
  • Jonathan
    Jonathan almost 8 years
    @cubuspl42 thay would apply if the user is sitting there typing curl commands. I see what you're saying, but the reality is people click on buttons, and that sends the HTTP request. People are not sending requests via command line or something. Even classic Web (lynx or Netscape Navigator anyone?) was this way.
  • cubuspl42
    cubuspl42 almost 8 years
    @JonathanLeaders You're right, but still most Web MVC frameworks (those server-side, not fancy JavaScript) make "rendered HTML page" and "view" synonyms. That's why it's impossible to interact with view, because view-flow is one way. On the other hand, the second picture in this post (MVP one) seems like interaction in a native GUI app.
  • Panzercrisis
    Panzercrisis over 7 years
    Can you please clarify this phrase? This differs from MVP where actions route through the View to the Presenter. In MVC, every action in the View correlates with a call to a Controller along with an action. To me, it sounds like the same thing, but I'm sure you're describing something different.
  • Dustin Kendall
    Dustin Kendall over 7 years
    @Panzercrisis I'm not sure if this is what the author meant, but this is what I think they were trying to say. Like this answer - stackoverflow.com/a/2068/74556 mentions, in MVC, controller methods are based on behaviors -- in other words, you can map multiple views (but same behavior) to a single controller. In MVP, the presenter is coupled closer to the view, and usually results in a mapping that is closer to one-to-one, i.e. a view action maps to its corresponding presenter's method. You typically wouldn't map another view's actions to another presenter's (from another view) method.
  • KarenAnne
    KarenAnne over 7 years
    This graphical interface made me understand it better than any explanation. Thanks @Phyxx
  • viper
    viper over 7 years
    But in MVP pattern, when the application loads for the first time , isn't the presenter is responsible to load the first view? Like for example when we load the facebook applicaiton, isn't the presenter responsible to load the login page?
  • James Wilkins
    James Wilkins about 7 years
    I don't think these diagrams are that great. I can easily rearrange the MVP model to match the MVC one, and the functionality would seem similar (as someone already mentioned above).
  • James Wilkins
    James Wilkins about 7 years
    This is perhaps a much better diagram: 2.bp.blogspot.com/-EplKtG90u24/UBnpsMjfcuI/AAAAAAAAAEI/…
  • Ash
    Ash almost 7 years
    Well Todd's diagramatic illustration of MVC completely contradicts the idea of decoupling the View and Model. If you look at the diagram, it says Model updates View (arrow from Model to View). In which universe is a system, where the Model directly interacts with the View, a decoupled one???
  • Ash
    Ash almost 7 years
    By far the best answer here in my opinion, since it shows a diagramatic relationship describing not just the one-to-one Vs many-to-one relationship from View to the intermediate layer, but it also visually describes the difference in terms of the one key ingredient: the View Interface.
  • Ash
    Ash almost 7 years
    Oh wow, probably the worst diagramatic representation of the two patterns I've ever seen. There's no indication of the View Interface in the one for MVP. But more annoyingly, there's a link from View to Model in the diagram for MVC. These patterns are meant to promote decoupling. Don't see that happening if View directly queries Model. Moreover, if it's going to do that, why even have an intermediate layer (lol); just have two layers and call the pattern VM. The whole point of the intermediate later is so that View doesn't (and shouldn't) know about the Model.
  • Ash
    Ash almost 7 years
    A link from Model to View in MVC? You may want to edit your answer to explain how this makes it a 'decoupled' system, given this link. Hint: You may find it hard. Also, unless you think the reader will happily accept they've been computing wrong their whole life, you may want to elaborate on why actions go through Controller first in MVC despite the user interacting with the 'visual' elements on the screen (i.e the View), not some abstract layer that sits behind doing processing.
  • Ash
    Ash almost 7 years
    Model updating the VIew. And this still is a decoupled system?
  • Ash
    Ash almost 7 years
    You may want to edit your answer to explain further: Since the View does not know about the Controller, how are user actions, which are performed on the 'visual' elements the user sees on screen (i.e the View), communicated to the Controller...
  • onmyway133
    onmyway133 over 6 years
    @Jay1b What MVC do you think is "correct"? This answer is about the original MVC. There's many other MVC (like in iOS) that was changed to adapt to the platform, say like UIKit
  • Radu
    Radu over 5 years
    Basically what you're trying to say is that the controller micromanages the view logic? So it makes the view dumber by presenting what happens and how on views?
  • Ali Nem
    Ali Nem over 5 years
    @Radu, No, it does not micromanage, that is what the presenter does by making the view passive or dumb
  • Tommy Andersen
    Tommy Andersen over 5 years
    In a proper MVC, the view invokes functionality on the controller, and listens to data changes in the model. The view does not get data from the controller, and the controller should NOT tell the view to display, for instance, a loading indicator. A proper MVC allows you to replace the view part, with one that is fundamentally different. The view part holds view logic, that includes a loading indicator. The view invokes instructions (in controller), controller modifies data in the model, and the model notifies its listeners of changes to its data, one such listener is the view.
  • MegaManX
    MegaManX over 5 years
    This Is clearly wrong... in MVC, model never talks directly with view and vice versa. They don't even know other one exists. The controller is the glue that holds them together
  • problemofficer - n.f. Monica
    problemofficer - n.f. Monica over 5 years
    I have downvoted, because afaik the model does not know anything about the view in MVC and there is not able to update it directly as you write.
  • problemofficer - n.f. Monica
    problemofficer - n.f. Monica over 5 years
    What do the arrows mean?
  • Clive Jefferies
    Clive Jefferies over 5 years
    Look at MVC on Wikipedia, that is exactly how it works.
  • underscore_d
    underscore_d over 5 years
    Whether readers like it or not, plenty sources that can be found by googling state that in MVC the view subscribes to updates on the model. and in some cases might even be the controller and hence invoke such updates. If you don't like that, then go complain on those articles, or cite which 'bible' you think is the sole legitimate source, instead of downvoting answers that just relay the other info available out there!
  • devoured elysium
    devoured elysium over 5 years
    The wording could definitely be improved, but it's true that the view subscribes to changes in the model in MVC. The model does not need to know the View in MVC.
  • sootsnoot
    sootsnoot over 5 years
    @SamuelA.FalvoII I confess to being pretty ignorant/confused/inexperienced/out-of-date with this stuff. But your comment about the MVC example being wrong rang very true to me. My only practical experience with web site development has been using Zend Framework version 1 MVC. With ZF1 MVC, a url is routed to an action function within a controller class, and the names of the controller and action are automatically mapped to the name of the view to invoke when the action completes. While it's possible to do things in the action to use a different view (or no view), that's not the norm.
  • Basil Bourque
    Basil Bourque over 5 years
    Important point from Uncle Bob: When originally invented by Trygve Reenskaug, MVC was meant for each widget not the entire form.
  • ka3ak
    ka3ak about 5 years
    View also calls Presenter's methods! So it should "know" its interface. In general, I cannot imagine using MVP without interfaces for all the participants - Model, View, Presenter. It would be possible but it would be a huge limitation. For example, you may want to reuse a particular view with another presenter implementation. Using interfaces is also more convenient for mocking in unit tests.
  • sofs1
    sofs1 about 5 years
    Shouldn't the arrow 4 be reversed pointing towards "Presenter"?
  • Jboy Flaga
    Jboy Flaga about 5 years
    I agree with Ash and MegaManX. In the MVC diagram, the arrow should be from the View pointing to the Model (or ViewModel, or DTO), not from Model to the View; because the Model does not know about the View, but the view might know about the Model.
  • CME64
    CME64 about 5 years
    very clear, just one question though. is the presenter implemented on the server-side or the client-side?
  • Özgür
    Özgür almost 5 years
    nah, there is no direct connection between view and model in mvc. your diagram is wrong.
  • Top-Master
    Top-Master over 4 years
    Note that MVC is often used by web-frameworks like Laravel, where the received URL requests (maybe made by users) are handled by the Controller and the HTML generated by the View is sent to the client -- So, the View is a part of the backend and the user can never access it directly, and if you experience anywhere the opposite then consider that as an MVC-extension (or even violation). @Panzercrisis, This differs from MVP (like that used in Android OS) where actions route through the View to the Presenter and user have direct access to the View.
  • Tin Luu
    Tin Luu over 4 years
    @Jonathan: some games accept keyboard input directly, those inputs are not going through view. The above diagrams are meaningless without specifying the underlying context.
  • stdout
    stdout about 4 years
    I think the arrow means view is "listening" for model updates through some sort of an observer mechanism.
  • raiks
    raiks almost 4 years
    What the author describes when speaking about MVC isn't the original Smalltalk MVC (whose flow is triangular) but the "Web MVC" where the controller renders a view using a model and returns it to the user. I believe this is worth noting because this creates a lot of confusion.
  • luke
    luke over 3 years
    There are two main differencess between MVC and MVP. 1. In MVC View gets data directly from Model, and In MVP View gets data from Presenter. 2. In MVC there can be one controller per multiple Views, but in MVP there has to be only one presenter per View. Your pictures show only the second difference so in my opinion the answer is incomplete.
  • luke
    luke over 3 years
    There is also a third difference: In MVC user input goes directly to the controller, in MVP it goes through View and then might be passed to the presenter. So as I said this answer is correct but it covers only one difference between MVC and MVP. There are at least two more differences.
  • luke
    luke over 3 years
    @rodi In original MVC model is called by the view (view reads data directly from the model). So you are talking about some modern MVC variantions, not about the original one.
  • Mert Kahraman
    Mert Kahraman over 3 years
    MVC in iOS, MVP in Android is a good place to begin with
  • Heshan Sandeepa
    Heshan Sandeepa almost 3 years
    this is misleading
  • Mahm00d
    Mahm00d over 2 years
    Actually, I think based on the original SmallTalk triangular MVC, the Model-View link is correct: commons.wikimedia.org/wiki/File:MVC-Process.svg#/media/… . The problem I see is the input to the Controller and its link to the View. Normally the user interacts with the view, so the View should be linked towards the Controller.
  • Mahm00d
    Mahm00d over 2 years
    @Özgür actually there is and the diagram is correct.
  • dsanchez
    dsanchez about 2 years
    Great example! I'm curious, what would the "View Interface" look like? Is it an object with methods and properties? If so, what would those properties be and what would the methods do?
  • rosshjb
    rosshjb almost 2 years
    @JeremiahFlaga and MegaManX. Models can interact with View through Observer pattern in MVC. Because there is interface between them, that doesn’t matter. Still, the model doesn’t know about views. In addition, arrows should be pointed from model to view because models notify view through Observer interface.