Structuring your Sencha
   Touch application

                 by Tommy Maintz
                 @tommymaintz
Session Goals
Understand MVC
MVC in Sencha Touch
Common file structure
Generators & Build Tools
MVC
Models, Views & Controllers
Benefits
Reduce architectural complexity
 Flexibility and maintainability.
Models
Manages the data of the application
Provide data in its current state
Allows you to change state
Views
Renders the model into a form suitable for interaction
Multiple views can exist for a single model
Controllers
Receives input
Instructs the model and views
Controller




View                  Model




       DIRECT CONNECTION
       INDIRECT CONNECTION
Sencha MVC
Platform
      Same MVC codebase
Share Models, Stores, Controllers
Managers
Ext.regApplication()
Ext.regModel()
Ext.regStore()
Ext.regController()
Ext.reg()
Application
Model
Store


                            t ’s i t. . .
               l l y, tha
        R ea
View



                mil iar?
     Lo ok s fa           e n ts
                c om  pon
      s ar e UI
V ie w
Controller
Common file structure
Benefits
Learn it once
Easier support
Sharing between projects
Enables use of Sencha Command
Sencha Command
Generate projects, controllers, models and stores
                    Cross-OS
Let’s build an app!
Questions?

Structuring Your Sencha Touch Application