Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ember.js - ответ на почти все вопросы
Search
fwdays
April 29, 2014
Programming
2.4k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ember.js - ответ на почти все вопросы
Андрей Листочкин
fwdays
April 29, 2014
More Decks by fwdays
See All by fwdays
Symfony best practices и не только Олег Зинченко
fwdays
0
2.2k
Beyond Testing Михаил Боднарчук
fwdays
0
910
Yii2 - на пути от Alpha до GA. Взгляд с практической стороны Александр Бордун
fwdays
0
2k
Laravel 4: простота во всем. Евгений Косинский
fwdays
0
1.1k
Маленькая библиотека для большой компании. Антон Шевчук
fwdays
0
3.9k
Phalcon. Что нового? Александр Торош
fwdays
0
1.2k
Выбираем поисковик умом головы. Андрей Аксенов
fwdays
0
1.5k
Past, Present, and Future: The Evolution of PHP Development. Nate Abele
fwdays
0
930
Функциональный тулчейн Nix
fwdays
1
560
Other Decks in Programming
See All in Programming
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
180
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
320
AIとGame Jamで、ゲームを完成させた話
takahirosaeki
0
120
【高い買い物LT会】初任給で話題の国産フィジカルAIを買った話
akagami
PRO
0
130
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
770
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
130
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
Hono + Inertia + React で LP を構築した話
oukayuka
2
220
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.9k
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
2.7k
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
490
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
330
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
500
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.7k
Docker and Python
trallard
47
4.2k
Into the Great Unknown - MozCon
thekraken
41
2.7k
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Prompt Engineering for Job Search
mfonobong
0
450
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
420
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
370
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
The Language of Interfaces
destraynor
162
27k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
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
?