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
7
1.3k
EmberJS Introduction - T3CON12
Introduction to Ember.js, presented at the TYPO3 conference in Stuttgart, Germany.
tomdale
October 05, 2012
Tweet
Share
More Decks by tomdale
See All by tomdale
EmberConf 2019 Keynote
tomdale
1
710
EmberConf 2018 Keynote
tomdale
4
1.7k
Secrets of the DOM Virtual Machine
tomdale
1
990
EmberCamp London Keynote 2016
tomdale
11
4.7k
Hella Good Ember
tomdale
7
1.2k
EmberConf 2016 Keynote
tomdale
12
2.4k
Introduction to FastBoot - Global Ember Meetup
tomdale
1
150
An Update on FastBoot
tomdale
2
930
Progressive Enhancement is Dead, Long Live Progressive Enhancement
tomdale
1
780
Other Decks in Technology
See All in Technology
Oracle Cloud World 2024 GoldenGateプラットフォームの戦略について
oracle4engineer
PRO
0
120
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
0
1.6k
私はこうやってマインドマップでテストすることを出す!
mineo_matsuya
0
220
State of Open Source Web Mapping Libraries
dayjournal
0
200
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
5
770
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
120
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
1
290
QAEチームが辿った3年 ボクらが改善業務にスクラムを選んだワケ / 20241108_cloudsign_ques23
bengo4com
0
590
RustとWebAssemblyを使って高速な画像処理をWebアプリで実行しよう
rebonire626
0
110
第23回Ques_タイミーにおけるQAチームの在り方 / QA Team in Timee
takeyaqa
0
190
今、始める、第一歩。 / Your first step
yahonda
2
680
Microsoft Fabric OneLake の実体について
ryomaru0825
0
190
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
Practical Orchestrator
shlominoach
186
10k
Gamification - CAS2011
davidbonilla
80
5k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
505
140k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
A Tale of Four Properties
chriscoyier
156
23k
Adopting Sorbet at Scale
ufuk
73
9.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
400
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
How STYLIGHT went responsive
nonsquared
95
5.2k
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