Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Re-Architecting Applications (Without a Rewrite!)
Daniel Lew
PRO
February 10, 2018
Programming
8
2.2k
Re-Architecting Applications (Without a Rewrite!)
Talk given at DevFestMN 2018 & MinneBar 13.
Recording here:
https://youtu.be/dKm7MKoxVIg
Daniel Lew
PRO
February 10, 2018
Tweet
Share
More Decks by Daniel Lew
See All by Daniel Lew
Grokking Coroutines (MinneBar)
dlew
PRO
5
360
ClimateChangeTech.pdf
dlew
PRO
0
33
What Tech Can Do About Climate Change
dlew
PRO
0
290
Grokking Coroutines
dlew
PRO
5
790
Automated Tests Aren't Enough
dlew
PRO
0
410
The Importance of Developer Communities
dlew
PRO
0
45
Crazy Fancy Android Text
dlew
PRO
5
1k
Intro to Android Development
dlew
PRO
1
390
Irrational Exuberance: Kotlin Edition
dlew
PRO
1
360
Other Decks in Programming
See All in Programming
既存のプロジェクトにKMMを導入するための対応策
martysuzuki
2
280
脱オブジェクト指向講座(5分LT資料)
kishida
8
10k
A technique to implement DSL in Ruby
okuramasafumi
0
480
近況PHP / PHP in now a days
uzulla
4
1.3k
Node.js 最新動向 TFCon 2022
yosuke_furukawa
PRO
5
2.5k
C言語でメモリ管理を考えた話
hkawai
0
180
Where and how to run UI tests (Droidcon London, 2021)
nonews
0
200
Micro Frontends with Module Federation: Beyond the Basics @jax2022
manfredsteyer
PRO
0
270
Jakarta EE 10 is Coming Your Way
ivargrimstad
0
1.8k
SPA/MPA 議論の俯瞰と 現代における設計のポイント - #tfcon 2022 フロントエンド設計
ahomu
3
1.4k
Securing Kafka Connect Pipelines with Client-Side Field Level Cryptography @ Kafka Summit London 2022
hpgrahsl
0
300
Milestoner
bkuhlmann
1
200
Featured
See All Featured
Web Components: a chance to create the future
zenorocha
303
40k
Ruby is Unlike a Banana
tanoku
91
9.2k
Building Adaptive Systems
keathley
25
1.1k
Why You Should Never Use an ORM
jnunemaker
PRO
47
5.5k
Product Roadmaps are Hard
iamctodd
34
6.1k
Designing Experiences People Love
moore
130
22k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
15
900
BBQ
matthewcrist
74
7.9k
Streamline your AJAX requests with AmplifyJS and jQuery
dougneiner
125
8.5k
The Brand Is Dead. Long Live the Brand.
mthomps
45
2.7k
Visualization
eitanlees
124
11k
A designer walks into a library…
pauljervisheath
196
16k
Transcript
Re-architecting Applications (Without a Rewrite!) @danlew42
architecture: the structure and design of a system or product
None
None
None
None
None
“Model-View- Controller is the best thing since sliced bread.” ~Evil
Dan Lew
“OMG, I’m switching to MVC ASAP!” ~You Stability Some New
Architecture
Danger • Pure architectures require fresh code • Rewrites always
take longer than expected • Old code == battle tested • Expectations may not match reality
Goals • Introduce new architectures to existing codebase • Push
releases while re-architecting codebase
None
</Housing Metaphors>
Goal #1: Introduce new architectures to existing codebase
Re-Architecting Safely • Prevent overly ambitious rewrites • Prevent regrettable
architecture choices • Steps • Explore • Experiment • Expand • Embrace
Explore • What is the problem? • Define goals •
Define constraints • What are the solutions? • Brainstorm • Research
Experiment • Pick a project • Minimize work • Small
project • Simplified implementations • Minimize damage • Self-contained project • Unimportant project
Expand • Run more experiments • Pick projects wisely •
Use architecture in new ways • Pick hardest problems • Stretch architecture to limits
Embrace • Write all new code with new architecture •
Deprecate old architecture • Delete old code (optional)
Disclaimer Not an exact science
Goal #2: Push releases while re-architecting codebase
Can’t simultaneously use old and new architecture Can’t keep releasing
Old New Old + New
Parallel Development
Decouple Code BAD GOOD
Feature Flags
Shims
Shims
Offline Mode A parallel development success story
Online Only Offline Enabled
Decoupling Services Before After
Feature Flags
Shims Before After
Offline Mode • Project length: 1.5 years • Never stopped
releasing • Minimal UI changes • Gradual experimentation via flags • Switched over without anyone noticing • https://tech.trello.com/sync-architecture/
Failures With real life examples!
Explore Failures • Architecting with no purpose • Navi •
Choosing new and shiny without understanding • RxJava
Experiment Failures • Making the experiment too large • JavaScript:
The Good Parts • Not recognizing a failed experiment • Operations
Expand Failures • Choosing only easy problems • Identifiers •
Not recognizing a failed corner case • RxLifecycle
Embrace Failures • Continuing to expend effort on old architecture
• Fresh boards
Pet Peeve Telling everyone about an architecture before proving it
out!
Current Architecture Thoughts
Omni Models • Single model • Deserialized from JSON •
Written to ORM • Used by UI • Problems • Which fields are present? • How do we avoid mutability issues?
Domain-specific models • ApiModel • Only used when talking to
server • DbModel • Mutable, flexible • UiModel • Immutable, guarantees values • ApiModel <-> DbModel <-> UiModel
Unidirectional Architecture
Thanks for listening! @danlew42