SlideShare a Scribd company logo
1 of 11
MVC

Application is divided into three core components: the
  model, the view, and the controller


View: the interface the user sees and interacts with


Model: manipulate the data in the application


Controller: handles the input event from the user interface
Why MVC for Titanium?

Better organization

Code reuse

Don’t like messy files
How MVC in Titanium?
Framework Used:

Appcelerator on Rails
Ruby-based generator

Model generator creates standard code for accessing
 data

Controller generator writes both View and Controller
 code

Migration generator who generate SQL code for table
 creation
View and Controller
Generate.rb ruby script generates files with
 template for view and controller.
To generate view and controller
Execute ruby script to generate view and
 controller
>>ruby scripts/generate.rb controller Products
Above command generate following files:
-Resources/controllers/products.js
-Resources/views/products.js
Template generated by ruby
           script for view
var 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)
 }
});
Template generated by ruby
         script for controller
var ProductController = Controller.extend({
      init: function(win) {
            this._super(win);
            this.view = new ProductView(win,
 this);
      },
      btnClicked: function(event) {
           Write code for Action to perform
      }
});
Instantiate controller
In app.js file:
//instantiate controller
var productController = new
  ProductController(pass window);
// this pass window will return value   which
  //we could open
Open passed window;
What skills do we need?
Javascript
Titanium
Ruby (if we know ,that ll be plus point)
Resources
http://primegap.net/
Google it.
Thank you

More Related Content

What's hot

What's hot (20)

Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...
 
React vs-angular-mobile
React vs-angular-mobileReact vs-angular-mobile
React vs-angular-mobile
 
Rest api code completion for javascript - dotjs 2015
Rest api code completion for javascript - dotjs 2015Rest api code completion for javascript - dotjs 2015
Rest api code completion for javascript - dotjs 2015
 
Dive into Angular, part 5: Experience
Dive into Angular, part 5: ExperienceDive into Angular, part 5: Experience
Dive into Angular, part 5: Experience
 
Lesson 08
Lesson 08Lesson 08
Lesson 08
 
Inside Wijmo 5 - GrapeCity Echo 2016
Inside Wijmo 5 - GrapeCity Echo 2016Inside Wijmo 5 - GrapeCity Echo 2016
Inside Wijmo 5 - GrapeCity Echo 2016
 
Angular js
Angular jsAngular js
Angular js
 
UI5con 2018: News from Control Development
UI5con 2018: News from Control DevelopmentUI5con 2018: News from Control Development
UI5con 2018: News from Control Development
 
React App State Management with react hooks and context api
React App State Management with react hooks and context apiReact App State Management with react hooks and context api
React App State Management with react hooks and context api
 
Angularjs
AngularjsAngularjs
Angularjs
 
React native app with type script tutorial
React native app with type script tutorialReact native app with type script tutorial
React native app with type script tutorial
 
Dive into Angular, part 4: Angular 2.0
Dive into Angular, part 4: Angular 2.0Dive into Angular, part 4: Angular 2.0
Dive into Angular, part 4: Angular 2.0
 
Dive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureDive into Angular, part 2: Architecture
Dive into Angular, part 2: Architecture
 
AngularJS 2.0
AngularJS 2.0AngularJS 2.0
AngularJS 2.0
 
Node in Production at Aviary
Node in Production at AviaryNode in Production at Aviary
Node in Production at Aviary
 
Angular 5
Angular 5Angular 5
Angular 5
 
AngularJS
AngularJSAngularJS
AngularJS
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Angular js 1.3 presentation for fed nov 2014
Angular js 1.3 presentation for fed   nov 2014Angular js 1.3 presentation for fed   nov 2014
Angular js 1.3 presentation for fed nov 2014
 
Angularjs
AngularjsAngularjs
Angularjs
 

Viewers also liked (7)

Design patterns
Design patternsDesign patterns
Design patterns
 
N locate - market perspective
N locate - market perspectiveN locate - market perspective
N locate - market perspective
 
Android trainingforbeginners
Android trainingforbeginnersAndroid trainingforbeginners
Android trainingforbeginners
 
GSMA mWomen design challenge 2012
GSMA mWomen design challenge 2012GSMA mWomen design challenge 2012
GSMA mWomen design challenge 2012
 
Solving Interprofessional Clinical Scheduling with Scalability
Solving Interprofessional Clinical Scheduling with ScalabilitySolving Interprofessional Clinical Scheduling with Scalability
Solving Interprofessional Clinical Scheduling with Scalability
 
I os 101:basic training rajan
I os 101:basic training   rajanI os 101:basic training   rajan
I os 101:basic training rajan
 
Scooba talk about your apps - vol 2
Scooba   talk about your apps - vol 2Scooba   talk about your apps - vol 2
Scooba talk about your apps - vol 2
 

Similar to Mvc - Titanium

ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamental
ldcphuc
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
Akhil Mittal
 

Similar to Mvc - Titanium (20)

Developing ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Pattern
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Asp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design PatternAsp.Net MVC Framework Design Pattern
Asp.Net MVC Framework Design Pattern
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desai
 
AspMVC4 start101
AspMVC4 start101AspMVC4 start101
AspMVC4 start101
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
 
Top 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptxTop 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptx
 
Angular JS deep dive
Angular JS deep diveAngular JS deep dive
Angular JS deep dive
 
ASP.NET MVC Fundamental
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamental
 
Top 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeTop 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers Make
 
Surviving UI Automation Armageddon with BELLATRIX.pptx
Surviving UI Automation Armageddon with BELLATRIX.pptxSurviving UI Automation Armageddon with BELLATRIX.pptx
Surviving UI Automation Armageddon with BELLATRIX.pptx
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
 
MAX 2008 - Building your 1st AIR application
MAX 2008 - Building your 1st AIR applicationMAX 2008 - Building your 1st AIR application
MAX 2008 - Building your 1st AIR application
 
Android development
Android developmentAndroid development
Android development
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
 

More from Prawesh Shrestha

Business plan and presentation iii - financials and risk
Business plan and presentation   iii - financials and riskBusiness plan and presentation   iii - financials and risk
Business plan and presentation iii - financials and risk
Prawesh Shrestha
 
Business plan and presentation ii - marketing and operations
Business plan and presentation   ii - marketing and operationsBusiness plan and presentation   ii - marketing and operations
Business plan and presentation ii - marketing and operations
Prawesh Shrestha
 
Software quality and mobile apps
Software quality and mobile appsSoftware quality and mobile apps
Software quality and mobile apps
Prawesh Shrestha
 
Cross platform mobile development titanium appcelerator
Cross platform mobile development   titanium appceleratorCross platform mobile development   titanium appcelerator
Cross platform mobile development titanium appcelerator
Prawesh Shrestha
 
SMS Based Applications: Behind the scene
SMS Based Applications: Behind the sceneSMS Based Applications: Behind the scene
SMS Based Applications: Behind the scene
Prawesh Shrestha
 

More from Prawesh Shrestha (18)

Presentation: Follow up on hackathon - FightVAW
Presentation: Follow up on hackathon - FightVAWPresentation: Follow up on hackathon - FightVAW
Presentation: Follow up on hackathon - FightVAW
 
Company registration, conduction and renewal
Company registration, conduction and renewalCompany registration, conduction and renewal
Company registration, conduction and renewal
 
Orientation to Pivot Nepal Finalists
Orientation to Pivot Nepal FinalistsOrientation to Pivot Nepal Finalists
Orientation to Pivot Nepal Finalists
 
Business plan and presentation iii - financials and risk
Business plan and presentation   iii - financials and riskBusiness plan and presentation   iii - financials and risk
Business plan and presentation iii - financials and risk
 
Business plan and presentation ii - marketing and operations
Business plan and presentation   ii - marketing and operationsBusiness plan and presentation   ii - marketing and operations
Business plan and presentation ii - marketing and operations
 
Business plan and presentation i - concept-growth-risk
Business plan and presentation   i - concept-growth-riskBusiness plan and presentation   i - concept-growth-risk
Business plan and presentation i - concept-growth-risk
 
Technology Entrepreneurship - Making Business Sense
Technology Entrepreneurship - Making Business SenseTechnology Entrepreneurship - Making Business Sense
Technology Entrepreneurship - Making Business Sense
 
Pivot Nepal - Presentation
Pivot Nepal - PresentationPivot Nepal - Presentation
Pivot Nepal - Presentation
 
Swktm gdg presentation v1.0
Swktm gdg presentation v1.0Swktm gdg presentation v1.0
Swktm gdg presentation v1.0
 
Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in android
 
Nepal load shedding apps
Nepal load shedding appsNepal load shedding apps
Nepal load shedding apps
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Ncell's scheme
Ncell's schemeNcell's scheme
Ncell's scheme
 
Software quality and mobile apps
Software quality and mobile appsSoftware quality and mobile apps
Software quality and mobile apps
 
Cross platform mobile development titanium appcelerator
Cross platform mobile development   titanium appceleratorCross platform mobile development   titanium appcelerator
Cross platform mobile development titanium appcelerator
 
SMS Based Applications: Behind the scene
SMS Based Applications: Behind the sceneSMS Based Applications: Behind the scene
SMS Based Applications: Behind the scene
 
M billionth 2012 concept
M billionth 2012 conceptM billionth 2012 concept
M billionth 2012 concept
 
Listbingo
ListbingoListbingo
Listbingo
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Mvc - Titanium

  • 1. MVC Application is divided into three core components: the model, the view, and the controller View: the interface the user sees and interacts with Model: manipulate the data in the application Controller: handles the input event from the user interface
  • 2. Why MVC for Titanium? Better organization Code reuse Don’t like messy files
  • 3. How MVC in Titanium? Framework Used: Appcelerator on Rails Ruby-based generator Model generator creates standard code for accessing data Controller generator writes both View and Controller code Migration generator who generate SQL code for table creation
  • 4. View and Controller Generate.rb ruby script generates files with template for view and controller.
  • 5. To generate view and controller Execute ruby script to generate view and controller >>ruby scripts/generate.rb controller Products Above command generate following files: -Resources/controllers/products.js -Resources/views/products.js
  • 6. Template generated by ruby script for view var 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. Template generated by ruby script for controller var 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. Instantiate controller In app.js file: //instantiate controller var productController = new ProductController(pass window); // this pass window will return value which //we could open Open passed window;
  • 9. What skills do we need? Javascript Titanium Ruby (if we know ,that ll be plus point)