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 SPA with DDD - The beginning of a w...
Search
Manfred Steyer
PRO
February 06, 2020
Programming
4
710
Sustainable SPA with DDD - The beginning of a wonderful friendship?
Manfred Steyer
PRO
February 06, 2020
Tweet
Share
More Decks by Manfred Steyer
See All by Manfred Steyer
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
430
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
260
Your Architecture as a Crime Scene: Improvements with Forensic Analysis
manfredsteyer
PRO
0
17
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
340
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
220
Your Architecture as a Crime Scene: Improvements with Forensic Analysis @ijs Munich 2024
manfredsteyer
PRO
0
250
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
150
Micro Frontends Unmasked: Opportunities, Challenges, Alternatives @w-jax 2024 München
manfredsteyer
PRO
0
140
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
150
Other Decks in Programming
See All in Programming
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.4k
[JAWS-UG横浜 #80] うわっ…今年のServerless アップデート、少なすぎ…?
maroon1st
0
100
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
6
700
BEエンジニアがFEの業務をできるようになるまでにやったこと
yoshida_ryushin
0
200
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
290
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
410
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
1.9k
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
Scaling your build logic
antalmonori
1
100
ドメインイベント増えすぎ問題
h0r15h0
2
570
php-conference-japan-2024
tasuku43
0
430
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
BBQ
matthewcrist
85
9.4k
Agile that works and the tools we love
rasmusluckow
328
21k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
230
52k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
19
2.3k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
4 Signs Your Business is Dying
shpigford
182
22k
Transcript
@ManfredSteyer Sustainable SPA with DDD The beginning of a wonderful
friendship? angular-architects.io
What do we need for a good architecture? Experience
@ManfredSteyer Domain Driven Design
@ManfredSteyer How to create sustainable frontend architectures with ideas from
DDD? ?
@ManfredSteyer How to create sustainable frontend architectures with ideas from
DDD? ?
@ManfredSteyer Contents 1) DDD in a Nutshell 2) Monorepos 3)
Monorepos & DDD 4) DDD & Micro Frontends
@ManfredSteyer About me… • Manfred Steyer ANGULARarchitects.io • Angular Trainings
and Consultancy • Google Developer Expert (GDE) • Trusted Collaborator in the Angular Team Page ▪ 8 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 Advantages No version conflicts No burden with distributing libs
@ManfredSteyer Moving back and forth Npm Registry
@ManfredSteyer https://nrwl.io/nx
@ManfredSteyer Visualize Module Structure
@ManfredSteyer 3) 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 e. g.
data access 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 BLOG ANGULARarchitects.io
@ManfredSteyer Finegrained Libraries • Unit of recompilation • Unit of
retesting • Access restrictions • Information Hiding
@ManfredSteyer 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
ProductFacade { 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 { […] } } SPA 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 Entities & Aggregates
@ManfredSteyer Entity/ Aggregate Root (OOP) public class BoardingList { private
int id; private int flightId; private List<BoardingListEntry> entries; private boolean completed; // Getters and Setters public void setStatus(int passengerId, BoardingStatus status) { // Complex logic to update status } }
FP und DDD?
@ManfredSteyer Entities (FP) export interface BoardingList { readonly id: number;
readonly flightId: number; readonly entries: BoardingListEntry[]; readonly completed: boolean; } export function updateBoardingStatus( boardingList: BoardingList, passengerId: number, status: BoardingStatus) { // Complex logic to update status }
@ManfredSteyer 4) Micro Frontends
@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 BLOG ANGULARarchitects.io
Summary • Slicing into sub-domains • Slicing into layers •
Finegrained libraries • Enforce restrictions • Fits to micro frontends
@ManfredSteyer
@ManfredSteyer Contact and Downloads [web] ANGULARarchitects.io [twitter] ManfredSteyer d Slides
& Examples Public: Frankfurt, Munich, Vienna In-House: everywhere http://softwarearchitekt.at/workshops