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

Mission (Im)possible: Quality Decoupled Code wi...

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.

Marek Matulka

March 08, 2016
Tweet

More Decks by Marek Matulka

Other Decks in Programming

Transcript

  1. In order to create a good software, you have to

    know what the software is all about. – Eric Evans
  2. Ubiquitous Language Ubiquitous Language Domain Expert Analyst Tester Developer Developer

    Application Code Acceptance Criteria Specs and documentation
  3. Layered Architecture “High level modules should not depend on lower

    level implementation” – Robert C. Martin User Interface Application Domain Infrastructure
  4. Clean Architecture Entities Use Cases Controllers Web Framework Drivers Interface

    Adapters Application Business Rules Enterprise Business Rules
  5. Why clean architecture? - your code is clean(er) - decoupled

    from framework - reusable - easy to test
  6. Why clean architecture? - your code is clean(er) - decoupled

    from framework - reusable - easy to test - easy to maintain
  7. Why clean architecture? - your code is clean(er) - decoupled

    from framework - reusable - easy to test - easy to maintain - easy to change
  8. Why write XML? - fetching data from Magento and dumping

    it into xml file is quick - xml can be imported by Drupal’s feed importer
  9. 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!
  10. Why direct save to the db? - Drupal promises data

    structure won’t ever change - It’s fast - 40k products in 2 minutes - It works!