Why mvp is better than mvc




















It was my understanding that MVP was mainly employed for unit testing the controllers of the application. The view in this case would be the ASP Page, which would have an instance of the Presenter, and any events in the page click handler's for example would delegate their work to the Presenter.

The Presenter would have a reference to the View although, through an IView interface that the Page would implement.

The Presenter would then respond to actions from the View, do something, update the model and pass it back to the view or perform actions on the View via the interface. This aids unit testing, because the Presenter where any presentation logic should be can have the view mocked out. Typically a Presenter would also have references to other services, which should rely on dependency injection via constructor injection IMO to also allow for the Presenter to be tested in isolation a proper unit test.

Otherwise I'd use MVC. There are ways to meld the two. For instance with ASP. This gives the benefits of MVP i. Depends on what you're doing. It would seem to me that the MVP model may make sense in an application where the client is responsible for what would otherwise be MVC controller actions such as saving, editing, deleting etc via AJAX or websockets - the importance being that the business logic is held within the client-side view is responsible for javascript.

Personally, I would consider it poor design if the view in whatever backend language itself contained logic for database transactions.

I like the decoupling that the MVC pattern offers, making views as stupid as possible. To me, MVP seems to be almost taking a step backwards in development practices. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Ask Question. Asked 10 years, 4 months ago.

Active 4 years, 9 months ago. Viewed 5k times. Improve this question. It means that you have got your idea wrong, but at least you haven't invested a fortune into it. Difficulty in defining the minimum. Often, you want your first product to be as beautiful as it can be, and you are reluctant to throw away all the nice features you've thought of. As a result, you spend too much time and money, and, even more damaging, lose focus on the core features.

What is an MVE? In building an MVE, the focus is shifted from the features to the customer's experience. The MVE also serves the Build-Measure-Learn purpose, but, in this case, you are aiming to build a minimum usable product that gives your users an easy and intuitive experience.

The idea is that customers do not care about your analytics, nor the features that you so carefully selected for your MVP. What they care about is the way they experience your product or service. When building an MVE, select the features that form a complete user experience and make sure that they work as close to perfectly as possible.

The features should create a full user journey, achieving the main goal of the product. When you choose the features, consider what customers may expect in a product of this kind and what they consider essential. Ideally, every goal that customers may wish to achieve should have a corresponding feature.

For example, if you are planning an Uber-like taxi service , your MVE should enable the complete flow of booking a ride and paying for it. It doesn't matter if you're calling the drivers on the phone behind the scenes — your customers won't know. At the same time, your MVE may lack social sharing functions, profile customization, and a loyalty program. These features are not critical for the business goal and can be added later.

If, in the same example of a taxi service, you fail to include a booking confirmation feature, your MVE is going to fail. It may seem that you have built your product around the core feature — the booking engine — but the customer experience will be incomplete.

You can hardly expect people to like the service when they never know whether their ride is confirmed or not. The main thing is to create an experience and learn from the customers' feedback about it. What is an MAP? This is another concept that is used in the Lean Development methodology. The abbreviation stands for Minimum Awesome Product, and is also worth considering if you want to test your product hypothesis.

An MAP is what customers expect from products in However, this does not mean you should go to the other extreme and load your MVP with lots of fancy animations, images, videos, and other special effects.

A small example: when building an MVP for a local tourist application, you can include a link to Booking. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 12 years ago. Active 5 years, 8 months ago. Viewed 27k times. Thanks JD. Improve this question.

This might help: stackoverflow. Add a comment. Active Oldest Votes. Improve this answer. Thanks, brilliant explanation. That has cleared up a few doubts. Thanks to everyone else for answering. Think of a Hub controller and spoke architecture view and model In MVVM, think of that triangle flattening out with each component only knowing about one other in the chain.

Why is this important? This is the core of the original question. Flattening out your dependencies MVVM flattens out the dependencies. Testability One final note on testability: By flattening out dependencies, it makes it easier to inject mock dependencies into your tests. Drew Beaupre Drew Beaupre 2, 1 1 gold badge 15 15 silver badges 17 17 bronze badges. But this explanation was very helpful, especially the part about flattening out the MVC triangle. I think an incredibly stupid tiny detail that makes people confused about MVVM is the order of the letters - in my opinion, VVMM would make more sense.

I wonder why MVVM became the standard acronym Gergely Orosz Gergely Orosz 6, 4 4 gold badges 44 44 silver badges 59 59 bronze badges.

Thanks for the links. Henk Holterman Henk Holterman k 28 28 gold badges silver badges bronze badges. Neha Khanna Neha Khanna 41 1 1 bronze badge.

Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Quality code is the easiest to delete.



0コメント

  • 1000 / 1000