Slide 1

Slide 1 text

Web Front-End Architectures for Native Mobile Apps Ragunath Jawahar • Obvious (formerly, Uncommon Bangalore) @ragunathjawahar / Twitter / GitHub / Medium

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Insights 1. UIs are cycles. 2. UIs are functions. 3. UIs are asynchronous. 4. UIs are symmetric. 5. User is a function.

Slide 5

Slide 5 text

Insights 1. UIs are cycles. 2. UIs are functions. 3. UIs are asynchronous. 4. UIs are symmetric. 5. User is a function.

Slide 6

Slide 6 text

Insights 1. UIs are cycles. 2. UIs are functions. 3. UIs are asynchronous. 4. UIs are symmetric. 5. User is a function.

Slide 7

Slide 7 text

Insights 1. UIs are cycles. 2. UIs are functions. 3. UIs are asynchronous. 4. UIs are symmetric. 5. User is a function.

Slide 8

Slide 8 text

Insights 1. UIs are cycles. 2. UIs are functions. 3. UIs are asynchronous. 4. UIs are symmetric. 5. User is a function.

Slide 9

Slide 9 text

Insights 1. UIs are cycles. 2. UIs are functions. 3. UIs are asynchronous. 4. UIs are symmetric. 5. User is a function.

Slide 10

Slide 10 text

Inspiration React Vue Flux Cycle.js MobX Redux 0.3.0 0.6.0 2.0.1 0.1.0 0.0.1 0.2.0 Jul 3, 2013 Dec 8, 2013 Sep 22, 2014 Nov 13, 2014 Mar 23, 2015 Jun 2, 2015

Slide 11

Slide 11 text

React Vue Flux Cycle.js MobX Redux

Slide 12

Slide 12 text

React Vue Flux Cycle.js MobX Redux Reactive

Slide 13

Slide 13 text

React Vue Flux Cycle.js MobX Redux

Slide 14

Slide 14 text

React Vue Flux Cycle.js MobX Redux Unidirectional

Slide 15

Slide 15 text

React Vue Flux Cycle.js MobX Redux

Slide 16

Slide 16 text

React Vue Flux Cycle.js MobX Redux Predictable

Slide 17

Slide 17 text

React Vue Flux Cycle.js MobX Redux

Slide 18

Slide 18 text

React Vue Flux Cycle.js MobX Redux Composable

Slide 19

Slide 19 text

React Vue Flux Cycle.js MobX Redux Composable

Slide 20

Slide 20 text

React Vue Flux Cycle.js MobX Redux Composable

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Reactive Unidirectional Predictable Composable

Slide 23

Slide 23 text

Reactive Unidirectional Predictable Composable

Slide 24

Slide 24 text

Reactive Unidirectional Predictable Composable

Slide 25

Slide 25 text

Reactive Unidirectional Predictable Composable

Slide 26

Slide 26 text

Reactive Unidirectional Predictable Composable Redux Cycle.js

Slide 27

Slide 27 text

Reactive Unidirectional Predictable Composable Redux Model - View - Intent

Slide 28

Slide 28 text

Reactive Unidirectional Predictable Composable Redux Model - View - Intent

Slide 29

Slide 29 text

Why not MV*?

Slide 30

Slide 30 text

Reactive?

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Reactive

Slide 34

Slide 34 text

Unidirectional?

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

Unidirectional

Slide 38

Slide 38 text

Predictable?

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

val troubleMakers = mutableListOf() for (employee in employees) { if (employee.lastName ?@ "Rebel") { troubleMakers.add(employee) } } val troubleMakers = employees.filter { it.lastName ?@ "Rebel" }

Slide 42

Slide 42 text

val troubleMakers = mutableListOf() for (employee in employees) { if (employee.lastName ?@ "Rebel") { troubleMakers.add(employee) } } val troubleMakers = employees.filter { it.lastName ?@ "Rebel" }

Slide 43

Slide 43 text

val troubleMakers = mutableListOf() for (employee in employees) { if (employee.lastName ?@ "Rebel") { troubleMakers.add(employee) } } val troubleMakers = employees.filter { it.lastName ?@ "Rebel" }

Slide 44

Slide 44 text

Predictable

Slide 45

Slide 45 text

Composable?

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

Composable

Slide 48

Slide 48 text

Reactive Unidirectional Predictable Composable MV*

Slide 49

Slide 49 text

Adopting to Mobile

Slide 50

Slide 50 text

Design Thinking

Slide 51

Slide 51 text

Understand Explore Evaluate Make

Slide 52

Slide 52 text

Understand Explore Evaluate Make

Slide 53

Slide 53 text

Understand Explore Evaluate Make

Slide 54

Slide 54 text

Understand Explore Evaluate Make

Slide 55

Slide 55 text

Understand Explore Evaluate Make

Slide 56

Slide 56 text

Understand Explore Evaluate Make

Slide 57

Slide 57 text

Port the concept, not the code.

Slide 58

Slide 58 text

Language

Slide 59

Slide 59 text

@Parcelize data class Employee( val firstName: String, val lastName: String ) : Parcelable

Slide 60

Slide 60 text

package in.obvious.payroll.domain; import android.os.Parcel; import android.os.Parcelable; import java.util.Objects; public class Employee implements Parcelable { private final String firstName; private final String lastName; public Employee(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } private Employee(Parcel in) { firstName = in.readString(); lastName = in.readString(); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(firstName); dest.writeString(lastName); } @Override public int describeContents() { return 0; } public static final Creator CREATOR = new Creator() { @Override public Employee createFromParcel(Parcel in) { return new Employee(in); } @Override public Employee[] newArray(int size) { return new Employee[size]; } }; public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public Employee copyFirstName(String firstName) { return new Employee(firstName, this.lastName); } public Employee copyLastName(String lastName) { return new Employee(this.firstName, lastName); } @Override public boolean equals(Object o) { if (this ?@ o) return true; if (o ?@ null || getClass() Z@ o.getClass()) return false; Employee employee = (Employee) o; return firstName.equals(employee.firstName) && lastName.equals(employee.lastName); } @Override public int hashCode() { return Objects.hash(firstName, lastName); } } package `in`.obvious.payroll.domain @Parcelize data class Employee( private val firstName: String, private val lastName: String ) : Parcelable

Slide 61

Slide 61 text

Platform

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

• Created • Restored

Slide 64

Slide 64 text

Product / Business

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

What does Redux / MVI do?

Slide 67

Slide 67 text

1. Uses a single atomic state as a source of truth. 2. The SAS is immutable. 3. All updates to the SAS happens though via actions contain necessary data. The business logic is a pure function. 4. The view listens to state updates. 5. Async operations are handled at the edge of the system.

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

Mobius • Model • Event / Event Source • Effect • Logic • Effect Handler • View / Renderer

Slide 71

Slide 71 text

4 days 2 days 8 hours

Slide 72

Slide 72 text

4 days 2 days 8 hours

Slide 73

Slide 73 text

4 days 2 days 8 hours

Slide 74

Slide 74 text

4 days 2 days 8 hours

Slide 75

Slide 75 text

4 days 2 days 8 hours

Slide 76

Slide 76 text

end; @ragunathjawahar Twitter / Medium / GitHub