DEV Community

Lloyd Smith
Lloyd Smith

Posted on

Ember.js in 60 Seconds

Before generative AI filled our world with bloated texts, humans relied on grammatically indifferent, terse notes to help others—and themselves—navigate the vast sea of software development. Here’s what I deemed essential about Ember, drawn from a note unearthed years ago:

  • ember-data is an ORM-ish persistence layer that Ember uses by default. It uses models, adapters, serializers, and a store as it's fundamental concepts. When an API is not a good fit for ember-data, it's possible to use an ad-hoc REST endpoint or RPC-style endpoint.
  • The store returns resources wrapped in "promise objects". These proxies allow the resources to be lazy loaded and trigger fetches when accessing a relationship that isn't loaded. Doing this in a loop is what causes N+1 queries.
  • Ember templates use data binding to automatically re-render portions of the DOM when the backing model changes.
  • Ember apps are "single page applications". The web server returns a static HTML page for all incoming requests and once the JavaScript is loaded the request is routed through Ember components which make API calls to one of our myriad microservices.
  • Components are the UI abstraction ember provides, which combine a template and a JavaScript file. Ember also provides for a dependency injection container, services (singletons managed by the container), routes, and so on.

Top comments (0)