Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Architecture decisions and their impact

Architecture decisions and their impact

Architectural decisions, whether made intentionally or incidental, can have a huge impact on your day to day work. They can make changes more difficult, slow things down or make it harder to onboard new people. While there are quite a few talks on architecture patterns you rarely see real life examples. Luckily, open source projects are great for this. You can see the history and both the changes and discussions around them. So, let's do just that.

Denis Brumann

May 27, 2023
Tweet

More Decks by Denis Brumann

Other Decks in Programming

Transcript

  1. Architecture decisions
    and their impact

    View Slide

  2. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    3
    Denis Brumann
    @dbrumann
    Solutions Architect
    Maintainer of Deptrac

    View Slide

  3. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    4

    View Slide

  4. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    4

    View Slide

  5. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    5
    Code Project Structure Service Landscape
    Interactive
    Runtimes

    View Slide

  6. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    7

    View Slide

  7. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    8
    Application
    Analyse
    Command
    Analyser

    View Slide

  8. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    9
    Application
    Ana
    Com
    Service Container
    Service
    Service
    Service
    Service
    Service
    Service
    Service

    View Slide

  9. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    10
    Analyse
    Command
    Ana
    Read arguments/options

    View Slide

  10. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    11
    Analyser

    View Slide

  11. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    13
    Application
    Analyse
    Command
    Analyser
    Service Container
    Service
    Service
    Service
    Service
    Service
    Service
    Service
    Read
    arguments/
    options

    View Slide

  12. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    14
    Application
    Analyse
    Command
    Analyser
    Service Container
    Service
    Service
    Service
    Service
    Service
    Service
    Service
    Read
    arguments/
    options
    Service

    View Slide

  13. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    15
    https://my-app.com/
    MyApp DB
    MyApp
    https://foo.my-app.com/
    https://bar.my-app.com/

    View Slide

  14. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    16
    https://foo.my-app.com/
    Bar DB
    MyApp
    Foo DB
    https://bar.my-app.com/

    View Slide

  15. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    17
    https://foo.my-app.com/
    Bar DB
    MyApp
    Foo DB
    https://bar.my-app.com/
    Tenant-Aware
    Multi-Portal

    View Slide

  16. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    18
    Possible Problems
    Runtime errors (invalid context,
    misconfigured services)
    Debugging is more difficult
    (which service/config was used?)
    Tighter coupling & more complexity
    !

    View Slide

  17. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    19

    View Slide

  18. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    20

    View Slide

  19. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    20

    View Slide

  20. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    21
    Warning Signs
    Services creating other services
    (usage of new in code)
    Service Locator or factory-usage
    Config-objects (or arrays) being passed through
    "

    View Slide

  21. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    22

    View Slide

  22. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    23
    Lesson
    Avoid creating/configuring services
    at runtime
    * consider pushing the runtime context
    into the infrastructure layer
    #

    View Slide

  23. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    24
    Code Project Structure Service Landscape
    Interactive
    Runtimes
    Isolate
    Layers

    View Slide

  24. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    26
    Persistence Layer
    Domain Layer
    Application Layer
    Presentation Layer

    View Slide

  25. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    28
    Persistence Layer
    Domain Layer
    Application Layer
    Presentation Layer
    Request

    View Slide

  26. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    29
    Persistence Layer
    Domain Layer
    Application Layer
    Presentation Layer
    Entity

    View Slide

  27. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    31
    Persistence Layer
    Domain Layer
    Application Layer
    Presentation Layer
    Response

    View Slide

  28. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    32
    What if
    Entity or API changes?

    View Slide

  29. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    33
    Persistence Layer
    Domain Layer
    Application Layer
    Presentation Layer
    Request

    View Slide

  30. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    33
    Persistence Layer
    Domain Layer
    Application Layer
    Presentation Layer
    DTO

    View Slide

  31. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    33
    Persistence Layer
    Domain Layer
    Application Layer
    Presentation Layer
    Entity

    View Slide

  32. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    34
    Persistence Layer
    Domain Layer
    Application Layer
    Presentation Layer
    DTO

    View Slide

  33. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    34
    Persistence Layer
    Domain Layer
    Application Layer
    Presentation Layer
    Response

    View Slide

  34. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    35
    Domain Model
    is tied to DTO

    View Slide

  35. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    36
    Persistence Layer
    Domain Layer
    Application Layer
    Presentation Layer
    Entity
    Model
    Request /
    Response
    (Input /
    Output) DTO

    View Slide

  36. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    37
    Possible Problems
    !
    Mapping between objects
    can become annoying
    More code/duplication
    “Wrong” layers add complexity

    View Slide

  37. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    38
    Possible Benefits
    $
    Easier extraction of components
    Switching dependencies is easier
    Refactoring is more contained

    View Slide

  38. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    39

    View Slide

  39. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    40
    Output Formatting
    (Dependency) Analysis
    Layer Resolving
    Dependency Resolving
    AST Parsing
    Input Collection

    View Slide

  40. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    41

    View Slide

  41. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    41

    View Slide

  42. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    41

    View Slide

  43. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    42
    nikic/php-parser
    is only used here

    View Slide

  44. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    42
    nikic/php-parser
    is only used here
    Deptrac’s
    own data structure

    View Slide

  45. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    43

    View Slide

  46. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    44

    View Slide

  47. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    45
    No longer contains
    dependency-references

    View Slide

  48. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    46

    View Slide

  49. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    47

    View Slide

  50. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    48

    View Slide

  51. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    49

    View Slide

  52. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    50
    Lesson
    Isolating layers (and their data!) helps
    contain changes and
    makes switching out parts easier
    #

    View Slide

  53. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    51

    View Slide

  54. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    52
    Questions

    View Slide

  55. Architecture decisions and their impact
    Denis Brumann
    @dbrumann
    53
    Thank You
    Have a great conference

    View Slide