SlideShare a Scribd company logo
Sencha TouchのMVCについて
∼スケールするアプリケーションをもとめて∼
Profile
๏ Ariel Networks Inc.
๏ @kiris
๏ Server Side Engineer
๏ Hate JavaScript :-(
๏ ECMAScript is OK
Sencha TouchのMVCを中心に
感想や意見を憶測を交えながら
まとまりなく話します
Sencha Touchって何?
JavaScirpt Framework for Mobile
Ext.create('Ext.TabPanel', {
fullscreen: true,
tabBarPosition: 'bottom',
defaults: {
'Ext.MessageBox',
items: [
{
title: 'Home',
iconCls: 'home',
html: 'Home Screen'
},
{
title: 'Contact',
iconCls: 'user',
html: 'Contact Screen'
}
]
});
Native Application like Components
Ext JS based Class System
๏ Class-based OOP
๏ Mix-in
๏ Dependencies and
Dynamic Loading
๏ Autogen getter/
setter and more...
Ext.define('Human', {
extend: 'Animal',
mixins: ['Ext.mixin.Observable'],
requires: 'Ext.MessageBox',
config: {
name: null
},
constructor: function(config) {
this.initConfig(config);
},
speak: function() {
Ext.Msg.alert(this.getName(),
'Speaks...');
}
});
More topics
๏ Vendor Development
๏ Supported Devices
iOS/Android/Black Berry/Windows Phone
๏ Sass Supported
๏ MVC Architecture
Sencha Touch MVC
Model
๏ User-Defined Fields
String/Integer/Float/Boolean
๏ Data Bindings
AJAX/REST/Localstorage/JSON-P
๏ Associations
hasMany/BelongsTo
๏ Validations
Presence/Format/Length/Custom
Ext.define('User', {
extend: 'Ext.data.Model',
config: {
fields: [
{ name: 'id', type: 'int' },
{ name: 'name', type: 'string' }
],
proxy: {
type: 'rest',
url : 'data/users',
reader: {
type: 'json',
root: 'users'
}
},
hasMany: 'Post',
validations: [
{ type: 'presence',
field: 'name' }
]
}
});
View
๏ Plain Ext JS Class
NOT HTML Template
Ext.define('MyApp.view.Welcome', {
extend: 'Ext.Panel',
config: {
html: 'Welcome to my app',
fullscreen: true
}
});
Ext.create('MyApp.view.Welcome', {
styleHtmlContent: true
});
Controller
๏ Routing with
Hash Fragments
๏ References Views
๏ Event Handling
Ext.define('MyApp.controller.Users', {
extend: 'Ext.app.Controller',
config: {
routes: {
'user/:id': 'showUserById'
},
refs: {
loginButton: 'button[action=login]'
},
control: {
loginButton: {
tap: 'doLogin'
}
},
},
showUserById: function(id) {
...
},
doLogin: function() {
this.redirectTo('/login');
}
});
Events
๏ mixin Ext.mixin.Observable
๏ call fireEvent method
Ext.define('Employee', {
mixins: ['Ext.mixin.Observable'],
config: {
fullName: ''
},
constructor: function(config) {
this.initConfig(config);
},
quitJob: function() {
this.fireEvent('quit');
}
});
如何にスケールさせるか?
典型的な例
ModelView
Controller
Data BindingsHTML Buildings
Other
Reference
Data Flow
ModelView
Controller
Data BindingsHTML Buildings
Other
After half a year...
MVCの理解を深めよう
Model
๏ Model Data Binder
๏ Has Domain Logic
๏ Fire Events
push-based MVC
View
๏ View HTML Template
๏ Has Presentation Logic
Fattest for Client Side MVC
๏ Can call Models
๏ Fire Presentation/Domain Level Events
๏ Handle Presentation Level Events
Controller
๏ Control Models
๏ Call Views
๏ Handle Domain Level Events
ModelView
Controller
Event
Operation & Reference
同一レイヤー間の連携
Model to Model
๏ Can call associated Models
๏ Control other Models via Controller
View to View
๏ Can call child Views
๏ call other Views with Events
Controller to Controller
๏ Redirect Page
change hash fragment
๏ notify by Events
固有の問題
Client Side Logic
VS
Server Side Logic
Not Easy
๏ Better push them to the Server Side
๏ Hide inside Models
Don t made barrel full of sewage!
๏ Better not to call Models getter/setter
Pull-based MVC
VS
Push-based MVC
Pull-based MVC is OK
๏ Mobile Display is small
๏ Push-based MVC seems to be more
useful on Tablet?
Model mixin Ext.mixins.Observable
ServerとClientの協調
Cross Check Validation
๏ Generate Model fields and
validations from Server code
๏ Fields and Validations are Protocol
テストはどうするのか?
Test is necessary
๏ Writing Unit Tests for Models
๏ Writing Scenario Tests for Views
๏ Keep Easy, Keep Small,
Keep Loose coupling
ドメインオブジェクトを
如何に構築するか?
My Questions
๏ Server Side Domain Client Side Domain
๏ Different viewpoints?
๏ Different techniques?
Finally
๏ MVC is NOT a Silver Bullet
๏ Building Service Layer?
๏ Try Other Patterns?
MVVM or MVP or ...
๏ Keep thinking
Thank you for listening :-)
Ad

More Related Content

What's hot (20)

AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)
Gary Arora
 
Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slides
samhelman
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
dizabl
 
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSKarlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Philipp Burgmer
 
Angularjs in mobile app
Angularjs in mobile appAngularjs in mobile app
Angularjs in mobile app
Yvonne Yu
 
Introduction à AngularJS
Introduction à AngularJSIntroduction à AngularJS
Introduction à AngularJS
Nicolas PENNEC
 
ASP.NET MVC for Begineers
ASP.NET MVC for BegineersASP.NET MVC for Begineers
ASP.NET MVC for Begineers
Shravan Kumar Kasagoni
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
Mindfire Solutions
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
joselinoneto
 
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and MobileOpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
Dierk König
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
Mohamad Al Asmar
 
Introduction To Asp.Net Mvc
Introduction To Asp.Net MvcIntroduction To Asp.Net Mvc
Introduction To Asp.Net Mvc
Rishu Mehra
 
MVVM Applied: From Silverlight to Windows Phone to Windows 8
MVVM Applied: From Silverlight to Windows Phone to Windows 8MVVM Applied: From Silverlight to Windows Phone to Windows 8
MVVM Applied: From Silverlight to Windows Phone to Windows 8
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
Eusebiu Schipor
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
Sakthi Bro
 
5 angularjs features
5 angularjs features5 angularjs features
5 angularjs features
Alexey (Mr_Mig) Migutsky
 
Angular js
Angular jsAngular js
Angular js
Dinusha Nandika
 
Membangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.jsMembangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.js
Froyo Framework
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
Nagaraju Sangam
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)
Gary Arora
 
Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slides
samhelman
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
dizabl
 
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSKarlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Philipp Burgmer
 
Angularjs in mobile app
Angularjs in mobile appAngularjs in mobile app
Angularjs in mobile app
Yvonne Yu
 
Introduction à AngularJS
Introduction à AngularJSIntroduction à AngularJS
Introduction à AngularJS
Nicolas PENNEC
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
Mindfire Solutions
 
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and MobileOpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
OpenDolphin: Enterprise Apps for collaboration on Desktop, Web, and Mobile
Dierk König
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
Mohamad Al Asmar
 
Introduction To Asp.Net Mvc
Introduction To Asp.Net MvcIntroduction To Asp.Net Mvc
Introduction To Asp.Net Mvc
Rishu Mehra
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with Yeoman
Patrick Buergin
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
Sakthi Bro
 
Membangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.jsMembangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.js
Froyo Framework
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
Nagaraju Sangam
 

Similar to Sencha TouchのMVCについて 〜スケールするアプリケーションを求めて〜 (20)

Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernate
bwullems
 
Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2
Joe Wilson
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
Barry Gervin
 
Web Development Foundation & Team Collaboration
Web Development Foundation & Team CollaborationWeb Development Foundation & Team Collaboration
Web Development Foundation & Team Collaboration
Supanat Potiwarakorn
 
Spine js & creating non blocking user interfaces
Spine js & creating non blocking user interfacesSpine js & creating non blocking user interfaces
Spine js & creating non blocking user interfaces
Hjörtur Hilmarsson
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentation
buildmaster
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
Indiandotnet
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
Stefano Paluello
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
SoftServe
 
MVC
MVCMVC
MVC
akshin
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
Volkan Uzun
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
Flavius-Radu Demian
 
Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09
Bruno Matos Tavares
 
Which is better asp.net mvc vs asp.net
Which is better  asp.net mvc vs asp.netWhich is better  asp.net mvc vs asp.net
Which is better asp.net mvc vs asp.net
Concetto Labs
 
Introduction To ASP.Net MVC
Introduction To ASP.Net MVCIntroduction To ASP.Net MVC
Introduction To ASP.Net MVC
Joe Wilson
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
Maarten Balliauw
 
Seam Introduction
Seam IntroductionSeam Introduction
Seam Introduction
ihamo
 
Spring Framework-II
Spring Framework-IISpring Framework-II
Spring Framework-II
People Strategists
 
Jsf presentation
Jsf presentationJsf presentation
Jsf presentation
Ashish Gupta
 
Jinal desai .net
Jinal desai .netJinal desai .net
Jinal desai .net
rohitkumar1987in
 
Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernate
bwullems
 
Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2
Joe Wilson
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
Barry Gervin
 
Web Development Foundation & Team Collaboration
Web Development Foundation & Team CollaborationWeb Development Foundation & Team Collaboration
Web Development Foundation & Team Collaboration
Supanat Potiwarakorn
 
Spine js & creating non blocking user interfaces
Spine js & creating non blocking user interfacesSpine js & creating non blocking user interfaces
Spine js & creating non blocking user interfaces
Hjörtur Hilmarsson
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentation
buildmaster
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
Indiandotnet
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
SoftServe
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
Volkan Uzun
 
Which is better asp.net mvc vs asp.net
Which is better  asp.net mvc vs asp.netWhich is better  asp.net mvc vs asp.net
Which is better asp.net mvc vs asp.net
Concetto Labs
 
Introduction To ASP.Net MVC
Introduction To ASP.Net MVCIntroduction To ASP.Net MVC
Introduction To ASP.Net MVC
Joe Wilson
 
Seam Introduction
Seam IntroductionSeam Introduction
Seam Introduction
ihamo
 
Ad

Sencha TouchのMVCについて 〜スケールするアプリケーションを求めて〜

  翻译: