_e3155f9f13ab113ffa593457221b6891_3-mvc

7
The Model View Controller Framework Jogesh K. Muppala

Upload: aleksandarpmau

Post on 13-Jul-2016

213 views

Category:

Documents


0 download

DESCRIPTION

mvc

TRANSCRIPT

TheModelViewControllerFramework

JogeshK.Muppala

DesignPatterns• Well-documentedsolutiontoarecurringproblem– Alsoreferredtoasanarchitecturalpattern

• Softwaredesignpattern– Reusablesolutiontocommonlyoccurringproblems– Gangoffour:E.Gammaetal.DesignPatterns:ElementsofReusableObject-OrientedSoftware,Addison-Wesley,1994

2

https://en.wikipedia.org/wiki/Software_design_pattern

TheModel-View-Controller(MVC)Framework

• Softwareengineeringarchitecturepattern– Isolationofdomainlogic

fromuserinterface– Permitsindependent

development,testingandmaintenance(separationofconcerns)

http://en.wikipedia.org/wiki/Model–View–Controller

3

Controller

View Model

MVCFramework• Model

– managesthebehavioranddataoftheapplicationdomain

– respondstorequestsforinformationaboutitsstate(usuallyfromtheview)

– respondstoinstructionstochangestate(usuallyfromthecontroller)

– Inevent-drivensystems,themodelnotifiesobservers(usuallyviews)whentheinformationchangessothattheycanreact

4

Controller

View Model

MVCFramework• View

– rendersthemodelintoaformsuitableforinteraction,typicallyauserinterfaceelement

– Multipleviewscanexistforasinglemodelfordifferentpurposes

– Aviewporttypicallyhasaonetoonecorrespondencewithadisplaysurfaceandknowshowtorendertoit

5

Controller

View Model

MVCFramework• Controller– receivesuserinputandinitiatesaresponsebymakingcallsonmodelobjects

– Acontrolleracceptsinputfromtheuserandinstructsthemodelandviewporttoperformactionsbasedonthatinput

6

Controller

View Model

ModelViewView-Model(MVVM)

• DescendentofMVC• SometimescalledModel-

View-Binder• Viewmodel

– Abstractionoftheviewthatexposespublicpropertiesandcommands

– Declarativedatabinding

7

View ViewModel Model

DataBinding

PresentationandPresentationLogic

BusinessLogicandData