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

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
  2. Denis Brumann Solutions Architect Current Maintainer of Deptrac [email protected] @dbrumann

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

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

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

    application is Deptrac?
  6. None
  7. None
  8. None
  9. Web apps and APIs https://my-app.com/ MyApp DB MyApp

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

    DB Foo DB MyApp
  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
  12. Warning Signs Services creating other services (usage of new in

    code) Service Locator or factory-usage Config-objects (or arrays) being passed through
  13. None
  14. None
  15. None
  16. Possible Problems Runtime errors (invalid context, misconfigured services) Debugging is

    more difficult (which service/config was used?) More coupling & complexity
  17. None
  18. Lesson Avoid creating/configuring services at runtime

  19. None
  20. None
  21. None
  22. None
  23. None
  24. None
  25. None
  26. None
  27. nikic/php-parser is only used here

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

  29. None
  30. None
  31. None
  32. No longer contains dependency-references

  33. None
  34. None
  35. Possible Benefits Switching dependencies is easier Refactoring is more contained

    Easier extraction
  36. None
  37. None
  38. None
  39. Possible Problems Mapping between objects can become annoying More code/duplication

    “Wrong” layers add complexity
  40. Lesson Isolating layers helps contain changes and makes switching out

    parts easier