_e3155f9f13ab113ffa593457221b6891_3-mvc
DESCRIPTION
mvcTRANSCRIPT
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