MVC, MVP and MVVM Design Patterns

Posted By : Bipul Kumar Tiwari

MVC Pattern:

             The Model-View-Controller (MVC) is a software design pattern that separates an application into three main aspects : model, view, and controller. It was introduced in 1970.

01 Model:

            Model is the part of the application that handles the logic for the application data. The model does NOT depend on the controller or the view.

02 View:

            The view displays the model data, and sends user actions (e.g. button clicks) to the controller. Most often the views are created from the model data.

03 Controller:

            The Controller is the part of the application that handles user interaction. In an MVC application, the view only displays information; the controller handles and responds to user input and interaction. It acts as the coordinator between the View and the Model.

MVC Pattern

Key Points of MVC:


MVP Pattern:

             The MVP (Model View Presenter) design pattern also comprises of three components: model, view and presenter .The Controller (in MVC) has been replaced by the presenter. A MVP system is an evolved version of MVC .

01 Model:

            Model is a business object. IT represents a set of classes that describes the business logic , data and and state management . It also defines business rules for data means how the data can be changed and manipulated.

02 View:

            The View represents the UI components like CSS, jQuery, html etc. It is only Responsible for rending UI elements for displaying the data that is received from the presenter as the result. This also transforms the model(s) into UI.

03 Presenter:

            The Presenter negotiates the transfer of data between the other two objects. IT is responsible for handling all UI events on behalf of the view. This receive input from users via the View, then process the user's data with the help of Model and passing the results back to the View. Unlike view and controller, view and presenter are completely decoupled from each other’s and communicate to each other’s by an interface.

MVP Pattern

Key Points of MVP:


MVVM Pattern:

             MVVM (Model-View-View Model) pattern supports two-way data binding between view and View model. This enables automatic propagation of changes, within the state of view model to the View.

01 Model:

            The Model represents a set of classes that describes the business logic and data. It also defines business rules for data means how the data can be changed and manipulated.

02 View:

            The View represents the UI components like CSS, jQuery, html etc. It is only Responsible for rending UI elements for displaying the data that is received from the controller as the result. This also transforms the model(s) into UI.

03 View Modal:

            The View Model is responsible for exposing methods, commands, and other properties that helps to maintain the state of the view, manipulate the model as the result of actions on the view, and trigger events in the view itself.

MVVP Pattern

Key Points of MVP:


 

About the Author

author
Its me BIPUL who is logically minded creative at heart , a good communicator , a self taught full stack developer. I constantly focuses on my thinking , reading , collecting and creating my work in a order to enhance my skills.

I discover new dimensions for growing bussiness with a proven record in creating database and programming. I have a strong technical skills as well as strong interpersonal skills. Read more...
 

Browse By Category

Popular Articles