Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Om Next: motivation & design

Om Next: motivation & design

This is a short talk I gave at the berlin Clojure meetup. I explore the motivation behind Om Next's design, what its main features are and what problems it is designed to solve.

António Monteiro

June 08, 2016

More Decks by António Monteiro

Other Decks in Programming


  1. – Roy T. Fielding, PhD “The trade-off, though, is that

    a uniform interface degrades efficiency, since information is transferred in a standardized form rather than one which is specific to an application's needs.”
  2. 1. clients can request the exact total response they need

    2. clients can communicate novelty atomically • without sacrificing relational queries on the server
  3. Om Next opinions • Single source of truth • Minimize

    flushing to DOM • Abstract asynchrony • No (visible) event model
  4. Parser • reads & mutations • Runs on the client

    and server • Hydrate queries • no reshaping! • Edge of the system
  5. {:people [[:person/by-name “Alice”] {:person/name “Bob” :person/age 34}] :favorites [{:person/name “Bob”

    :person/age 34}] :person/by-name {“Alice” {:person/name “Alice” :person/age 25}}
  6. {:people [[:person/by-name “Alice”] [:person/by-name “Bob”]] :favorites [[:person/by-name “Bob”]] :person/by-name {“Alice”

    {:person/name “Alice” :person/age 25} “Bob” {:person/name “Bob” :person/age 34}}}
  7. Creating information • Create temporary information on client • Remote

    mutation hits server • Server replies with mappings • tempids → real ids
  8. Server • Clojure preferred / less boilerplate • Other languages

    -> implement parser logic • easier for languages with Transit • Datomic supported by default • other DBs work as well
  9. Project status • very close to beta • documentation •

    github.com/omcljs/om/wiki • awkay.github.io/om-tutorial/ • anmonteiro.com
  10. Takeaways • we can radically simplify UI programming • regardless

    of library / framework • strive for simple systems • with these 2 properties