Disclaimer
• High-level architecture, doesn’t define interfaces
• Suggestions, not rules
• Works for me, may not work for you
Slide 8
Slide 8 text
Design Architecture
⚡
Slide 9
Slide 9 text
– Martin Fowler
“…decisions that are hard
to change…”
Architecture
Slide 10
Slide 10 text
High-level constraints
of the project
Slide 11
Slide 11 text
Dynamic
requirements
Slide 12
Slide 12 text
No content
Slide 13
Slide 13 text
Scalable & flexible
data layer
Slide 14
Slide 14 text
Data layer
• RESTful API
• WebSocket application service
• WebRTC data-channel
• Various data packages
• Bert-RPC
• JSON
• etc.
Slide 15
Slide 15 text
Scalable
team & codebase
Slide 16
Slide 16 text
No content
Slide 17
Slide 17 text
High-level decisions
for the architecture
Slide 18
Slide 18 text
Dynamic Requirements
Scalable & flexible data layer
Scalable team & codebase
Slide 19
Slide 19 text
Dynamic Requirements
Scalable & flexible data layer
Scalable team & codebase
Slide 20
Slide 20 text
abstraction |əbˈstrakʃ(ə)n|
noun [ mass noun ]
…
4 the process of considering something
independently of its associations or attributes: the
question cannot be considered in abstraction from
the historical context in which it was raised.
Slide 21
Slide 21 text
WebRTC
Gateway
WebSocket
Gateway
Slide 22
Slide 22 text
Gateway
WebRTC
Gateway
WebSocket
Gateway
Slide 23
Slide 23 text
Dynamic Requirements
Scalable & flexible data layer
Scalable team & codebase
Async services
• Map actions to commands
• Map responses/messages to actions
• Use an abstract gateway
Slide 89
Slide 89 text
No content
Slide 90
Slide 90 text
Recap
Slide 91
Slide 91 text
Async services
Business facade
Business logic
Communication logic
Immutable app state
Component tree
root cmp
sign-up form
user
UserModel
User Action
Creator
signup(data)
signup(data)
RESTful Async
Service
process(action)
userReducer
register()
RESTful
CommandBuilder
build(action)
Restful
Command
Restful
Gateway
invoke()
send()
creates()
uses user$
Stream
Dependency
Action (manipulation/method call)
User registration
user.email = email
user.name = name
uses
as user$
Slide 92
Slide 92 text
Async services
Business facade
Business logic
Communication logic
Immutable app state
Component tree
root cmp
sign-up form
user
UserModel
User Action
Creator
signup(data)
RESTful Async
Service
process(action)
userReducer
register()
RESTful
CommandBuilder
build(action)
Restful
Command
Restful
Gateway
invoke()
send()
creates()
uses user$
Stream
Dependency
Action (manipulation/method call)
User registration
user.email = email
user.name = name
signup(data) uses
as user$
Slide 93
Slide 93 text
Async services
Business facade
Business logic
Communication logic
Immutable app state
Component tree
root cmp
sign-up form
user
UserModel
User Action
Creator
RESTful Async
Service
process(action)
userReducer
register()
RESTful
CommandBuilder
build(action)
Restful
Command
Restful
Gateway
invoke()
send()
creates()
uses user$
Stream
Dependency
Action (manipulation/method call)
User registration
user.email = email
user.name = name
signup(data)
signup(data)
uses
as user$
Slide 94
Slide 94 text
Async services
Business facade
Business logic
Communication logic
Immutable app state
Component tree
root cmp
sign-up form
user
UserModel
User Action
Creator
RESTful Async
Service
process(action)
userReducer
register()
RESTful
CommandBuilder
build(action)
Restful
Command
Restful
Gateway
invoke()
send()
creates()
uses user$
Stream
Dependency
Action (manipulation/method call)
User registration
user.email = email
user.name = name
signup(data)
signup(data)
uses
as user$
Slide 95
Slide 95 text
Async services
Business facade
Business logic
Communication logic
Immutable app state
Component tree
root cmp
sign-up form
user
UserModel
User Action
Creator
RESTful Async
Service
process(action)
userReducer
register()
RESTful
CommandBuilder
build(action)
Restful
Command
Restful
Gateway
invoke()
send()
creates()
uses user$
Stream
Dependency
Action (manipulation/method call)
User registration
user.email = email
user.name = name
signup(data)
signup(data)
uses
as user$
Slide 96
Slide 96 text
Async services
Business facade
Business logic
Communication logic
Immutable app state
Component tree
root cmp
sign-up form
user
UserModel
User Action
Creator
RESTful Async
Service
process(action)
userReducer
register()
RESTful
CommandBuilder
build(action)
Restful
Command
Restful
Gateway
invoke()
send()
creates()
uses user$
Stream
Dependency
Action (manipulation/method call)
User registration
user.email = email
user.name = name
signup(data)
signup(data)
uses
as user$
Slide 97
Slide 97 text
Async services
Business facade
Business logic
Communication logic
Immutable app state
Component tree
root cmp
sign-up form
user
UserModel
User Action
Creator
RESTful Async
Service
process(action)
userReducer
register()
RESTful
CommandBuilder
build(action)
Restful
Command
Restful
Gateway
invoke()
send()
creates()
uses user$
Stream
Dependency
Action (manipulation/method call)
User registration
user.email = email
user.name = name
signup(data)
signup(data)
uses
as user$
Slide 98
Slide 98 text
Async services
Business facade
Business logic
Communication logic
Immutable app state
Component tree
root cmp
sign-up form
user
UserModel
User Action
Creator
RESTful Async
Service
process(action)
userReducer
register()
RESTful
CommandBuilder
build(action)
Restful
Command
Restful
Gateway
invoke()
send()
creates()
uses user$
Stream
Dependency
Action (manipulation/method call)
User registration
user.email = email
user.name = name
signup(data)
signup(data)
uses
as user$
Slide 99
Slide 99 text
Async services
Business facade
Business logic
Communication logic
Immutable app state
Component tree
root cmp
sign-up form
user
UserModel
User Action
Creator
RESTful Async
Service
process(action)
userReducer
register()
RESTful
CommandBuilder
build(action)
Restful
Command
Restful
Gateway
invoke()
send()
creates()
uses user$
Stream
Dependency
Action (manipulation/method call)
User registration
user.email = email
user.name = name
signup(data)
signup(data)
uses
as user$
Slide 100
Slide 100 text
Async services
Business facade
Business logic
Communication logic
Immutable app state
Component tree
root cmp
sign-up form
user
UserModel
User Action
Creator
signup(data)
RESTful Async
Service
process(action)
userReducer
register()
RESTful
CommandBuilder
build(action)
Restful
Command
Restful
Gateway
invoke()
send()
creates()
uses
as user$
uses user$
Stream
Dependency
Action (manipulation/method call)
User registration
user.email = email
user.name = name
signup(data)
Slide 101
Slide 101 text
No content
Slide 102
Slide 102 text
Properties…
• Predictable state management
• Testable (easy to mock services thanks to DI)
• Not coupled to any remote service
• Serializable state usable offline
• Model can use different services based on context
• Easy management of async events
Slide 103
Slide 103 text
Properties…
• Predictable state management
• Testable (easy to mock services thanks to DI)
• Not coupled to any remote service
• Serializable state usable offline
• Model can use different services based on context
• Easy management of async events
Slide 104
Slide 104 text
Properties…
• Predictable state management
• Testable (easy to mock services thanks to DI)
• Not coupled to any remote service
• Serializable state usable offline
• Model can use different services based on context
• Easy management of async events
Slide 105
Slide 105 text
Properties…
• Predictable state management
• Testable (easy to mock services thanks to DI)
• Not coupled to any remote service
• Serializable state usable offline
• Model can use different services based on context
• Easy management of async events
Slide 106
Slide 106 text
Properties…
• Predictable state management
• Testable (easy to mock services thanks to DI)
• Not coupled to any remote service
• Serializable state usable offline
• Model can use different services based on context
• Easy management of async events
Slide 107
Slide 107 text
Properties…
• Predictable state management
• Testable (easy to mock services thanks to DI)
• Not coupled to any remote service
• Serializable state usable offline
• Model can use different services based on context
• Easy management of async events
Slide 108
Slide 108 text
Properties…
• Predictable state management
• Testable (easy to mock services thanks to DI)
• Not coupled to any remote service
• Serializable state usable offline
• Model can use different services based on context
• Easy management of async events