SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
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 :-)

Mais conteúdo relacionado

Mais procurados

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 slidessamhelman
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS introdizabl
 
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSKarlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSPhilipp Burgmer
 
Angularjs in mobile app
Angularjs in mobile appAngularjs in mobile app
Angularjs in mobile appYvonne Yu
 
Introduction à AngularJS
Introduction à AngularJSIntroduction à AngularJS
Introduction à AngularJSNicolas 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 jsMindfire 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 MobileDierk König
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesMohamad Al Asmar
 
Introduction To Asp.Net Mvc
Introduction To Asp.Net MvcIntroduction To Asp.Net Mvc
Introduction To Asp.Net MvcRishu Mehra
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanPatrick 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.jsFroyo Framework
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0Nagaraju Sangam
 

Mais procurados (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)
 
Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slides
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
 
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJSKarlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
Karlsruher Entwicklertag 2013 - Webanwendungen mit AngularJS
 
Angularjs in mobile app
Angularjs in mobile appAngularjs in mobile app
Angularjs in mobile app
 
Introduction à AngularJS
Introduction à AngularJSIntroduction à AngularJS
Introduction à AngularJS
 
ASP.NET MVC for Begineers
ASP.NET MVC for BegineersASP.NET MVC for Begineers
ASP.NET MVC for Begineers
 
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
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
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
 
AngularJS: Overview & Key Features
AngularJS: Overview & Key FeaturesAngularJS: Overview & Key Features
AngularJS: Overview & Key Features
 
Introduction To Asp.Net Mvc
Introduction To Asp.Net MvcIntroduction To Asp.Net Mvc
Introduction To Asp.Net Mvc
 
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
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with Yeoman
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 
5 angularjs features
5 angularjs features5 angularjs features
5 angularjs features
 
Angular js
Angular jsAngular js
Angular js
 
Membangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.jsMembangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.js
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
 

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

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 NHibernatebwullems
 
Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2Joe Wilson
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCBarry Gervin
 
Web Development Foundation & Team Collaboration
Web Development Foundation & Team CollaborationWeb Development Foundation & Team Collaboration
Web Development Foundation & Team CollaborationSupanat 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 interfacesHjörtur Hilmarsson
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentationbuildmaster
 
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 - IndiandotnetIndiandotnet
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSFSoftServe
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC PresentationVolkan 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.netConcetto Labs
 
Introduction To ASP.Net MVC
Introduction To ASP.Net MVCIntroduction To ASP.Net MVC
Introduction To ASP.Net MVCJoe Wilson
 
Seam Introduction
Seam IntroductionSeam Introduction
Seam Introductionihamo
 

Semelhante a 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
 
Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
Web Development Foundation & Team Collaboration
Web Development Foundation & Team CollaborationWeb Development Foundation & Team Collaboration
Web Development Foundation & Team Collaboration
 
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
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentation
 
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
 
Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
 
MVC
MVCMVC
MVC
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
 
Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09
 
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
 
Introduction To ASP.Net MVC
Introduction To ASP.Net MVCIntroduction To ASP.Net MVC
Introduction To ASP.Net MVC
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
 
Seam Introduction
Seam IntroductionSeam Introduction
Seam Introduction
 
Spring Framework-II
Spring Framework-IISpring Framework-II
Spring Framework-II
 
Jsf presentation
Jsf presentationJsf presentation
Jsf presentation
 
Jinal desai .net
Jinal desai .netJinal desai .net
Jinal desai .net
 

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