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

Framework agnostic is not a rocket science

Framework agnostic is not a rocket science

Would you like to upgrade the framework/database/etc or even change it, but, it seems impossible due to high coupling?
Do you and your peers think about rewriting the project from scratch, again?

Grab a drink and participate in my talk where I will show you how to fix that! After this talk, you will know the following:
- How to write a project that can survive many years without rewriting it from scratch
- How to write framework-agnostic code
- How to write easily testable code
- What is ports and adapters architecture

Damian Dziaduch

September 26, 2023
Tweet

More Decks by Damian Dziaduch

Other Decks in Programming

Transcript

  1. • public speaker • software engineer @Printify • before •

    @GetResponse • @ATG.auto • enjoying • TDD • architecture Who am I
  2. Agenda • What is a framework agnostic approach? • Why

    you should do it? • What it gives you? • How are we doing it?
  3. A framework-agnostic approach refers to developing software in a way

    that minimises dependencies on a specific framework
  4. • Separation of concerns, domain is separated from storage, presentation

    etc • Tests that are fast and easy to write • Services (use cases) reusability The benefits
  5. • Drivers penalty points system in Poland (simpli fi ed)

    • 20 penalty points limit for fresh drivers (exam passed less than 1 year ago) • 24 penalty points limit for rest • Penalty is valid 2 years - this period is counted from the date of the payment • Driver can pay on the spot or later • You go to jail if last penalty exceeds the limit The domain
  6. “It aims at creating loosely coupled application components that can

    be easily connected to their software environment by means of ports and adapters. This makes components exchangeable at any level and facilitates test automation.” Ports and Adapters architecture
  7. GetDriverFile StoreDriverFile In memory adapter Mock adapter Mock adapter Domain

    Application In memory adapter https://github.com/ddziaduch/penalty-points/tree/application
  8. PayPenalty GetDriverFile StoreDriverFile Im posePenalty In memory adapter Mock adapter

    Mock adapter Domain Application In memory adapter https://github.com/ddziaduch/penalty-points/tree/application
  9. PayPenalty GetDriverFile StoreDriverFile Im posePenalty Test adapter HTTP adapter Test

    adapter CLI adapter HTTP adapter In memory adapter Mock adapter Mock adapter Domain Application In memory adapter https://github.com/ddziaduch/penalty-points/tree/adapters
  10. Summary • A framework-agnostic approach refers to developing software in

    a way that minimises dependencies on a speci fi c framework • Separation of concerns, domain is separated from storage, presentation etc • Tests that are fast and easy to write • Services (use cases) reusability • We are doing it via Ports and Adapters
  11. PRINTIFY • CI/CD, distributed systems • Learning budget & time

    • Paid holidays, vacations and sickness • MacBooks • Salary in EURO • Stock options WE ARE HIRING!
  12. • Rate my talk • https://github.com/ddziaduch/penalty- points • @ddziaduch •

    https://damian.dziaduch.pl • https://speakerdeck.com/ddziaduch Thank you!