27
eleks.com eleks.com MVC / MVP / MVVM patterns Divide et impera

Mvvw patterns

Embed Size (px)

Citation preview

Page 1: Mvvw patterns

eleks.com eleks.com

MVC / MVP / MVVM patternsDivide et impera

Page 2: Mvvw patterns

MV* FAMILY

Page 3: Mvvw patterns

Model-View-Controller (MVC)

View

Controller Model

User Input

Modifies

Updates

Page 4: Mvvw patterns

Model-View-Presenter (MVP)

View

Presenter Model

Passes control

Manipulates

Fires events

Updates

Page 5: Mvvw patterns

Model-View-ViewModel (MVVM)

ViewModel

View Model

Data binding

Data binding

Contains

Page 6: Mvvw patterns

Where

Page 7: Mvvw patterns
Page 8: Mvvw patterns

Why

Page 9: Mvvw patterns

Separation into layersDuring the development process, developers and designers can work more independently and concurrently on their components. The designers can concentrate on the view they can easily generate sample data to work with, while the developers can work on the view model/controller/presenter and model components.

Page 10: Mvvw patterns

Easy test creationThe developers can create unit tests for the view model and the model without using the view. The unit tests for the view model can exercise exactly the same functionality as used by the view.

Page 11: Mvvw patterns

UI independency from business logic (MVVM)

It is easy to redesign the UI of the application without touching the code because the view is implemented separately. A new version of the view should work with the existing view model.

Page 12: Mvvw patterns

AdaptorIf there is an existing implementation of the model that encapsulates existing business logic, it may be difficult or risky to change. In this scenario, the view model acts as an adapter for the model classes and enables you to avoid making any major changes to the model code.

Page 13: Mvvw patterns

MVС SMAPLE

MVC sample is basic app which stores and display all stranger that come.

For more information about ASP.NET MVC follow here:http://www.asp.net/mvc

Page 14: Mvvw patterns

MVCCONTROLLER

Page 15: Mvvw patterns

MVCMODEL

Page 16: Mvvw patterns

MVCVIEW

Page 17: Mvvw patterns

MVP SMAPLE

MVP sample used form msdn.Describes step by step MVP implementation

For full description follow here:https://msdn.microsoft.com/en-us/library/ff649571.aspx

Page 18: Mvvw patterns

MVPVIEWdeclaration

Page 19: Mvvw patterns

MVPVIEWimplementation

Page 20: Mvvw patterns

MVPPRESENTER

Page 21: Mvvw patterns

MVPMODEL

Page 22: Mvvw patterns

MVVM SMAPLE

WPF demo project. Demonstrate basic principals of work with WPF in MVVM way

Main points:BindingsProgram initializationUsage samples of common used classes

GitHub:https://

github.com/mishani0x0ef/Wpf.Demo

Page 23: Mvvw patterns

MVVMMODEL

Page 24: Mvvw patterns

MVVMVIEWMODEL

Page 25: Mvvw patterns

MVVMVIEW

Page 26: Mvvw patterns

Thanks! Any Questions?

Page 27: Mvvw patterns

eleks.com

Inspired by Technology.Driven by Value.