Ember Data Introduction and Basic Concepts
Upcoming SlideShare
Loading in...5
×
 

Ember Data Introduction and Basic Concepts

on

  • 525 views

Slides for talk given on November PragueJS meetup (http://www.praguejs.cz/talks/#november-2013)

Slides for talk given on November PragueJS meetup (http://www.praguejs.cz/talks/#november-2013)

Statistics

Views

Total Views
525
Slideshare-icon Views on SlideShare
521
Embed Views
4

Actions

Likes
0
Downloads
1
Comments
1

2 Embeds 4

http://www.linkedin.com 3
https://www.linkedin.com 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Ember Data Introduction and Basic Concepts Ember Data Introduction and Basic Concepts Presentation Transcript

    • Ember Data Adam Kloboučník, GoodData @akloboucnik GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Ember Data ▶ client data-persistence library ▶ ▶ ▶ for Ember.js still beta-quality strongly opinionated (naming, url + model schema) ▶ “trivial choices are enemy” ~ @wycats GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Complications Data merge problems Web Applications GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Complications User Post dirty checking Comment changes GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Complications ▶ ▶ ▶ merge problems dirty checking async GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Ember Data architecture TA ES Lo c alS PI tor ag e R Data “Talks” protocol Persists models Adapter Store Serializer Models Google Spreadsheet Extracts raw data to Models GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Models App.Post = DS.Model.extend({ title: DS.attr('string'), body: DS.attr('string'), comments: DS.hasMany('comment', {async: true}) }); App.Comment = DS.Model.extend({ content: DS.attr('string'), post: DS.belongsTo('post') }); GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Adapter ▶ ▶ ▶ provides protocol abstraction RESTAdapter, FixtureAdapter provided LocalStorageAdapter, many others... GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Intermezzo - promises ▶ “eventual value returned from completion of operation” function callApi(id) { var promise = longRunningOperation(id); return promise; } //.... callApi(2).then(function(result) { // do sth with resolved result }, function(err) { // do sth with rejection }); GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Store ▶ ▶ ▶ ▶ querying and saving store.find[All,Query](‘model-name’[, id]); model_object.save(); both finders and save return promises for developer sanity (formerly a state chart with actions on edges) ▶ Em.RSVP.all([promise1, promise2]).then ... GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Notes ▶ ▶ ▶ identity map sideloading optimize you API for easier life (jsonapi.org) ▶ ▶ ▶ alternatives ▶ ▶ ▶ ▶ active_model_serializers in Rails :-( elsewhere Ember.Resource Ember.Model EPF sources - emberjs.com/guides, source GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Conclusion ▶ ▶ really young now, but provides clean separation of concerns ▶ ▶ ▶ ▶ ▶ developing client app without backend testing adapter code without rest of the app … “best practices” for api modelling integrates greatly with Ember if you use it GoodData Confidential. 2013 GoodData Corporation. All rights reserved.
    • Thank you! @akloboucnik GoodData Confidential. 2013 GoodData Corporation. All rights reserved.