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 wonderful friendship? @dddsummit in Berlin
Search
Manfred Steyer
PRO
December 09, 2019
Programming
1
480
Sustainable SPA with DDD The beginning of a wonderful friendship? @dddsummit in Berlin
Manfred Steyer
PRO
December 09, 2019
Tweet
Share
More Decks by Manfred Steyer
See All by Manfred Steyer
Native Federation: The Future of Micro Frontends in Angular
manfredsteyer
PRO
0
34
The New NGRX Signal Store for Angular: 3+n Flavors of the Signal Store
manfredsteyer
PRO
0
29
Micro Frontends with Modern Angular and Island Architectures @ijs London 2024
manfredsteyer
PRO
0
84
Modern State Management in Angular: 3+n Flavors of the Signal Store @ijs London 2024
manfredsteyer
PRO
0
80
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
Migrating to Signals: A Practical Workshop
manfredsteyer
PRO
0
420
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
Other Decks in Programming
See All in Programming
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
380
Java 22 Overview
kishida
1
180
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
Elm 0.19.0 Changes
bkuhlmann
0
490
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
840
使ってみよう Azure AI Document Intelligence
kosmosebi
2
310
検証も兼ねて個人開発でHonoとかと向き合った話
hanetsuki
1
930
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
490
見た目から始める生産性向上
ikumatadokoro
7
840
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
ゆるい個人開発のススメ
kuroppe1819
10
990
新宿ダンジョンを可視化してみた
satoshi7190
2
260
Featured
See All Featured
RailsConf 2023
tenderlove
4
540
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
How GitHub (no longer) Works
holman
304
140k
Practical Orchestrator
shlominoach
182
9.7k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
2
3.4k
Become a Pro
speakerdeck
PRO
11
4.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
322
20k
Why Our Code Smells
bkeepers
PRO
331
56k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Automating Front-end Workflow
addyosmani
1356
200k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.6k
Gamification - CAS2011
davidbonilla
76
4.6k
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 Sharing Experience for Architectures BEST PRACTICES PATTERNS METHODOLOGY
@ManfredSteyer Domain Driven Design
@ManfredSteyer How to create sustainable frontend architecture with ideas from
DDD? ?
@ManfredSteyer How to create sustainable frontend architecture with ideas from
DDD? ?
@ManfredSteyer Contents 1) DDD in a Nutshell 2) Angular 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 { […] } } 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) 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
@ManfredSteyer
@ManfredSteyer ✓ Simple Loosing State Load a new
Application
@ManfredSteyer µService Providing a (SPA based) Shell µApp µApp µApp
Shell ▪ iframes ▪ Bootstrapping several SPAs ▪ + Lazy Loading
@ManfredSteyer Loading MicroApps <script src="micro-app.bundle.js"></script> <micro-app></micro-app>
@ManfredSteyer DEMO
@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