4 Kasım 2013 Pazartesi

asp.net mvc vs webforms

ASP.net MVC and ASP.net WebForms are web frameworks developed by Microsoft. They can not replace each other and they are not going to be merged under one framework [1]. Both have advantages and disadvantages from different points of view. Therefore, in order to decide which framework is better for a web application, we have to introduce the characteristics of the application. This blog post is an example to classify a web application and it discusses the benefits of each framework for the application’s needs.
It is a common mistake to interfere a web application and a website[2, 3, 4]. Web applications are task-centric. Web sites are for consumption whereas web applications are for creation. Web applications have rich and interactive user interfaces and are action-oriented whereas websites are information oriented. We assume that our sample project is a web application.
[5] mentions criteria to classify web applications. According to the mentioned criteria, suppose that sample project is :
·         enterprise web-application,
·         action application since the content is changed
·         the volume of the project: 100 (number of simultaneous users)
·         business-critical, therefore it should be robust
·         mobile-device support is not important.

Moreover, the sample project requires heavy interaction with the user and a big amount of data is coming and going during sessions.

 ASP.net MVC
MVC pattern partitions the application in three: Model, View and Controller [6]. The Model is responsible for implementing the logic for the application's data and it represents the business objects of the application that using the View for rendering user interface. A View renders the user interface of the application and it consists of html templates that filled with application’s data passed by the controller. Controllers handle and respond to user input and interaction. The web request will be handled by the controller, and the controller will decide which model objects to use and which view objects to render. The MVC model replaces the Web Form events with the controller actions. Advantages are listed as follows:

  •   Full control over the rendered HTML
  •   Separation of concerns (SoC)
    • Fat controllers with lots of business logic, data access code can kill SoC.
  • Easy integration with Javascript frameworks.
  • No ViewState, No Postbacks.

ASP.net Web Form

  •  Rapid Application Development
  • Easy development model for heavy data-driven Line of Business(LOB) applications.
  • Rich controls
ASP.net WebForm is recommended for rich control needs and state oriented event-driven web development. However it is also stated that testability, refactoring capability and maintainability should be ultimate goals and the developers should prefer those advantages over rapid application development.

The Suggestion:

Keeping all those in mind, i suggest to continue with MVC. It will take time to convert all the project, but once we have done this, we have a reusable, testable and maintainable project. During the conversion phase, we should continue iteratively and neatly. We should pay attiontion not to write fat controls.


Hiç yorum yok:

Yorum Gönder