Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
EmberJS Introduction - T3CON12
Search
tomdale
October 05, 2012
Technology
1.3k
7
Share
EmberJS Introduction - T3CON12
Introduction to Ember.js, presented at the TYPO3 conference in Stuttgart, Germany.
tomdale
October 05, 2012
More Decks by tomdale
See All by tomdale
EmberConf 2019 Keynote
tomdale
1
810
EmberConf 2018 Keynote
tomdale
4
1.9k
Secrets of the DOM Virtual Machine
tomdale
1
1.1k
EmberCamp London Keynote 2016
tomdale
11
5.1k
Hella Good Ember
tomdale
7
1.3k
EmberConf 2016 Keynote
tomdale
12
2.4k
Introduction to FastBoot - Global Ember Meetup
tomdale
1
210
An Update on FastBoot
tomdale
2
1k
Progressive Enhancement is Dead, Long Live Progressive Enhancement
tomdale
1
970
Other Decks in Technology
See All in Technology
AIはハッカーを減らすのか、増やすのか?──現役ホワイトハッカーから見るAI時代のリアル【MEGU-Meet】
cscengineer
0
160
AI駆動1on1〜AIに自分を育ててもらう〜
yoshiakiyasuda
0
120
自立を加速させる神器 - EMOasis #11
stanby_inc
0
140
コミュニティ・勉強会を作るのは目的じゃない
ohmori_yusuke
0
210
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.1k
20年前の「OSS革命」に学ぶ AI時代の生存戦略
samakada
0
430
Do Ruby::Box dream of Modular Monolith?
joker1007
1
340
No Types Needed, Just Callable Method Check
dak2
1
1.2k
AI時代 に増える データ活用先
takahal
0
230
Revisiting [CLS] and Patch Token Interaction in Vision Transformers
yu4u
0
370
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
74k
実践ハーネスエンジニアリング:TAKTで実現するAIエージェント制御 / Practical Harness Engineering: AI Agent Control Enabled by TAKT
nrslib
11
4.6k
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
260
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
How GitHub (no longer) Works
holman
316
150k
Six Lessons from altMBA
skipperchong
29
4.2k
The Invisible Side of Design
smashingmag
303
52k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
730
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
350
A Tale of Four Properties
chriscoyier
163
24k
The Curse of the Amulet
leimatthew05
1
11k
Transcript
None
Building Ambitious Web Apps
jQuery
None
Great for manipulating pages. Not so great for building large
apps.
None
None
None
None
You can simulate an application by having the logic run
on the server, and serving a series of pages
None
500ms The problem with this is that your user interface
can only respond as fast as your server—especially bad on flaky 3G connections
Fix this by moving *all* of the logic to the
client. The client has all of the application logic and HTML templates to render in the browser.
{ name: "Christian", occupation: "Engineer" } Instead of sending HTML,
send JSON. Only request data that the client has not yet loaded. Instant response when showing data that has already been fetched.
By decoupling the user interface from the typical HTTP request/
response cycle, you can completely modify how updates are communicated to the client. WebSocket
None
Mobile Cocoa Touch Android SDK Desktop Cocoa .NET Web ?
Mobile Cocoa Touch Android SDK Desktop Cocoa .NET Web
What do client-side frameworks provide?
User Interface Data Persistence Application Architecture
User Interface HTML+CSS Data Persistence ? Application Architecture ?
User Interface HTML+CSS Data Persistence Application Architecture
User Interface View Data Persistence Model Application Architecture Controller
MVC
Enhance JavaScript
Classes Person = Ember.Object.extend({ firstName: null, lastName: null });
Mixins Speaker = Ember.Mixin.create({ hello: function() { var first =
this.get('firstName'), last = this.get('lastName'); alert(first + " " + last + ": HELLO!") } }); Person = Ember.Object.extend(Speaker); Person.create({ firstName: "Yehuda", lastName: "Katz" }).hello();
Mixins Speaker = Ember.Mixin.create({ hello: function() { var first =
this.get('firstName'), last = this.get('lastName'); alert(first + " " + last + ": HELLO!") } }); Person = Ember.Object.extend(Speaker); Person.create({ firstName: "Yehuda", lastName: "Katz" }).hello();
Mixins + super Speaker = Ember.Mixin.create({ hello: function() { var
first = this.get('firstName'), last = this.get('lastName'); return first + " " + last + ": HELLO"; } }); Dog = Ember.Object.extend(Speaker, { hello: function() { return this._super() + " THIS IS DOG"; } }); var phil = Dog.create({ firstName: "Budweiser", lastName: "Phil", hello: function() { return this._super() + " ZAAAAAAAA"; } }); alert(phil.hello());
Computed Properties Person = Ember.Object.extend({ fullName: function() { return this.get('firstName')
+ ' ' + this.get('lastName'); }.property('firstName', 'lastName') }); var yehuda = Person.create({ firstName: "Yehuda", lastName: "Katz" }); alert(yehuda.get('fullName'));
Uniform Access
“ Bertrand Meyer Uniform Access All services offered by a
module should be available through a uniform notation, which does not betray whether they are implemented through storage or through computation.
Namespaces >> Core = Ember.Namespace.create(); >> Core.Person = Ember.Person.extend(); >>
Core.Person.toString(); => Core.Person >> Core.Person.create().toString(); => <Core.Person:ember157> No more [object Object]!
Names in Conventions App.Post = DS.Model.extend({ title: DS.attr('string'), body: DS.attr('string')
}); // vs. App.Post = DS.Model.extend({ collectionURL: "/posts", singleURL: "/post", title: DS.attr('string'), body: DS.attr('string') });
Application Structure
Model View Controller
Model View Controller Router
Router •ORMs model persistent state as objects •The router models
application state as objects •Maps the browser‘s URL to app state
Router Private Blog Not Logged In Logged In Index Show
Post Edit Post
Router Private Blog Not Logged In Logged In Index Show
Post Edit Post
Router Private Blog Not Logged In Logged In Index Show
Post Edit Post /login
Router /posts Private Blog Not Logged In Logged In Index
Show Post Edit Post
Router /post/123 Private Blog Not Logged In Logged In Index
Show Post Edit Post
Advantages •Never be in an unknown state •Find errors faster
•Create a map of user actions
TypeError: Cannot call method 'showPhoto' of undefined
Entered state "notLoggedIn" Sent event "enterCredentials" Entered state "loggedIn" Entered
state "loggedIn.index" Sent event "showPost" Entered state "loggedIn.showPost" Could not respond to event "editPost" in state "loggedIn.showPost"
Why Ember?
Ember is not a throwaway weekend project or a corporate-sponsored
project. It is built by and for the Ember community, an open source project first and only.
100% Open Source Built by the Community Ember is not
a throwaway weekend project or a corporate-sponsored project. It is built by and for the Ember community, an open source project first and only.
•Manages complexity •MIT-licensed •More productive •Aggressively rolls in best practices
•Built for the long haul
As patterns solidify, we roll them in.
Sometimes we give them a little push.
Thank you. Questions? http://plus.tomdale.net http://emberjs.com