Wednesday, 6 June 2012

What is MVC and ASP.NET MVC?



What is Model-view-Control (MVC)?

The MVC pattern helps you create applications that separate the different aspects of the application (input logic, business logic, and UI logic), while providing a loose coupling between these elements. 

The pattern specifies where each kind of logic should be located in the application. The UI logic belongs in the view. Input logic belongs in the controller. Business logic belongs in the model. This separation helps you manage complexity when you build an application, because it enables you to focus on one aspect of the implementation at a time. For example, you can focus on the view without depending on the business logic. 
The loose coupling(parallel development) between the three main components of an MVC application also promotes parallel development.

For instance, one developer can work on the view, a second developer can work on the controller logic, and a third developer can focus on the business logic in the mode.


so conclusion is MVC is an mvc is an architectural pattern like REST. (Coding level is till Design patterns).

Asp.net mvc advantages:

·         It makes it easier to manage complexity by dividing an application into the model, the view, and the controller. Why because as per our scenario we can able to write logic at any level(ui level, model level, business logic(model) level).

So where to write login in which level is import ******

·         It does not use view state or server-based forms. This makes the MVC framework ideal for developers who want full control over the behavior of an application.

In asp.net web form based artechture we are unable to control few things like
While most commonly used sceniours:
In gridview  handling events—like row_command event automatically raises
Grid—edit, update, delete ---ect events.

Well know ascepts is :
 button click event like Click and OnClientClick event s firing.

·         It uses a Front Controller pattern that processes Web application requests through a single controller. This enables you to design an application that supports a rich routing infrastructure. For more information.

In asp.net is too much infrastructure to handle the request and process the request.
Like implement IHttpModule, IHttpHandler –implemented code to process the request.
but now in asp.net mvc ---a concenpt of URL-Writing. which makes a mapping of controller-view-model with the help of URL-Mappings.

Every time this mapping is prepared with the mechanism of URL-writing mapping to apporiate model and view and once the request is finished . again a new mapping is prepared.
As well every mapping is not depending on previous mapping.

·         It provides better support for test-driven development (TDD).


·         It works well for Web applications that are supported by large teams of developers and Web designers who need a high degree of control over the application behavior.

Means we can control entire application in hands of developers why because there is no free defined events. and there is no ready-made infrastructure. like asp.net. so everything under control of Developers.



No comments:

Post a Comment