Mission (Im)possible: Quality Decoupled Code with Drupal 7 (Singapore PHP user group meetup)

Mission (Im)possible: Quality Decoupled Code with Drupal 7 (Singapore PHP user group meetup)

We're all excited about Drupal 8 coming up soon and we want to be ready for it! How can we make sure our code is ready for it? How can we build modules that are backwards compatible with D7 and future proofed for D8?

Learn how to build code decoupled from your platform and use it with Drupal or any other framework.

Presented at Singapore PHP User Group meetup.

2bd48651cd01e0ca2e0a255a63da77aa?s=128

Marek Matulka

March 08, 2016
Tweet

Transcript

  1. 3.
  2. 4.
  3. 5.
  4. 6.
  5. 8.
  6. 9.
  7. 10.

    In order to create a good software, you have to

    know what the software is all about. – Eric Evans
  8. 17.

    Ubiquitous Language Ubiquitous Language Domain Expert Analyst Tester Developer Developer

    Application Code Acceptance Criteria Specs and documentation
  9. 18.
  10. 19.
  11. 20.
  12. 21.
  13. 24.

    Layered Architecture “High level modules should not depend on lower

    level implementation” – Robert C. Martin User Interface Application Domain Infrastructure
  14. 29.

    Clean Architecture Entities Use Cases Controllers Web Framework Drivers Interface

    Adapters Application Business Rules Enterprise Business Rules
  15. 37.

    Why clean architecture? - your code is clean(er) - decoupled

    from framework - reusable - easy to test
  16. 38.

    Why clean architecture? - your code is clean(er) - decoupled

    from framework - reusable - easy to test - easy to maintain
  17. 39.

    Why clean architecture? - your code is clean(er) - decoupled

    from framework - reusable - easy to test - easy to maintain - easy to change
  18. 40.
  19. 41.
  20. 44.
  21. 45.
  22. 46.
  23. 47.
  24. 48.
  25. 49.
  26. 50.
  27. 59.

    Why write XML? - fetching data from Magento and dumping

    it into xml file is quick - xml can be imported by Drupal’s feed importer
  28. 60.

    Why it didn’t work? - Feed importer was damn slow

    - 10k products imported in 4.5h - Scheduling import with Elysia Cron module was flaky - Scheduled feed importer would add products all over again - resources hungry!
  29. 62.

    Why direct save to the db? - Drupal promises data

    structure won’t ever change - It’s fast - 40k products in 2 minutes - It works!
  30. 69.
  31. 70.