Perform MVC or not?

I am new to MVC framework and feel it is harder to do because it is a new way to do something. Is there anyone who has experience with MVC or pages. Is MVC's way of doing this the holy grail now, or does it still matter by doing the usual object-oriented development (or even the webdev procedural pages)? Is MVC a fad?

+4
source share
7 answers

In MVC or not, it mainly depends on the needs of your project. Sometimes I have simple things that don't need a Model, but can still benefit from a controller / view scheme. In such cases, I could go with a micro-frame (for PHP, which would be lemonade) or even less. However, most of my web projects are MVC applications.

I started creating sites around 1996-1997, everything was completely new, and in the long run there was no point in what could be a good or bad idea. Around 2005, when I left the army and returned to web development, it wasnโ€™t so nice to fight the rat nest of organically designed code. So, when I introduced Ruby on Rails and the MVC concept, I immediately realized that it was a game changer.

As MVC is increasingly embedded in more and more web projects, it paves the way for the next generations of developer lives to be a little easier and more productive, providing a common foundation for companies and projects. Yes, MVC is a little difficult to grasp when you go from the initial simplicity of the shared script to the project pages, but all that is worth doing will not be so simple?

With all this, if you get a good foundation in MVC in one language, this can provide a reasonable common ground for learning other languages. Regarding how long MVC will act as the dominant structure of software design, the software industry is like a desert, everyday things are changing, and great ideas are overshadowed by the best (XHR for websites, built-in objects for your own audio / video tags), but I think everything that MVC finally hides will be somewhat similar, because it really doesn't matter how big the idea is if only a very small part of people understand it.

+2
source

A short list of pros and cons for MVC

Pros

  • Testablily
  • Separation of problems - helps to unleash the main components.
  • Helps you focus on one task / area at a time
  • Natural suitability for interaction with Web and desktop systems.
  • Good for other design patterns, Single Responsibility Principle, etc.

vs

  • More code and effort may be required.
  • May reduce clarity for simple pages (in these cases, try to keep using simple pages)
  • Will attract more knowledge

MVC is much more than a fad. This is a very pragmatic way to split multiple web application issues into manageable and reusable sections. Of course, you need to get used to it first, but with some conscious effort when hacking your application, the MVC style can be very useful. Often decisions are more concise, as they need to focus on only one operation or task.

This is also not a new idea. It has existed in one form or another since 1979 ( @Sarfraz Ahmed link ) and has been used on various web and desktop platforms.

If you have problems with the implementation of the MVC-style, try to break it into separate parts or actions that are used, and their corresponding area, model view or controller. As you probably expected, over time it will become easier.

Good luck.

+6
source

If we are talking about ASP.NET MVC, the framework page itself has a discussion on this issue:

The ASP.NET MVC framework offers the following benefits:

  • This simplifies complexity management by dividing the application into a model, view, and controller.
  • It does not use view state or server forms. This makes the MVC framework ideal for developers who need complete control over application behavior.
  • It uses the Front Controller pattern, which handles web application requests through a single controller. This allows you to develop an application that supports a rich routing infrastructure. For more information, see Front Controller on the MSDN website.
  • It provides better test development support (TDD).
  • It works well for web applications that are supported by large teams of developers and web designers who require a high degree of control over the behavior of the application.

The Web Forms-based infrastructure offers the following benefits:

  • It supports an event model that maintains state over HTTP, which is beneficial for developing business applications business-to-business. A web-based application provides many events that are supported by hundreds of server controls.
  • It uses a Page Control template that adds functionality to individual pages. See "Page Controller" on the MSDN website for more information.
  • It uses view state or server forms that can facilitate the management of state information.
  • It is great for small groups of web developers and designers who want to take advantage of the large number of components available for rapid application development.
  • In general, it is less complicated for application development, since components (page class, controls, etc.) are tightly integrated and usually require less code than the MVC model.
+2
source

I think this exhaustive list contains answers to all your questions about MVC.

Since you did not mention the language, and if you mean mvc in php, then this is also a wonderful resource for new ones for mvc:

http://phpro.org/tutorials/Model-View-Controller-MVC.html

+1
source

This is from the perspective of ASP.NET WinForms โ†’ ASP.NET MVC, however ASP.NET MVC first heard of the MVC pattern (noob programmer), and I think that if I discovered MVC in a different language before ASP.NET MVC, I would left ASP.NET/C# and went to this structure.

Learning and using MVC made me a better programmer. I have always believed that ASP.NET creates a transparent barrier between me and the code (HTML or C #).

I always wanted to break through this barrier, and MVC gives me complete control over everything in my application, emphasizing the separation of problems (which makes coding infinitely more fun and less of a headache).

For me, MVC was the right choice.

0
source

The big advantage of MVC (in general) is that you are much less likely to create monolithic applications. You have one request-response-response path, unlike ASP.NET or JSF web forms (although JSF is not as bad as web forms). It is very easy for a small website in webforms to become a big uncontrollable messy mess in web forms, then you need to start knocking out user controls and your team is lost. If you understand how a website works, MVC is easy ... although itโ€™s in your hands to manage the state.

0
source

After some time struggling with MVC, I have to say that now I prefer the MVP (Model-view-presenter) architecture. Separation of problems, decoupling and asynchronization is much easier with MVP than MVC, IMHO, because each implementation of MVC does not share the same concept, each controller does not handle the same things.

0
source

All Articles