SlideShare uma empresa Scribd logo
1 de 49
Baixar para ler offline
I serve to empower WordPress developers.
@hellofromtonya
@KnowTheCodePro
Tonya MorkProgress of JavaScript
Architecture
This talk will cover…
➡ The What - what software architecture is.

➡ The Why - What problems is it seeking to solve.

➡ The How - Look at the different architectures. 

➡ The Effective - Score each.

➡ The Future - Look at what’s next.
My Goals for You…
Develop your architectural mindset
and decision-making process.

Challenge you to think about the
key concepts in your work.
What is
software architecture?
?
Answers that I’ve heard include…
• Filesystem structure of our code

• Structure of the code itself

• Abstract visualization of what we might build
Software architecture is about
making fundamental structural
choices which are costly to
change once implemented.
“
https://en.wikipedia.org/wiki/Software_architecture
Huh?
Code’s Blueprint
Requirements Plan Code
Software architecture is
about making decisions
and defining the blueprint.
Emphasis on
• how all the pieces will interact,
• the role each plays,
• and how it all fits together
• over the entire lifecycle.
It’s the big picture.
Step out of the code.
Think about the building blocks.
The Why
What problems does
it seek to solve?
?
Synchronized Data
#1
Performance
#2
Developer Experience
#3
User Experience
#4
Business of Software
#5
What drives our
thinking and decision-
making?
?
Drives Our Thinking & Decisions:
How all the pieces will interact,
the role each plays,
and how it all fits together
over the entire lifecycle.
Leverage Principles & Design Patterns.
0 Retired
↓ Costs
↓ Risks
↓ Time
↑ Effectiveness
↑ Experience
↑ Performance
Software Lifecycle
What drives our decisions?
How have we solved
these problems?
How effective?
?
Layered Architecture
Presentation Layer
Business Layer
Data Layer
MV* Architectures
MVC
MVP
MVVM
Credit: Learning JavaScript Design Patterns by Adnan Osmani
Synchronized

Performance

Developer Experience

User Experience

Business
MV* + REST have not solved
all of the problems.
Why?
?
Mutability
#1
mutability adjective
Subject to change.
Problems are:

• Synchronized Data

• How reliable is the data?

• How long do we have to wait for reliable data?

• Adds complexity
We want
immutability
Functional Programming
• Pure functions

• input -> output

• side effects

• globals

• data in, data out

• Immutable data
REST Overfetching
#2
User information GET /wp/v2/users/<id>

Event information GET /wp-json/foo/v2/users/<id>/events

Payment information GET /wp-json/foo/v2/users/<id>/payments

…
Overfetching:
Multiple REST endpoints + Extra Unneeded Data
Synchronized

Performance

Developer Experience

User Experience

Business
MV* + REST have not solved
all of the problems.
Component-Based Architectures or Hybrid
Internals
Interface
Internals
Interface
Internals
Interface
Facade
Mediator
• Self-sufficient

• Easy to integrate

• Swappable

• Blackbox
Synchronized

Performance

Developer Experience

User Experience

Business
Engineering old principles in
new ways while innovating
new solutions.
DOM diffing
Virtual DOM
Incremental DOM
Leverages:

• Tree Data Structures

• Diffing - diff algorithms
Synchronized

Performance

Developer Experience

User Experience

Business
Incremental DOM
http://google.github.io/incremental-dom/
Real DOM
Virtual DOM
Diffing
Real DOM
Incremental DOM
Diffing
React’s Virtual DOM
https://reactjs.org/docs/faq-internals.html
Immutability
Data does not change.
Leverages:

• Tree Data Structures

• Structural Sharing
Functional programming
Synchronized

Performance

Developer Experience

User Experience

Business
The last thing you wanted
any programmer to do is
mess with internal state.…
“ Alan Kay, Creator of Smalltalk
The Early History of Smalltalk
1993
We believe that the major contributor
to this complexity in many systems is
the handling of state and the burden
that this adds when trying to analyse
and reason about the system.
“
Ben Moseley and Peter Marks
Out of the Tar Pit
2006
http://curtclifton.net/papers/MoseleyMarks06a.pdf
Immutability
Develop how we think about the state of data,
i.e. as a single occurrence and can’t change.
Immutability
user = {
id: 1,
firstName: 'Tonya',
lastName: 'Mork',
role: 'admin',
twitter: ‘@hellofromtonya’,
github: ‘hellofromtonya’
}
1 ‘Tonya’ ‘Mork’ ‘admin’
‘@hellofr
omtonya’
‘hellofro
mtonya’
‘id’ ‘firstName’ ‘lastName’ ‘role’ ‘twitter’ ‘github’
user
10 ‘Tonya’ ‘Mork’ ‘admin’
‘@hellofr
omtonya’
‘hellofro
mtonya’
‘id’ ‘firstName’ ‘lastName’ ‘role’ ‘twitter’ ‘github’
newUser
Copy don’t change.
Trie + Structural Sharing
1 ‘Tonya’ ‘Mork’ ‘admin’
‘@hellofr
omtonya’
‘hellofro
mtonya’
‘id’ ‘firstName’ ‘lastName’ ‘role’ ‘twitter’ ‘github’
usernewUser
10 ‘Tonya’
‘id’ ‘firstName’
Advantages:

• Less Memory

• More Performant

• Data Persist
Synchronized

Performance

Developer Experience

User Experience

Business
https://www.youtube.com/watch?v=Wo0qiGPSV-s
Immutable Data Structures
Immutable Architecture
Synchronized

Performance

Developer Experience

User Experience

Business
How do we solve the problem
of REST overfetching?
Synchronized

Performance

Developer Experience

User Experience

Business
GraphQL
What are the next
steps forward?
Immutable
Declarative
Executable
Architecture
IDEA Architecture by Lee Byron
https://www.youtube.com/watch?v=oTcDmnAXZ4E
IDEA Architecture
Credit: “Immutable Application Architecture”
by Lee Byron

at React Europe 2018

https://www.youtube.com/watch?v=oTcDmnAXZ4E
Queue
Actions
Views
Components
Models
State
Server
{
Server: (State) => Promise<State>
Optimistic: (State) => State
}
Let’s Review the Key
Take Aways
Key Takeaways:
• Software Architecture is all about making structural
decisions.

• We think about the big picture and break it down into
building blocks.

• Emphasize role, interaction, relationships, etc.

• Decisions are based on synchronizing data, performance,
DX, UX, and business.
We are very close to solving all of
the problems.
Future will be about maximization
and solving tomorrow’s problems.
I serve to empower WordPress developers.
Tonya Mork
@hellofromtonya
https://KnowTheCode.io
Questions?

Mais conteúdo relacionado

Semelhante a Progress of JavaScript Architecture

How To Become A Blockchain Engineer
How To Become A Blockchain EngineerHow To Become A Blockchain Engineer
How To Become A Blockchain Engineer
101 Blockchains
 

Semelhante a Progress of JavaScript Architecture (20)

QCon NYC: Distributed systems in practice, in theory
QCon NYC: Distributed systems in practice, in theoryQCon NYC: Distributed systems in practice, in theory
QCon NYC: Distributed systems in practice, in theory
 
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...DevSecCon Singapore 2018 -  Remove developers’ shameful secrets or simply rem...
DevSecCon Singapore 2018 - Remove developers’ shameful secrets or simply rem...
 
From hello world to goodbye code
From hello world to goodbye codeFrom hello world to goodbye code
From hello world to goodbye code
 
It's Not Just About Code
It's Not Just About CodeIt's Not Just About Code
It's Not Just About Code
 
PyData Texas 2015 Keynote
PyData Texas 2015 KeynotePyData Texas 2015 Keynote
PyData Texas 2015 Keynote
 
Tips & Tricks for Being a Successful Tech Lead
Tips & Tricks for Being a Successful Tech LeadTips & Tricks for Being a Successful Tech Lead
Tips & Tricks for Being a Successful Tech Lead
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineers
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineers
 
Continuum Analytics and Python
Continuum Analytics and PythonContinuum Analytics and Python
Continuum Analytics and Python
 
Hexagonal Symfony - SymfonyCon Amsterdam 2019
Hexagonal Symfony - SymfonyCon Amsterdam 2019Hexagonal Symfony - SymfonyCon Amsterdam 2019
Hexagonal Symfony - SymfonyCon Amsterdam 2019
 
Anaconda and PyData Solutions
Anaconda and PyData SolutionsAnaconda and PyData Solutions
Anaconda and PyData Solutions
 
How To Become A Blockchain Engineer
How To Become A Blockchain EngineerHow To Become A Blockchain Engineer
How To Become A Blockchain Engineer
 
Hacking for fun & profit - The Kubernetes Way - Demi Ben-Ari - Panorays
Hacking for fun & profit - The Kubernetes Way - Demi Ben-Ari - PanoraysHacking for fun & profit - The Kubernetes Way - Demi Ben-Ari - Panorays
Hacking for fun & profit - The Kubernetes Way - Demi Ben-Ari - Panorays
 
XPDays Ukraine: Legacy
XPDays Ukraine: LegacyXPDays Ukraine: Legacy
XPDays Ukraine: Legacy
 
DevSecCon SG 2018 Fabian Presentation Slides
DevSecCon SG 2018 Fabian Presentation SlidesDevSecCon SG 2018 Fabian Presentation Slides
DevSecCon SG 2018 Fabian Presentation Slides
 
Software engineering the genesis
Software engineering  the genesisSoftware engineering  the genesis
Software engineering the genesis
 
Keynote: The Phoenix Project: Lessons Learned - PuppetConf 2014
Keynote: The Phoenix Project: Lessons Learned - PuppetConf 2014Keynote: The Phoenix Project: Lessons Learned - PuppetConf 2014
Keynote: The Phoenix Project: Lessons Learned - PuppetConf 2014
 
How we tested our code "Google way"
How we tested our code "Google way"How we tested our code "Google way"
How we tested our code "Google way"
 
All about that reactive ui
All about that reactive uiAll about that reactive ui
All about that reactive ui
 
Micro services
Micro servicesMicro services
Micro services
 

Último

"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 

Último (20)

Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 

Progress of JavaScript Architecture

  • 1. I serve to empower WordPress developers. @hellofromtonya @KnowTheCodePro Tonya MorkProgress of JavaScript Architecture
  • 2. This talk will cover… ➡ The What - what software architecture is. ➡ The Why - What problems is it seeking to solve. ➡ The How - Look at the different architectures. ➡ The Effective - Score each. ➡ The Future - Look at what’s next.
  • 3. My Goals for You… Develop your architectural mindset and decision-making process. Challenge you to think about the key concepts in your work.
  • 5. Answers that I’ve heard include… • Filesystem structure of our code • Structure of the code itself • Abstract visualization of what we might build
  • 6. Software architecture is about making fundamental structural choices which are costly to change once implemented. “ https://en.wikipedia.org/wiki/Software_architecture
  • 9. Software architecture is about making decisions and defining the blueprint. Emphasis on • how all the pieces will interact, • the role each plays, • and how it all fits together • over the entire lifecycle.
  • 10. It’s the big picture. Step out of the code. Think about the building blocks.
  • 11. The Why What problems does it seek to solve? ?
  • 17. What drives our thinking and decision- making? ?
  • 18. Drives Our Thinking & Decisions: How all the pieces will interact, the role each plays, and how it all fits together over the entire lifecycle. Leverage Principles & Design Patterns.
  • 19. 0 Retired ↓ Costs ↓ Risks ↓ Time ↑ Effectiveness ↑ Experience ↑ Performance Software Lifecycle What drives our decisions?
  • 20. How have we solved these problems? How effective? ?
  • 22. MV* Architectures MVC MVP MVVM Credit: Learning JavaScript Design Patterns by Adnan Osmani Synchronized Performance Developer Experience User Experience Business
  • 23. MV* + REST have not solved all of the problems. Why? ?
  • 25. mutability adjective Subject to change. Problems are: • Synchronized Data • How reliable is the data? • How long do we have to wait for reliable data? • Adds complexity We want immutability
  • 26. Functional Programming • Pure functions • input -> output • side effects • globals • data in, data out • Immutable data
  • 28. User information GET /wp/v2/users/<id> Event information GET /wp-json/foo/v2/users/<id>/events Payment information GET /wp-json/foo/v2/users/<id>/payments … Overfetching: Multiple REST endpoints + Extra Unneeded Data Synchronized Performance Developer Experience User Experience Business
  • 29. MV* + REST have not solved all of the problems.
  • 30. Component-Based Architectures or Hybrid Internals Interface Internals Interface Internals Interface Facade Mediator • Self-sufficient • Easy to integrate • Swappable • Blackbox Synchronized Performance Developer Experience User Experience Business
  • 31. Engineering old principles in new ways while innovating new solutions.
  • 32. DOM diffing Virtual DOM Incremental DOM Leverages: • Tree Data Structures • Diffing - diff algorithms Synchronized Performance Developer Experience User Experience Business
  • 33. Incremental DOM http://google.github.io/incremental-dom/ Real DOM Virtual DOM Diffing Real DOM Incremental DOM Diffing React’s Virtual DOM https://reactjs.org/docs/faq-internals.html
  • 34. Immutability Data does not change. Leverages: • Tree Data Structures • Structural Sharing Functional programming Synchronized Performance Developer Experience User Experience Business
  • 35. The last thing you wanted any programmer to do is mess with internal state.… “ Alan Kay, Creator of Smalltalk The Early History of Smalltalk 1993
  • 36. We believe that the major contributor to this complexity in many systems is the handling of state and the burden that this adds when trying to analyse and reason about the system. “ Ben Moseley and Peter Marks Out of the Tar Pit 2006 http://curtclifton.net/papers/MoseleyMarks06a.pdf
  • 37. Immutability Develop how we think about the state of data, i.e. as a single occurrence and can’t change.
  • 38. Immutability user = { id: 1, firstName: 'Tonya', lastName: 'Mork', role: 'admin', twitter: ‘@hellofromtonya’, github: ‘hellofromtonya’ } 1 ‘Tonya’ ‘Mork’ ‘admin’ ‘@hellofr omtonya’ ‘hellofro mtonya’ ‘id’ ‘firstName’ ‘lastName’ ‘role’ ‘twitter’ ‘github’ user 10 ‘Tonya’ ‘Mork’ ‘admin’ ‘@hellofr omtonya’ ‘hellofro mtonya’ ‘id’ ‘firstName’ ‘lastName’ ‘role’ ‘twitter’ ‘github’ newUser Copy don’t change.
  • 39. Trie + Structural Sharing 1 ‘Tonya’ ‘Mork’ ‘admin’ ‘@hellofr omtonya’ ‘hellofro mtonya’ ‘id’ ‘firstName’ ‘lastName’ ‘role’ ‘twitter’ ‘github’ usernewUser 10 ‘Tonya’ ‘id’ ‘firstName’ Advantages: • Less Memory • More Performant • Data Persist Synchronized Performance Developer Experience User Experience Business https://www.youtube.com/watch?v=Wo0qiGPSV-s
  • 42. How do we solve the problem of REST overfetching? Synchronized Performance Developer Experience User Experience Business GraphQL
  • 43. What are the next steps forward?
  • 44. Immutable Declarative Executable Architecture IDEA Architecture by Lee Byron https://www.youtube.com/watch?v=oTcDmnAXZ4E
  • 45. IDEA Architecture Credit: “Immutable Application Architecture” by Lee Byron at React Europe 2018 https://www.youtube.com/watch?v=oTcDmnAXZ4E Queue Actions Views Components Models State Server { Server: (State) => Promise<State> Optimistic: (State) => State }
  • 46. Let’s Review the Key Take Aways
  • 47. Key Takeaways: • Software Architecture is all about making structural decisions. • We think about the big picture and break it down into building blocks. • Emphasize role, interaction, relationships, etc. • Decisions are based on synchronizing data, performance, DX, UX, and business.
  • 48. We are very close to solving all of the problems. Future will be about maximization and solving tomorrow’s problems.
  • 49. I serve to empower WordPress developers. Tonya Mork @hellofromtonya https://KnowTheCode.io Questions?