80 likes | 193 Views
PureMVC Framework. Components of PureMVC. Model data objects proxies delegates View mediators view components Controller commands Facade . Tying together the components. create an instance of Facade which will then initialize the Model, View & Controller classes
E N D
Components of PureMVC Model • data objects • proxies • delegates View • mediators • view components Controller • commands Facade
Tying together the components • create an instance of Facade which will then initialize the Model, View & Controller classes • Model manages the Proxies • proxies are registered / retrieved through the Model • View manages the Mediators • mediators are registered / retrieved through the View • Controller manages the Commands • commands are registered / retrieved through the Controller
Model • Proxies are used to get / set any data used in the app • Data objects are the "business objects" used to store data used by the app. • Delegates are used as the data input / output - call remote services
View • Mediators are used as "observers"; you can specify which Notifications (events) that they should handle • View Components are UI components that are controlled by the mediators
Controller • manages the commands in the application • Commands are used to communicate between the Model & the View • 2 types of commands • MacroCommand • SimpleCommand • MacroCommand calls an array of SubCommands • SubCommands need to be added to the MacroCommand • used for application level tasks • SimpleCommands can be invoked by the Mediators • used for specific tasks
PureMVC Sample Application Sample application Code for sample application