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

Designing with Data Flow

Avatar for Jack Hsu Jack Hsu
November 22, 2016

Designing with Data Flow

How we can approach design with application state and data flow in mind.

Avatar for Jack Hsu

Jack Hsu

November 22, 2016

Other Decks in Programming

Transcript

  1. A BIT ABOUT ME… JACK HSU ▸ Web developer ▸

    Twitter: @jay_soo ▸ Blog: jaysoo.ca
  2. IF YOU’RE BUILDING SOFTWARE, THERE IS A CERTAIN POINT WHERE

    YOU’LL BE DOMINATED BY COMPLEXITY. Rich Hickey
  3. IN THE BRIEF WHAT IS SIMPLICITY? ▸ Simple: One concept

    ▸ Complexity: Interleaving of concepts ▸ Limits ▸ Simplicity Matters: https://www.youtube.com/watch? v=rI8tNMsozo0
  4. CQRS? ▸ CQRS = Command Query Responsibility Segregation ▸ (aka

    Flux) ▸ Commands = What the user intends to do ▸ Query = What the user sees
  5. TEXT NO CODE NEEDED! ▸ List out possible states ▸

    Handle each state in UI accordingly ▸ No interaction with running app =
  6. HOW DOES UI UPDATE? ES + STATE ATOM ▸ Commands

    update parts of the state atom ▸ Updates to state cause change in UI ▸ Can reason about state changes without UI ▸ UI decoupled from commands
  7. ONE-WAY DATA FLOW DOWN UI ▸ Data only flows in

    one direction ▸ From top-level component to child components
  8. INVERSE DATA FLOW UP ▸ User interaction causes a flow

    back up ▸ Could result in a command in the application
  9. TAKEAWAYS ▸ Separate commands and queries ▸ Design UI from

    global application state ▸ Design how data flows through application ▸ Design for one thing at a time