80 likes | 198 Views
Dive into the core architecture of the PureMVC framework, designed to separate concerns in application development. This guide covers the components: Model, View, and Controller, detailing how they interact through Proxies, Mediators, and Commands. Learn how Proxies manage data, Mediators observe notifications, and Controllers handle command execution. We'll explore two types of commands—MacroCommand and SimpleCommand—illustrating their roles in orchestrating complex application behaviors. Ideal for developers seeking a deeper understanding of PureMVC's design and functionality.
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