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
Ember.js - ответ на почти все вопросы
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
fwdays
April 29, 2014
Programming
0
2.3k
Ember.js - ответ на почти все вопросы
Андрей Листочкин
fwdays
April 29, 2014
Tweet
Share
More Decks by fwdays
See All by fwdays
Symfony best practices и не только Олег Зинченко
fwdays
0
2.1k
Beyond Testing Михаил Боднарчук
fwdays
0
820
Yii2 - на пути от Alpha до GA. Взгляд с практической стороны Александр Бордун
fwdays
0
1.9k
Laravel 4: простота во всем. Евгений Косинский
fwdays
0
1k
Маленькая библиотека для большой компании. Антон Шевчук
fwdays
0
3.8k
Phalcon. Что нового? Александр Торош
fwdays
0
1.2k
Выбираем поисковик умом головы. Андрей Аксенов
fwdays
0
1.5k
Past, Present, and Future: The Evolution of PHP Development. Nate Abele
fwdays
0
820
Функциональный тулчейн Nix
fwdays
1
490
Other Decks in Programming
See All in Programming
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
170
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
4
410
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
360
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
1
120
How to stabilize UI tests using XCTest
akkeylab
0
110
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1k
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
390
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
15
3k
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
940
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
330
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
130
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
480
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
21k
How STYLIGHT went responsive
nonsquared
100
6k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
82
Utilizing Notion as your number one productivity tool
mfonobong
4
250
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
240
Are puppies a ranking factor?
jonoalderson
1
3.1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
210
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
120
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.5k
30 Presentation Tips
portentint
PRO
1
250
Transcript
None
Привет, я Андрей! Программирую на чем угодно, люблю JavaScript и
веб-технологии Соведущий Frontend UA Hangout Архитектор в очках и с бородой
None
Холивары!
DOM + Эффекты + Ajax jQuery Prototype DOMAssistant MooTools
Модули + Widgets Yahoo UI Google Closure jQuery UI Ext
JS
Desktop UI
MVC / MVP / MV* Backbone Knockout Angular Ember React/Om
HTML
Ajax
Острова интерактива
None
Моностраничные приложения
Поле Боя MV*
Веб-клиенты
None
None
None
None
2011
Yehuda Katz
C V M
C V M DAO DAO UNIT TESTABLE
C V M
C V M
C ? M
M C ?
Logic-less Templates 2009 Chris Wanstrath - Mustache.rb Jan Lehnardt -
Mustache.js <h1>Hello, {{username}}</h1>
None
None
Tom Dale
Идея - 2011 Run Loop - SprouteCore MVC - Cocoa
Logic-less Templates + Helpers - Handlebars Data-binding - Metamorph Convention over Configuration - Rails
None
Идея - 2011 Run Loop Cocoa MVC Logic-less Templates +
Helpers Data-binding Convention over Configuration
Идея - 2013 Run Loop Cocoa MVC Logic-less Templates +
Helpers Data-binding Convention over Configuration Routing and Application State Data Access Components
None
MVC Route Model Controller View Template
1. URL - царь горы
URL Смена URLа - событие
URL Смена URLа - событие URL - модуль
URL Смена URLа - событие URL - модуль URL -
глобальное состояние
URL https://myapp.com/posts/1 App.Router.map(function () { this.resource('posts', function () { this.resource('post',
{ path: ':post_id'}); }); });
URL https://myapp.com/posts/1 PostsRoute PostsController <posts> {{outlet}} PostRoute PostController <post>
URL var Post = DS.Model.extend({ title: DS.attr('string') body: DS.attr('string') published:
DS.attr('date') });
URL var PostsRoute = Ember.Router.extend({ model: function () { return
this.store.find('post'); } }); var PostsController = Ember.ArrayController.extend({ … });
URL <ul> {{! posts.hbs }} {{#each post in model}} <li>
{{#link-to 'post' post}} {{post.title}} {{/link-to}} </li> {{/each}} </ul> {{outlet}}
URL var PostRoute = Ember.Router.extend({ model: function (params) { return
this.store.find('post', params.post_id); } }); var PostController = Ember.ObjectController.extend({ … });
URL {{! post.hbs}} <h2>{{title}}</h2> <p>{{format-date published}}</p> <div> {{body}} </div>
2. Асинхронность Promise
Promises var PostRoute = Ember.Router.extend({ model: function (params) { return
this.store.find('post', params.post_id); } });
3. Dependency Injection
Dependency Injection var PostRoute = Ember.Router.extend({ model: function (params) {
return this.store.find('post', params.post_id); } });
Dependency Injection var Session = Ember.Object.extend({...}); App.register('session:main', Session); App.inject('session:main', 'store',
'store:main'); App.inject('controller', 'session', 'session:main'); App.inject('route:app', 'session', 'session:main'); // внутри PostEditController this.session.get('isLoggedIn')
4. Кодогенерация
URL var PostsRoute = Ember.Router.extend({ model: function () { return
this.store.find('post'); } }); var PostsController = Ember.ArrayController.extend({});
5. Объектная модель
Объектная модель Наследование Миксины Прокси-объекты Зависимые свойства Геттеры-сеттеры Алиасы ...
Объектная модель Uniform access principle: obj1 = { inner: {
prop: 'value' } }; obj2 = Ember.Object.create({ inner: { prop: 'value' } }); Ember.get(obj1, 'inner.prop'); Ember.get(obj2, 'inner.prop'); obj2.get('inner.prop'); someOtherObject.get(computed.property')
Объектная модель var Person = DS.Model.extend({ first: DS.attr('string'), last: DS.attr('string'),
full: function () { return this.get('first') + ' ' + this.get('last') }.property('first', 'last') }); tom.get('full') // => 'Tom Dale'
6. MVC
MVC https://myapp.com/posts/1 PostsRoute PostsController <posts> {{outlet}} PostRoute PostController <post>
MVC Init View Templat e Model Route Controller
MVC Init View Templat e Model Route Controller
MVC Init View Templat e Model Route Controller
MVC Init View Templat e Model Route Controller
MVC Data View Templat e Model Route Controller Controller View
MVC Events View Templat e Model Route Controller DOM Actions
Actions Actions
MVC Model Controller Route Application Route Route Route Route View
View View View View Model Controller Model Controller View View View View View View View View View View
MVC
7. Компоненты
Компоненты {{#my-tag param=value}} … {{/my-tag}} {{! components/my-tag.hbs}} ... {{yield}} …
MyTagComponent = Ember.Component.extend
Angular's bi-directionally bound isolate scope, transcluded, element restricted directives Ember
Components
За кадром Поддержка тестирования Инструменты Ember Inspector - Chrome, Firefox
Ember-CLI ember new myapp Broccoli ES6, HTMLBars, JSON API
Заблуждения Не может быть встроен, все или ничего Не имеет
DI Нельзя тестировать Сложно начинать Монолитный
А холивар? голос из зала
Angular JS Routing / Nested Views Консистентное API Простые компоненты
Меньше граблей Большие Open-Source проекты Angular 2.0 догонит Эмбер по ряду пунктов :) но будет несовместим с Angular 1.x :(
Backbone + React/OM сравнимая с HTMLBars производительность общая структура проекта,
не “островки архитектуры в море плохого кода” Эмбер начинают использовать с персистентными структурами данных
Не повторяет ошибок других Принимает решения за вас BB Reasonable
Defaults for 95% case BB ng DI с барьерами ng Понятные директивы ng Одноразовая загрузка данных all Свой рендерринг-пайплайн Knockout ng
Модель разработки - PostgreSQL Tilde, Yapp, Prototypal, Adepar, Instructure, etc.
Релизы по расписанию
Компании 1. Apple 2. Google 3. Yahoo 4. Twitter 5.
Microsoft 6. Groupon 7. Square 8. Zendesk 9. Ballanced 10. Nitrous.io 11. USPO 12. DoD 13. NBCNews 14. Netflix
Проекты 1. Discource 2. Ballanced 3. Travis CI 4. Ghost
None
?