Sustainable Architectures with Angular, Monorepos and DDD @iJS 2019 in Munich

Sustainable Architectures with Angular, Monorepos and DDD @iJS 2019 in Munich

15934fa2aa7b2ce21f091e9b7cffa856?s=128

Manfred Steyer

October 26, 2019
Tweet

Transcript

  1. @ManfredSteyer Sustainable Architectures with Angular, Monorepos and DDD Manfred Steyer

    SOFTWAREarchitekt.at ManfredSteyer
  2. @ManfredSteyer What do we need for a good architecture ?

    Experience
  3. @ManfredSteyer Sharing Experience for Architectures BEST PRACTICES PATTERNS METHODOLOGY

  4. @ManfredSteyer Domain Driven Design

  5. @ManfredSteyer How can create sustainable frontend architectures with ideas from

    DDD?
  6. @ManfredSteyer How can create sustainable frontend architectures with ideas from

    DDD?
  7. @ManfredSteyer Contents 1) Strategic DDD 2) Angular Monorepos 3) Nx

    Monorepos and DDD 4) DDD & Micro Frontends
  8. @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
  9. @ManfredSteyer DDD in a nutshell

  10. @ManfredSteyer Domain Driven Design Strategic Design Tactical Design Decomposing a

    System Design Patterns & Practices
  11. @ManfredSteyer Domain Driven Design Strategic Design Tactical Design Decomposing a

    System Design Patterns & Practices
  12. @ManfredSteyer This is what Strategic DDD prevents

  13. @ManfredSteyer Example e-Procurement System

  14. @ManfredSteyer Catalog Approval Specification Ordering Example Sub-Domains

  15. @ManfredSteyer Request Product Specify Order Approve Order Send Order Request

    Budget Approve Budget Budget Hierarchy Manager Manager Employee Expert Manager Buying Agent Product
  16. @ManfredSteyer Catalog Approval Bounded Context Ubiquitous Language

  17. @ManfredSteyer Catalog Approval Specification Ordering Context Map

  18. @ManfredSteyer Approval Specification Context Map Catalog Catalog Shared Kernel

  19. @ManfredSteyer Catalog Approval API

  20. @ManfredSteyer Catalog Approval Calc VAT Calc VAT Seperate Ways

  21. @ManfredSteyer Lots of additional approaches for cross-domain communication …

  22. @ManfredSteyer 2) Monorepos

  23. @ManfredSteyer Workspace

  24. @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
  25. @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, …
  26. @ManfredSteyer Moving back and forth Npm Registry

  27. @ManfredSteyer Tooling & Generator https://nrwl.io/nx

  28. @ManfredSteyer Visualize Module Structure

  29. @ManfredSteyer Nx Monorepos and Strategic Design

  30. @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
  31. @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
  32. @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
  33. @ManfredSteyer Application Domain Infrastructure Isolate your domain! Domain Domain Infrastructure

    e. g. data access Application Use case specific facades, state management Entities, biz logic
  34. @ManfredSteyer Alternatives to layering • e. g. Hexagonal Architecture, Clean

    Architecture • Anyway: We need to restrict access b/w libraries
  35. @ManfredSteyer Finegrained Libraries • Unit of recompilation • Unit of

    retesting • Access restrictions • Prevent Cycles • Information Hiding • Future replacement for NgModules?
  36. @ManfredSteyer DEMO

  37. @ManfredSteyer DDD and Micro Frontends? Short outlook

  38. @ManfredSteyer Catalog Ordering Shared Feature Feature Feature Feature Feature …

    … … … … … … … … @ManfredSteyer e-Procurement App Deployment Monolith
  39. @ManfredSteyer Catalog Ordering Shared Feature Feature Feature Feature Feature …

    … … … … … … … … @ManfredSteyer Catalog App Ordering App Option 1: One App per Domain
  40. @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
  41. @ManfredSteyer Summary Slicing into sub-domains Slicing into layers Relaxed layering

    Finegrained libraries Enforce restrictions Fits to micro frontends
  42. @ManfredSteyer

  43. @ManfredSteyer Contact and Downloads [mail] manfred.steyer@SOFTWAREarchitekt.at [web] SOFTWAREarchitekt.at [twitter] ManfredSteyer

    d Slides & Examples Public: Frankfurt, Munich, Vienna In-House: everywhere http://softwarearchitekt.at/workshops