7. After some intense
research …
1. Framing the code we used to
write as a “class/component”
2. Adding a “reactive” change
detection mechanism to re-render
components automatically each
time their properties change
Leading Web Frameworks like
React and Angular came up with a
… component Model …
8. Functional Reactive
Programming: Elm/Redux
• Immutable data
• Observables
• Pure functions
• Static typing
• Unidirectional data flow
Source: http://www.codemag.com/article/1601071
http://guide.elm-lang.org/architecture/user_input/buttons.html
9. The problem lies in the coupling
between the View and the Model…
View Model
Model
View
Model
View
Source: Seth Davenport, ng2-redux, https://www.youtube.com/watch?v=s4xr2avwv3s&t=2489s
10. 33% of the code in Adobe’s desktop applications
is devoted to event handling logic
50% of the bugs reported during a product cycle
exist in this code
Sean Parent , “A Possible Future of Software Development”, Adobe 2007
15. Unidirectional Data Flow / Single State Tree
Create Proposal
Modify Data
State Representation
SAM Pattern
next-action
React/Redux Angular2 – Two Way Databinding
21. SAM Isolates APIs
from the View
CUD
R
There is no need for
• an immutable model (Redux)
• declarative effects (Elm, ~Redux)
They create more problems than they solve Create Proposal
Modify Data
State Representation
SAM Pattern
next-action
22. SAM + SAM
API API API
Consistency
APIs
Services
Microservices
Systems of Record
Services
Model
ActionsState
View
Model
DispatcherState
View
Model
Actions
View
Activity
ActionAction
23. In Summary
• Programming model
• Centered on Mutation, not
immutability
• True Single State Tree, no
Sagas/Stateful components
• Focused on ”what’s allowed”, not
subscriptions
• View Components are 100%
decoupled from the application
business logic
• Functional UI/HTML (code
generation), not templates
• Architecture
• Can be implemented
with the framework of
your choice (React,
Angular)
• Side-effects friendly
• Wiring agnostic
• Truly Isomorphic
• Action “Hang back” /
Generic Cancellations
• 3rd party Actions
(OAuth)
Graphical User Interfaces are part of a wide class of software, Reactive Applications, that responds to user input, network messages, and other events
Reactive code is asynchronously triggered by event occurrences
It is hard to trace and understand the control flow of the entire system