$30 off During Our Annual Pro Sale. View Details »

Architectural decisions and their impact

Architectural decisions and their impact

There are quite a few talks out there explaining architectural patterns, but it is harder to find examples from actual projects and more specifically, making architectural changes in an existing project.

This talk aims to fill this gap by showing how two major architectural problems were identified, how the impacted the code and finally what we changed and how it improved the code. Since we use an open source project for this, you can even follow along by checking out the old versions, looking at the pull requests and obviously the current state for the result.

Denis Brumann

November 10, 2022
Tweet

More Decks by Denis Brumann

Other Decks in Programming

Transcript

  1. Architektur-
    entscheidungen
    und ihre Folgen
    The Good
    The Bad
    The Ugly

    View Slide

  2. Denis Brumann
    Solutions Architect
    Current Maintainer of Deptrac
    [email protected]
    @dbrumann

    View Slide

  3. Command Line
    API Web App
    What kind of application is Deptrac?

    View Slide

  4. Command Line
    API Web App
    What kind of application is Deptrac?

    View Slide

  5. Command Line
    API Web App
    Interactive
    Non-Interactive
    What kind of application is Deptrac?

    View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. Web apps and APIs
    https://my-app.com/
    MyApp DB
    MyApp

    View Slide

  10. https://foo.my-app.com/
    Interactive runtime in web apps and APIs
    https://acme.my-app.com/ ACME DB
    Foo DB
    MyApp

    View Slide

  11. https://foo.my-app.com/
    Interactive runtime in web apps and APIs
    https://acme.my-app.com/ ACME DB
    Foo DB
    MyApp
    Tenant-Aware
    Multi-Portal

    View Slide

  12. 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

  13. View Slide

  14. View Slide

  15. View Slide

  16. Possible Problems
    Runtime errors (invalid context,
    misconfigured services)
    Debugging is more difficult
    (which service/config was used?)
    More coupling & complexity

    View Slide

  17. View Slide

  18. Lesson
    Avoid creating/configuring services at runtime

    View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. View Slide

  27. nikic/php-parser
    is only used here

    View Slide

  28. nikic/php-parser
    is only used here
    Deptrac’s
    own structure

    View Slide

  29. View Slide

  30. View Slide

  31. View Slide

  32. No longer contains
    dependency-references

    View Slide

  33. View Slide

  34. View Slide

  35. Possible Benefits
    Switching dependencies is easier
    Refactoring is more contained
    Easier extraction

    View Slide

  36. View Slide

  37. View Slide

  38. View Slide

  39. Possible Problems
    Mapping between objects
    can become annoying
    More code/duplication
    “Wrong” layers add complexity

    View Slide

  40. Lesson
    Isolating layers helps contain changes
    and makes switching out parts easier

    View Slide