SlideShare a Scribd company logo
1 of 27
Download to read offline
A Graphical Way of Thinking About
React Designs
Olaf Nouvortne
Independent Full-Stack Developer & Project Manager
Berlin, Germany
onouv@t-online.de
Rev 01.00
2Copyright (c) 2020, Olaf Nouvortne
Web Applications Become Complex Fast
Build
a new
Feature
Find best design
option !
Consistent
Error
Handling !
Consistent
control flow
for user !
UI
visual
structure
Maintainable
and Fast Code !
Asynchronous
backend requests
Maintain
component
data state !
How to cut
for reuse ?
3Copyright (c) 2020, Olaf Nouvortne
Which wheels should be turned ?
Which wheels are you to turn ?
A quick review of react redux ...
4Copyright (c) 2020, Olaf Nouvortne
React + react-redux + thunk
The React Redux Architecture
Container
Action Creator
Service
Reducer
Stateless
Presentational
Component
Action
dispatch(...)
Store
backend
fetch(...)
Presentational Component
connect(...)
5Copyright (c) 2020, Olaf Nouvortne
React Redux Typical Roundtrip
Stateless
Presentational
Component
Stateless
Presentational
Component
Action Creator
Stateless
Presentational
Component
When a change in the UI component occurs …
… then a callback triggers the Action Creator function
6Copyright (c) 2020, Olaf Nouvortne
React Redux Typical Roundtrip
Action Creator
Stateless
Presentational
Component
Action Creator
Stateless
Presentational
Component
Action Creator
Stateless
Presentational
Component
… which may delegate to a service
function for retrieving data ...
Service
backend
… e.g. by means of an asynchronous request through the fetch(…) API
7Copyright (c) 2020, Olaf Nouvortne
React Redux Typical Roundtrip
Action Creator
When the reply
comes back in ...
Service
backend
fetch(…)
React + react-redux + thunk
Reducer
Action
... a callback triggers the action creator to
generate an Action object with relevant data ...
... which the framework dispatches to all
Reducer functions.
Reducer
Reducer
dispatch(...)
8Copyright (c) 2020, Olaf Nouvortne
React Redux Typical Roundtrip
React + react-redux + thunk
Reducer
Action
... where some reducers
may decide to ignore
the Action and return
the state unchanged.
When the Action object and the
state from the redux store are
dispatched to all reducers...
Reducer
Store
… while others may modify
the state based on the
actions contents.
dispatch(...)
9Copyright (c) 2020, Olaf Nouvortne
React Redux Typical Roundtrip
React + react-redux + thunk
Reducer Store
Once a reducer has
updated the state...
Stateless
Presentational
Component
… the framework
renders those UI
components for
which data has
changed
10Copyright (c) 2020, Olaf Nouvortne
React Redux Typical Roundtrip
React + react-redux + thunk
Store
The container maps
both the
●
callbacks to actions
●
data bindings for
rendering
to the stateless UI
component ...
Container
Stateless
Presentational
Component
Presentational Component
connect(...) Test Script
… which makes testing
a bit easier.
11Copyright (c) 2020, Olaf Nouvortne
Thinking it graphically helps ...
Photo by Gerd Altmann
12Copyright (c) 2020, Olaf Nouvortne
Micro Modeling
●
“A picture is worth a thousand words” (to some people)
●
Travel Light with “Micro Modeling” - invest only a few sketches just
to aid your thinking before coding
A simple
Visual
Model
Problem Aspect
●
UI structure
●
Component reuse
●
DRY
●
Error handling
●
Asynch service calls
●
User control flow
●
Component Data
●
...
Feels
Okay ?
Try some
coding !
●
Cycle time: minutes, not hours !
●
Alone, with team mate, with a few
colleagues
●
Sketched on paper, on the whiteboard
(take a photo!), maybe on the screen
13Copyright (c) 2020, Olaf Nouvortne
Need Of A Simple Expressive Notation
●
JavaScript and React are intrinsically functional. They are not as
easily represented visually as object-oriented designs (Unified
Modeling Language)
●
Another simple, but expressive way of visually representing React
designs is needed
●
Should use “standardized” symbols for easy recognition of patterns
●
Should be simple and fast to draft, so you can cycle in “minutes, not
hours”
14Copyright (c) 2020, Olaf Nouvortne
A Non-Trivial Example
Images by Pashminu Mansukhani from pixabay , Dimitry Anikin from Pexels
F S C L – A concept demonstrator to model industrial systems
https://onouv.github.io/fscl
Functions
Systems
Components
Locations
15Copyright (c) 2020, Olaf Nouvortne
A Non-Trivial Example
Navigating from a Project to its Functions
Project List
Function List
16Copyright (c) 2020, Olaf Nouvortne
Micro-Modeling Static UI structure
A view showing a List of editable Functions for a Project...
17Copyright (c) 2020, Olaf Nouvortne
FSCLHeader
HeaderButtonGroupFsclLinks
FunctionList
Breaking it down into presentational components...
FunctionLine
LinkSectionConstrainedLocation
ControlSection ContentSection
Micro-Modeling Static UI structure
18Copyright (c) 2020, Olaf Nouvortne
Micro-Modeling Static UI structure
19Copyright (c) 2020, Olaf Nouvortne
Connected Presentational Component
Stateless Presentational Component
Data
Parameter
Call
Micro-Modeling Static UI structure
20Copyright (c) 2020, Olaf Nouvortne
Or like so – straight from the CMT * ...
* Coffee Machine Talk
Micro-Modeling Static UI structure
21Copyright (c) 2020, Olaf Nouvortne
Compare with the Code here:
– https://github.com/onouv/fscl/blob/master/client/src/function/FunctionList/FunctionListUI.js
– https://github.com/onouv/fscl/blob/master/client/src/function/FunctionLine/FunctionLineUI.js
– https://github.com/onouv/fscl/blob/master/client/src/lib/ui/ControlSectionUI.js
Notice, we are modeling much less detail than we are coding
This is for quickly thinking about design on a high-level, not
for implementation
Micro-Modeling Static UI structure
22Copyright (c) 2020, Olaf Nouvortne
Micro-Modeling Behavior and Redux Stuff
23Copyright (c) 2020, Olaf Nouvortne
Micro-Modeling Behavior and Redux Stuff
Showing a list of Components linked to a Function...
24Copyright (c) 2020, Olaf Nouvortne
Micro-Modeling Behavior and Redux Stuff
Showing a list of Components linked to a Function...
LinkedComponentsList
FetchRootLevelService
EntityLinksReducer
functions.links.source
functions.links.components
function-service
<<http>>
LoadLinkedComponentsAsyncAction
<<dispatch>
>
FunctionReducer
FunctionLine <<http>>
when created
component-service
<<http>>
LoadLinkedEntitiesService
entityIds
when clicking on „C“ button
in FunctionLine
once for each entiyID
25Copyright (c) 2020, Olaf Nouvortne
Micro-Modeling Behavior and Redux Stuff
Showing a list of Components linked to a Function...
LinkedComponentsList
FetchRootLevelService
EntityLinksReducer
functions.links.source
functions.links.components
function-service
<<http>>
LoadLinkedComponentsAsyncAction
<<dispatch>>
FunctionReducer
FunctionLine <<http>>
when created
component-service
<<http>>
LoadLinkedEntitiesService
entityIds
when clicking on „C“ button
in FunctionLine
once for each entiyID
Action Creator
Main Reducer
Sub Reducer
State
Services
Remote Services
Data Flow
26Copyright (c) 2020, Olaf Nouvortne
Micro-Modeling Behavior and Redux Stuff
Showing a list of Components linked to a Function...
Compare with the Code here:
Presentational Components:
➔
https://github.com/onouv/fscl/tree/master/client/src/function/LinkedComponentsList
Actions and Services:
➔
.../client/src/function/redux/LoadLinkedComponentsAsyncAction.js
➔
.../client/src/lib/api/FetchRootLevelService.js
➔
.../client/src/lib/api/LoadLinkEntitiesService.js
Reducers:
➔
.../client/src/function/redux/FunctionReducer.js
➔
.../client/src/function/redux/EntityLinksReducer.js
Notice, the EntityLinksReducer had
better been placed in .../lib/redux
27Copyright (c) 2020, Olaf Nouvortne
THANK YOU
Questions, thoughts and remarks most welcome
onouv@t-online.de

More Related Content

Similar to A Graphical Way of Thinking About React Designs

Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnelukdpe
 
SQL Anywhere and the Internet of Things
SQL Anywhere and the Internet of ThingsSQL Anywhere and the Internet of Things
SQL Anywhere and the Internet of ThingsSAP Technology
 
DWX2015 - Von Bayern in die Cloud
DWX2015 - Von Bayern in die CloudDWX2015 - Von Bayern in die Cloud
DWX2015 - Von Bayern in die Cloudphilippgarbe
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 uploadDebnath Sinha
 
(Js) Export your own WebGL Viewer
(Js) Export your own WebGL Viewer(Js) Export your own WebGL Viewer
(Js) Export your own WebGL ViewerJooinK
 
NTT SIC marketplace slide deck at Tokyo Summit
NTT SIC marketplace slide deck at Tokyo SummitNTT SIC marketplace slide deck at Tokyo Summit
NTT SIC marketplace slide deck at Tokyo SummitToshikazu Ichikawa
 
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?Pin-Ying Tu
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVMJohn Lee
 
Yevhen Beshkarov "Difference in Architecture Based on Event Loop and CommonAPI"
Yevhen Beshkarov "Difference in Architecture Based on Event Loop and CommonAPI"Yevhen Beshkarov "Difference in Architecture Based on Event Loop and CommonAPI"
Yevhen Beshkarov "Difference in Architecture Based on Event Loop and CommonAPI"LogeekNightUkraine
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0Thomas Conté
 
How to build a social network on Serverless (AWS Community Summit)
How to build a social network on Serverless (AWS Community Summit)How to build a social network on Serverless (AWS Community Summit)
How to build a social network on Serverless (AWS Community Summit)Yan Cui
 
How to build a social network on serverless | Yan Cui
How to build a social network on serverless | Yan CuiHow to build a social network on serverless | Yan Cui
How to build a social network on serverless | Yan CuiAWSCOMSUM
 
Cutting edge of web technology
Cutting edge of web technologyCutting edge of web technology
Cutting edge of web technologyTsutomu Ogasawara
 
React Alicante - React Redux a development workflow
React Alicante - React Redux a development workflowReact Alicante - React Redux a development workflow
React Alicante - React Redux a development workflowBraulio Diez Botella
 
London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010Skills Matter
 
Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)
Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)
Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)Samy Fodil
 
Driving Down Automotive Costs for Richer HMIs with Qt & i.MX RT1170
Driving Down Automotive Costs for Richer HMIs with Qt & i.MX RT1170Driving Down Automotive Costs for Richer HMIs with Qt & i.MX RT1170
Driving Down Automotive Costs for Richer HMIs with Qt & i.MX RT1170Qt
 

Similar to A Graphical Way of Thinking About React Designs (20)

Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnel
 
SQL Anywhere and the Internet of Things
SQL Anywhere and the Internet of ThingsSQL Anywhere and the Internet of Things
SQL Anywhere and the Internet of Things
 
Von Bayern in die Cloud
Von Bayern in die CloudVon Bayern in die Cloud
Von Bayern in die Cloud
 
DWX2015 - Von Bayern in die Cloud
DWX2015 - Von Bayern in die CloudDWX2015 - Von Bayern in die Cloud
DWX2015 - Von Bayern in die Cloud
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 upload
 
(Js) Export your own WebGL Viewer
(Js) Export your own WebGL Viewer(Js) Export your own WebGL Viewer
(Js) Export your own WebGL Viewer
 
NTT SIC marketplace slide deck at Tokyo Summit
NTT SIC marketplace slide deck at Tokyo SummitNTT SIC marketplace slide deck at Tokyo Summit
NTT SIC marketplace slide deck at Tokyo Summit
 
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
超級全能危樓改造王 - 增建、改建、打掉重建你的軟體架構?
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVM
 
Yevhen Beshkarov "Difference in Architecture Based on Event Loop and CommonAPI"
Yevhen Beshkarov "Difference in Architecture Based on Event Loop and CommonAPI"Yevhen Beshkarov "Difference in Architecture Based on Event Loop and CommonAPI"
Yevhen Beshkarov "Difference in Architecture Based on Event Loop and CommonAPI"
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
agile microservices @scaibo
agile microservices @scaiboagile microservices @scaibo
agile microservices @scaibo
 
How to build a social network on Serverless (AWS Community Summit)
How to build a social network on Serverless (AWS Community Summit)How to build a social network on Serverless (AWS Community Summit)
How to build a social network on Serverless (AWS Community Summit)
 
How to build a social network on serverless | Yan Cui
How to build a social network on serverless | Yan CuiHow to build a social network on serverless | Yan Cui
How to build a social network on serverless | Yan Cui
 
Cutting edge of web technology
Cutting edge of web technologyCutting edge of web technology
Cutting edge of web technology
 
React Alicante - React Redux a development workflow
React Alicante - React Redux a development workflowReact Alicante - React Redux a development workflow
React Alicante - React Redux a development workflow
 
London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010London F-Sharp User Group : Don Syme on F# - 09/09/2010
London F-Sharp User Group : Don Syme on F# - 09/09/2010
 
Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)
Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)
Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)
 
Driving Down Automotive Costs for Richer HMIs with Qt & i.MX RT1170
Driving Down Automotive Costs for Richer HMIs with Qt & i.MX RT1170Driving Down Automotive Costs for Richer HMIs with Qt & i.MX RT1170
Driving Down Automotive Costs for Richer HMIs with Qt & i.MX RT1170
 
IVY: an overview
IVY: an overviewIVY: an overview
IVY: an overview
 

Recently uploaded

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 

Recently uploaded (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

A Graphical Way of Thinking About React Designs

  • 1. A Graphical Way of Thinking About React Designs Olaf Nouvortne Independent Full-Stack Developer & Project Manager Berlin, Germany onouv@t-online.de Rev 01.00
  • 2. 2Copyright (c) 2020, Olaf Nouvortne Web Applications Become Complex Fast Build a new Feature Find best design option ! Consistent Error Handling ! Consistent control flow for user ! UI visual structure Maintainable and Fast Code ! Asynchronous backend requests Maintain component data state ! How to cut for reuse ?
  • 3. 3Copyright (c) 2020, Olaf Nouvortne Which wheels should be turned ? Which wheels are you to turn ? A quick review of react redux ...
  • 4. 4Copyright (c) 2020, Olaf Nouvortne React + react-redux + thunk The React Redux Architecture Container Action Creator Service Reducer Stateless Presentational Component Action dispatch(...) Store backend fetch(...) Presentational Component connect(...)
  • 5. 5Copyright (c) 2020, Olaf Nouvortne React Redux Typical Roundtrip Stateless Presentational Component Stateless Presentational Component Action Creator Stateless Presentational Component When a change in the UI component occurs … … then a callback triggers the Action Creator function
  • 6. 6Copyright (c) 2020, Olaf Nouvortne React Redux Typical Roundtrip Action Creator Stateless Presentational Component Action Creator Stateless Presentational Component Action Creator Stateless Presentational Component … which may delegate to a service function for retrieving data ... Service backend … e.g. by means of an asynchronous request through the fetch(…) API
  • 7. 7Copyright (c) 2020, Olaf Nouvortne React Redux Typical Roundtrip Action Creator When the reply comes back in ... Service backend fetch(…) React + react-redux + thunk Reducer Action ... a callback triggers the action creator to generate an Action object with relevant data ... ... which the framework dispatches to all Reducer functions. Reducer Reducer dispatch(...)
  • 8. 8Copyright (c) 2020, Olaf Nouvortne React Redux Typical Roundtrip React + react-redux + thunk Reducer Action ... where some reducers may decide to ignore the Action and return the state unchanged. When the Action object and the state from the redux store are dispatched to all reducers... Reducer Store … while others may modify the state based on the actions contents. dispatch(...)
  • 9. 9Copyright (c) 2020, Olaf Nouvortne React Redux Typical Roundtrip React + react-redux + thunk Reducer Store Once a reducer has updated the state... Stateless Presentational Component … the framework renders those UI components for which data has changed
  • 10. 10Copyright (c) 2020, Olaf Nouvortne React Redux Typical Roundtrip React + react-redux + thunk Store The container maps both the ● callbacks to actions ● data bindings for rendering to the stateless UI component ... Container Stateless Presentational Component Presentational Component connect(...) Test Script … which makes testing a bit easier.
  • 11. 11Copyright (c) 2020, Olaf Nouvortne Thinking it graphically helps ... Photo by Gerd Altmann
  • 12. 12Copyright (c) 2020, Olaf Nouvortne Micro Modeling ● “A picture is worth a thousand words” (to some people) ● Travel Light with “Micro Modeling” - invest only a few sketches just to aid your thinking before coding A simple Visual Model Problem Aspect ● UI structure ● Component reuse ● DRY ● Error handling ● Asynch service calls ● User control flow ● Component Data ● ... Feels Okay ? Try some coding ! ● Cycle time: minutes, not hours ! ● Alone, with team mate, with a few colleagues ● Sketched on paper, on the whiteboard (take a photo!), maybe on the screen
  • 13. 13Copyright (c) 2020, Olaf Nouvortne Need Of A Simple Expressive Notation ● JavaScript and React are intrinsically functional. They are not as easily represented visually as object-oriented designs (Unified Modeling Language) ● Another simple, but expressive way of visually representing React designs is needed ● Should use “standardized” symbols for easy recognition of patterns ● Should be simple and fast to draft, so you can cycle in “minutes, not hours”
  • 14. 14Copyright (c) 2020, Olaf Nouvortne A Non-Trivial Example Images by Pashminu Mansukhani from pixabay , Dimitry Anikin from Pexels F S C L – A concept demonstrator to model industrial systems https://onouv.github.io/fscl Functions Systems Components Locations
  • 15. 15Copyright (c) 2020, Olaf Nouvortne A Non-Trivial Example Navigating from a Project to its Functions Project List Function List
  • 16. 16Copyright (c) 2020, Olaf Nouvortne Micro-Modeling Static UI structure A view showing a List of editable Functions for a Project...
  • 17. 17Copyright (c) 2020, Olaf Nouvortne FSCLHeader HeaderButtonGroupFsclLinks FunctionList Breaking it down into presentational components... FunctionLine LinkSectionConstrainedLocation ControlSection ContentSection Micro-Modeling Static UI structure
  • 18. 18Copyright (c) 2020, Olaf Nouvortne Micro-Modeling Static UI structure
  • 19. 19Copyright (c) 2020, Olaf Nouvortne Connected Presentational Component Stateless Presentational Component Data Parameter Call Micro-Modeling Static UI structure
  • 20. 20Copyright (c) 2020, Olaf Nouvortne Or like so – straight from the CMT * ... * Coffee Machine Talk Micro-Modeling Static UI structure
  • 21. 21Copyright (c) 2020, Olaf Nouvortne Compare with the Code here: – https://github.com/onouv/fscl/blob/master/client/src/function/FunctionList/FunctionListUI.js – https://github.com/onouv/fscl/blob/master/client/src/function/FunctionLine/FunctionLineUI.js – https://github.com/onouv/fscl/blob/master/client/src/lib/ui/ControlSectionUI.js Notice, we are modeling much less detail than we are coding This is for quickly thinking about design on a high-level, not for implementation Micro-Modeling Static UI structure
  • 22. 22Copyright (c) 2020, Olaf Nouvortne Micro-Modeling Behavior and Redux Stuff
  • 23. 23Copyright (c) 2020, Olaf Nouvortne Micro-Modeling Behavior and Redux Stuff Showing a list of Components linked to a Function...
  • 24. 24Copyright (c) 2020, Olaf Nouvortne Micro-Modeling Behavior and Redux Stuff Showing a list of Components linked to a Function... LinkedComponentsList FetchRootLevelService EntityLinksReducer functions.links.source functions.links.components function-service <<http>> LoadLinkedComponentsAsyncAction <<dispatch> > FunctionReducer FunctionLine <<http>> when created component-service <<http>> LoadLinkedEntitiesService entityIds when clicking on „C“ button in FunctionLine once for each entiyID
  • 25. 25Copyright (c) 2020, Olaf Nouvortne Micro-Modeling Behavior and Redux Stuff Showing a list of Components linked to a Function... LinkedComponentsList FetchRootLevelService EntityLinksReducer functions.links.source functions.links.components function-service <<http>> LoadLinkedComponentsAsyncAction <<dispatch>> FunctionReducer FunctionLine <<http>> when created component-service <<http>> LoadLinkedEntitiesService entityIds when clicking on „C“ button in FunctionLine once for each entiyID Action Creator Main Reducer Sub Reducer State Services Remote Services Data Flow
  • 26. 26Copyright (c) 2020, Olaf Nouvortne Micro-Modeling Behavior and Redux Stuff Showing a list of Components linked to a Function... Compare with the Code here: Presentational Components: ➔ https://github.com/onouv/fscl/tree/master/client/src/function/LinkedComponentsList Actions and Services: ➔ .../client/src/function/redux/LoadLinkedComponentsAsyncAction.js ➔ .../client/src/lib/api/FetchRootLevelService.js ➔ .../client/src/lib/api/LoadLinkEntitiesService.js Reducers: ➔ .../client/src/function/redux/FunctionReducer.js ➔ .../client/src/function/redux/EntityLinksReducer.js Notice, the EntityLinksReducer had better been placed in .../lib/redux
  • 27. 27Copyright (c) 2020, Olaf Nouvortne THANK YOU Questions, thoughts and remarks most welcome onouv@t-online.de