Mvc - Titanium

1,254 views
1,196 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,254
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mvc - Titanium

  1. 1. MVCApplication is divided into three core components: the model, the view, and the controllerView: the interface the user sees and interacts withModel: manipulate the data in the applicationController: handles the input event from the user interface
  2. 2. Why MVC for Titanium?Better organizationCode reuseDon’t like messy files
  3. 3. How MVC in Titanium?Framework Used:Appcelerator on RailsRuby-based generatorModel generator creates standard code for accessing dataController generator writes both View and Controller codeMigration generator who generate SQL code for table creation
  4. 4. View and ControllerGenerate.rb ruby script generates files with template for view and controller.
  5. 5. To generate view and controllerExecute ruby script to generate view and controller>>ruby scripts/generate.rb controller ProductsAbove command generate following files:-Resources/controllers/products.js-Resources/views/products.js
  6. 6. Template generated by ruby script for viewvar ProductView = View.extend({ init: function(win, controller) { this._super(win, controller); this.layout(); }, layout: function() { Write code to Create button/ view/ text/ field ( all UIs) }});
  7. 7. Template generated by ruby script for controllervar ProductController = Controller.extend({ init: function(win) { this._super(win); this.view = new ProductView(win, this); }, btnClicked: function(event) { Write code for Action to perform }});
  8. 8. Instantiate controllerIn app.js file://instantiate controllervar productController = new ProductController(pass window);// this pass window will return value which //we could openOpen passed window;
  9. 9. What skills do we need?JavascriptTitaniumRuby (if we know ,that ll be plus point)
  10. 10. Resourceshttp://primegap.net/Google it.
  11. 11. Thank you

×