Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Sustainable Architectures with Angular, Monorepos and DDD @wjax 2019 in Munich
Search
Manfred Steyer
PRO
November 06, 2019
Programming
0
420
Sustainable Architectures with Angular, Monorepos and DDD @wjax 2019 in Munich
Example:
https://github.com/manfredsteyer/monorepo_domains.git
Manfred Steyer
PRO
November 06, 2019
Tweet
Share
More Decks by Manfred Steyer
See All by Manfred Steyer
The New NGRX Signal Store for Angular: 3+n Flavors of the Signal Store
manfredsteyer
PRO
0
14
Micro Frontends with Modern Angular and Island Architectures @ijs London 2024
manfredsteyer
PRO
0
80
Modern State Management in Angular: 3+n Flavors of the Signal Store @ijs London 2024
manfredsteyer
PRO
0
79
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
Migrating to Signals: A Practical Workshop
manfredsteyer
PRO
0
410
Micro Frontends with Web Standards
manfredsteyer
PRO
1
300
The New NGRX Signal Store for Angular: 3+n Flavors
manfredsteyer
PRO
1
220
Leveraging the new NGRX Signal Store
manfredsteyer
PRO
0
170
Modern State Management in Angular: The 3+n Flavors of the NGRX Signal Store
manfredsteyer
PRO
0
110
Other Decks in Programming
See All in Programming
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
大規模UIKitベースアプリへのTCAの段階的導入/gradual-adoption-of-tca-in-a-large-scale-uikit-based-app
takehilo
1
100
"config" ってなんだ? / What is "config"?
okashoi
0
240
Snowflakeで眠ったデータを起こそう!
estie
0
120
Git Rebase
bkuhlmann
11
1.6k
GitHub Copilotのススメ
marcy731
1
200
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
230
try! Swift Tokyo 初参加報告LT
hinakko2
0
220
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
180
Java 22 Overview
kishida
1
180
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
410
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
36
2.1k
The Power of CSS Pseudo Elements
geoffreycrofte
60
5k
Facilitating Awesome Meetings
lara
42
5.6k
Creatively Recalculating Your Daily Design Routine
revolveconf
210
11k
Automating Front-end Workflow
addyosmani
1356
200k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
The Pragmatic Product Professional
lauravandoore
25
5.8k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
7
1k
[RailsConf 2023] Rails as a piece of cake
palkan
23
3.9k
GraphQLとの向き合い方2022年版
quramy
32
12k
Code Review Best Practice
trishagee
55
15k
Six Lessons from altMBA
skipperchong
21
3k
Transcript
@ManfredSteyer Sustainable Architectures with Angular, Monorepos and DDD ManfredSteyer Manfred
Steyer SOFTWAREarchitekt.at
@ManfredSteyer What do we need for a good architecture ?
Experience
@ManfredSteyer Domain Driven Design
@ManfredSteyer How can create sustainable frontend architectures with ideas from
DDD?
@ManfredSteyer How can create sustainable frontend architectures with ideas from
DDD?
@ManfredSteyer Contents 1) Strategic DDD in a Nutshell 2) Angular
Monorepos 3) Monorepos & DDD 4) DDD & Micro Frontends
@ManfredSteyer About me… • Manfred Steyer SOFTWAREarchitekt.at • Angular Trainings
and Consultancy • Google Developer Expert (GDE) • Trusted Collaborator in the Angular Team Page ▪ 9 Manfred Steyer Public: Frankfurt, Munich, Vienna In-House: everywhere http://softwarearchitekt.at/workshops
@ManfredSteyer 1) DDD in a nutshell
@ManfredSteyer Domain Driven Design Strategic Design Tactical Design Decomposing a
System Design Patterns & Practices
@ManfredSteyer Domain Driven Design Strategic Design Tactical Design Decomposing a
System Design Patterns & Practices
@ManfredSteyer This is what Strategic DDD prevents
@ManfredSteyer Example e-Procurement System
@ManfredSteyer Catalog Approval Specification Ordering Example Sub-Domains
@ManfredSteyer 2) Monorepos
@ManfredSteyer Workspace
@ManfredSteyer Creating a Workspace npm install -g @angular/cli ng new
workspace cd workspace ng generate app my-app ng generate lib my-lib ng serve --project my-app ng build --project my-app
@ManfredSteyer Advantages Everyone uses the latest versions No version conflicts
No burden with distributing libs Creating new libs: Adding folder Experience: Successfully used at Google, Facebook, …
@ManfredSteyer Moving back and forth Npm Registry
@ManfredSteyer Tooling & Generator https://nrwl.io/nx
@ManfredSteyer Visualize Module Structure
@ManfredSteyer Nx Monorepos and Strategic Design
@ManfredSteyer Catalog Ordering Shared Feature Feature Feature Feature Feature UI
UI UI UI UI UI UI UI UI Domain Domain Domain Domain Domain Domain Util Util Util Util Util Util Enterprise Monorepo Patterns, Nrwl 2018: https://tinyurl.com/y2jjxld7 @ManfredSteyer Shared Kernel (if really needed) & other libs Smart Comp. Dumb Comp.
@ManfredSteyer Catalog Ordering Shared Feature API Feature Feature Feature Feature
UI UI UI UI UI UI UI UI UI Domain Domain Domain Domain Domain Domain Util Util Util Util Util Util @ManfredSteyer
@ManfredSteyer Catalog Ordering Shared Feature API Feature Feature Feature Feature
UI UI UI UI UI UI UI UI UI Domain Domain Domain Domain Domain Domain Util Util Util Util Util Util @ManfredSteyer
@ManfredSteyer Application Domain Infrastructure Isolate your domain! Domain Domain Infrastructure
e. g. data access Application Use case specific facades, state management Entities, biz logic
@ManfredSteyer Alternatives to layering • e. g. Hexagonal Architecture, Clean
Architecture • Anyway: We need to restrict access b/w libraries
@ManfredSteyer DEMO
@ManfredSteyer Finegrained Libraries • Unit of recompilation • Unit of
retesting • Access restrictions • Prevent Cycles • Information Hiding • Future replacement for NgModules?
@ManfredSteyer Bonus: Facades and State Management
@ManfredSteyer Facade (Application Service) @Injectable({ providedIn: 'root' }) export class
ProductFacade { […] }
@ManfredSteyer Facade (Application Service) @Injectable({ providedIn: 'root' }) export class
ProductFacade { public products: Product[] = []; […] } State!
@ManfredSteyer Facade (Application Service) @Injectable({ providedIn: 'root' }) export class
ProductFacade { public products: Product[] = []; constructor(private productService: ProductService) { } […] }
@ManfredSteyer Facade (Application Service) @Injectable({ providedIn: 'root' }) export class
ProductsFacade { public products: Product[] = []; constructor(private productService: ProductService) { } search(category: string): void { […] } }
@ManfredSteyer Facade (Application Service) @Injectable({ providedIn: 'root' }) export class
ProductFacade { public products: Product[] = []; constructor(private productService: ProductService) { } search(category: string): void { […] } } Angular has to pull :-(
@ManfredSteyer Facade (Application Service) @Injectable({ providedIn: 'root' }) export class
ProductFacade { public products: Observable<Product[]>; constructor(private productService: ProductService) { } search(category: string): void { […] } } Also key for messaging
@ManfredSteyer App Home Catalog Search RatingFacade ProductFacade SearchFacade Facades Have
State
@ManfredSteyer App Home Catalog Search RatingFacade ProductFacade SearchFacade Facades Have
State
@ManfredSteyer App Home Catalog Search RatingFacade ProductFacade SearchFacade Facades Have
State Store (z. B. Redux/ NGRX) Observable Action
@ManfredSteyer 4) DDD and Micro Frontends? Short outlook
@ManfredSteyer Catalog Ordering Shared Feature Feature Feature Feature Feature …
… … … … … … … … @ManfredSteyer e-Procurement App Deployment Monolith
@ManfredSteyer Catalog Ordering Shared Feature Feature Feature Feature Feature …
… … … … … … … … @ManfredSteyer Catalog App Ordering App Option 1: One App per Domain
@ManfredSteyer Catalog Ordering Shared Feature Feature Feature Feature Feature …
… … … … … … … … @ManfredSteyer Catalog App Ordering App Option 2: One Monorepo per Domain Publish shared libs seperately via npm Different Versions
@ManfredSteyer Summary Slicing into sub-domains Slicing into layers Relaxed layering
Finegrained libraries Enforce restrictions Fits to micro frontends
@ManfredSteyer
@ManfredSteyer Contact and Downloads [mail]
[email protected]
[web] SOFTWAREarchitekt.at [twitter] ManfredSteyer
d Slides & Examples Public: Frankfurt, Munich, Vienna In-House: everywhere http://softwarearchitekt.at/workshops