SlideShare a Scribd company logo
1 of 28
Develop a Drupal 7 project 
with Drupal 8 in mind 
Joeri van Dooren
WHOAMI 
Who Am I 
Joeri van Dooren 
Technical Coach @ SAGA Consulting Group 
@Ozmodiar 
https://www.drupal.org/u/ozmodiar
SAGA Consulting Group
Context 
• Long life span 
• A lot of custom code 
• A lot of developers 
• Drupal 8 vs Drupal 7
Challenges 
• Migration of custom code to D8 
• External libraries 
• “Big project syndrome”
Code sample: D7
Setup 
The problems… 
• Unreadable 
• Unmaintainable 
• Not testable (enough) 
• Not upgradable 
Vanilla Drupal 7 
Object Oriented Code
Setup 
Vanilla Drupal 7 
What have we done? 
• xautoload module 
• Drupal 8 class structure 
Object Oriented Code
Code sample: OO
Setup 
The problems… 
• Always re-instantiating 
classes 
• Not very maintainable 
• Not the D8 way 
Vanilla Drupal 7 
Object Oriented Code 
Dependency Injection
Setup 
Vanilla Drupal 7 
Object Oriented Code 
Dependency Injection 
What have we done?
Code sample: DI
Setup 
This is better, but… 
• Still not very readable 
• Not flexible enough 
• More D8 style, but… 
• D8 has a better solution 
Vanilla Drupal 7 
Object Oriented Code 
Dependency Injection 
Container
Vanilla Drupal 7 
Setup 
Object Oriented Code 
Dependency Injection 
Container 
What have we done? 
• Custom module 
• Symfony Container 
• D8 uses that too! 
• Copy paste library 
• xautoload module
Code sample: Container
Setup 
This is way better but… 
• Bad library maintenance 
• D8 has a better solution! 
Vanilla Drupal 7 
Object Oriented Code 
Dependency Injection 
Container 
Dependency Manager
Vanilla Drupal 7 
Setup 
Object Oriented Code 
Dependency Injection 
Container 
Dependency Manager 
What have we done? 
• Introduced Composer 
• Better library 
management 
• Libraries not in VCS 
• Drupal 8 uses that too!
Composer 
• Package Manager 
• Packagist.org or other VCS 
• composer.json 
• Vendor folder 
• Autoloading
Code sample: Composer
Setup 
Vanilla Drupal 7 
Object Oriented Code 
Dependency Injection 
Container 
Dependency Manager
Achievements 
• Easy external libraries 
• More Drupal 8 compliant 
• Object Oriented 
• Module structure 
• DI with Symfony Container 
• Less steep learning curve for D8 module dev
Extra advantages 
• Readability 
• Maintainability 
• Extensibility 
• Easy debugging 
• Better testing 
• We got off the island (in D7!)
Points of attention 
• Developers need a new mindset 
• Work around D7 limitations 
• Different code reviews
The next level 
• Run your own Packagist (or Satis) 
• Write your own interfaces to improve code 
reviews 
• Write modules as libraries with a Drupal 
module as adapter
More info 
Getting started 
http://www.saga.be/dic 
Extras 
http://youtu.be/GF0EWdsPfZ4 (dependency Injection) 
https://getcomposer.org 
http://symfony.com/doc/current/book/service_container.html
Want to know more? 
Visit SAGA at our booth
Want to know more? 
Tomorrow, because now:
Questions?

More Related Content

What's hot

1st Chinaonrails Open Course
1st Chinaonrails Open Course1st Chinaonrails Open Course
1st Chinaonrails Open Course
Jesse Cai
 
WebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page AppsWebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page Apps
Pop Apps
 
AppeX and JavaScript Support Enhancements in Cincom Smalltalk
AppeX and JavaScript Support Enhancements in Cincom SmalltalkAppeX and JavaScript Support Enhancements in Cincom Smalltalk
AppeX and JavaScript Support Enhancements in Cincom Smalltalk
ESUG
 

What's hot (20)

About javascript libraries
About javascript librariesAbout javascript libraries
About javascript libraries
 
Binding Objective-C Libraries in Xamarin.iOS
Binding Objective-C Libraries in Xamarin.iOSBinding Objective-C Libraries in Xamarin.iOS
Binding Objective-C Libraries in Xamarin.iOS
 
Oop principles
Oop principlesOop principles
Oop principles
 
EPUB for Website Producers
EPUB for Website ProducersEPUB for Website Producers
EPUB for Website Producers
 
Olympya web-tools 2011
Olympya web-tools 2011Olympya web-tools 2011
Olympya web-tools 2011
 
Html5
Html5Html5
Html5
 
Web Tools report
Web Tools reportWeb Tools report
Web Tools report
 
Introduction to portable class libraries
Introduction to portable class librariesIntroduction to portable class libraries
Introduction to portable class libraries
 
NOLOH PHP Framework - Unified Server-Side Development
NOLOH PHP Framework - Unified Server-Side DevelopmentNOLOH PHP Framework - Unified Server-Side Development
NOLOH PHP Framework - Unified Server-Side Development
 
Upgrading to Drupal 8: Benefits and Gotchas
Upgrading to Drupal 8: Benefits and GotchasUpgrading to Drupal 8: Benefits and Gotchas
Upgrading to Drupal 8: Benefits and Gotchas
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016
 
Drupal 8 introduction
Drupal 8 introductionDrupal 8 introduction
Drupal 8 introduction
 
1st Chinaonrails Open Course
1st Chinaonrails Open Course1st Chinaonrails Open Course
1st Chinaonrails Open Course
 
Best PHP Frameworks
Best PHP FrameworksBest PHP Frameworks
Best PHP Frameworks
 
PHP framework difference
PHP framework differencePHP framework difference
PHP framework difference
 
Feature folders
Feature foldersFeature folders
Feature folders
 
WebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page AppsWebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page Apps
 
Version Control, Writers, and Workflows
Version Control, Writers, and WorkflowsVersion Control, Writers, and Workflows
Version Control, Writers, and Workflows
 
PHP Framework
PHP FrameworkPHP Framework
PHP Framework
 
AppeX and JavaScript Support Enhancements in Cincom Smalltalk
AppeX and JavaScript Support Enhancements in Cincom SmalltalkAppeX and JavaScript Support Enhancements in Cincom Smalltalk
AppeX and JavaScript Support Enhancements in Cincom Smalltalk
 

Viewers also liked

In-vitro-anti-cholinesterase-activities-by-piperine-an-alkaloid-from-the-spic...
In-vitro-anti-cholinesterase-activities-by-piperine-an-alkaloid-from-the-spic...In-vitro-anti-cholinesterase-activities-by-piperine-an-alkaloid-from-the-spic...
In-vitro-anti-cholinesterase-activities-by-piperine-an-alkaloid-from-the-spic...
Abigail Coleman
 
Formato de reporte de practica
Formato de reporte de practicaFormato de reporte de practica
Formato de reporte de practica
flotardk10
 
Kas dan Rekening Giro & Investasi Jangka pendek
Kas dan Rekening Giro & Investasi Jangka pendekKas dan Rekening Giro & Investasi Jangka pendek
Kas dan Rekening Giro & Investasi Jangka pendek
Nickthereal
 

Viewers also liked (14)

Informática
InformáticaInformática
Informática
 
wir haben die monstars - ingifts
wir haben die monstars - ingiftswir haben die monstars - ingifts
wir haben die monstars - ingifts
 
In-vitro-anti-cholinesterase-activities-by-piperine-an-alkaloid-from-the-spic...
In-vitro-anti-cholinesterase-activities-by-piperine-an-alkaloid-from-the-spic...In-vitro-anti-cholinesterase-activities-by-piperine-an-alkaloid-from-the-spic...
In-vitro-anti-cholinesterase-activities-by-piperine-an-alkaloid-from-the-spic...
 
Deportes
DeportesDeportes
Deportes
 
Formato de reporte de practica
Formato de reporte de practicaFormato de reporte de practica
Formato de reporte de practica
 
Biotecnologia
BiotecnologiaBiotecnologia
Biotecnologia
 
Bollywood Hollywood
Bollywood HollywoodBollywood Hollywood
Bollywood Hollywood
 
Spring 2015 Update Packet
Spring 2015 Update PacketSpring 2015 Update Packet
Spring 2015 Update Packet
 
Guía transporte acuático
Guía transporte acuáticoGuía transporte acuático
Guía transporte acuático
 
Kas dan Rekening Giro & Investasi Jangka pendek
Kas dan Rekening Giro & Investasi Jangka pendekKas dan Rekening Giro & Investasi Jangka pendek
Kas dan Rekening Giro & Investasi Jangka pendek
 
Herramientas de complejidad para el futuro sostenible de la vida en el desierto
Herramientas de complejidad para el futuro sostenible de la vida en el desiertoHerramientas de complejidad para el futuro sostenible de la vida en el desierto
Herramientas de complejidad para el futuro sostenible de la vida en el desierto
 
Html5
Html5Html5
Html5
 
Advanced Cojure Microservices
Advanced Cojure MicroservicesAdvanced Cojure Microservices
Advanced Cojure Microservices
 
India - Globalisation
India - GlobalisationIndia - Globalisation
India - Globalisation
 

Similar to DrupalCamp Ghent 2014 - Developing Drupal 7 with Drupal 8 in mind

How to guarantee your change is integrated to Moodle core
How to guarantee your change is integrated to Moodle coreHow to guarantee your change is integrated to Moodle core
How to guarantee your change is integrated to Moodle core
Dan Poltawski
 

Similar to DrupalCamp Ghent 2014 - Developing Drupal 7 with Drupal 8 in mind (20)

Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
 
Drupal 8 deeper dive
Drupal 8 deeper diveDrupal 8 deeper dive
Drupal 8 deeper dive
 
How Not to Be Conned by Your Drupal Vendor!
How Not to Be Conned by Your Drupal Vendor!How Not to Be Conned by Your Drupal Vendor!
How Not to Be Conned by Your Drupal Vendor!
 
Bootstrap + Drupal Commerce in less than 45 minutes!
Bootstrap + Drupal Commerce in less than 45 minutes!Bootstrap + Drupal Commerce in less than 45 minutes!
Bootstrap + Drupal Commerce in less than 45 minutes!
 
Gradle.Enemy at the gates
Gradle.Enemy at the gatesGradle.Enemy at the gates
Gradle.Enemy at the gates
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 
Drupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 versionDrupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 version
 
Gradle 2.breaking stereotypes.
Gradle 2.breaking stereotypes.Gradle 2.breaking stereotypes.
Gradle 2.breaking stereotypes.
 
Agile sites2
Agile sites2Agile sites2
Agile sites2
 
Using Grunt with Drupal
Using Grunt with DrupalUsing Grunt with Drupal
Using Grunt with Drupal
 
Developing Complex WordPress Sites without Fear of Failure (with MVC)
Developing Complex WordPress Sites without Fear of Failure (with MVC)Developing Complex WordPress Sites without Fear of Failure (with MVC)
Developing Complex WordPress Sites without Fear of Failure (with MVC)
 
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
 
Dipping Your Toe into Drupal 8 Module Development
Dipping Your Toe into Drupal 8 Module DevelopmentDipping Your Toe into Drupal 8 Module Development
Dipping Your Toe into Drupal 8 Module Development
 
Staging and Deployment
Staging and DeploymentStaging and Deployment
Staging and Deployment
 
Using Features
Using FeaturesUsing Features
Using Features
 
Drupal Webinar: Ignite and Accelerate Your Drupal 7 to Drupal 9 Migration
Drupal Webinar: Ignite and Accelerate Your Drupal 7 to Drupal 9 MigrationDrupal Webinar: Ignite and Accelerate Your Drupal 7 to Drupal 9 Migration
Drupal Webinar: Ignite and Accelerate Your Drupal 7 to Drupal 9 Migration
 
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
 
Your first d8 module
Your first d8 moduleYour first d8 module
Your first d8 module
 
How to guarantee your change is integrated to Moodle core
How to guarantee your change is integrated to Moodle coreHow to guarantee your change is integrated to Moodle core
How to guarantee your change is integrated to Moodle core
 
Untying the Knots of Web Dev with Internet Explorer
Untying the Knots of Web Dev with Internet Explorer Untying the Knots of Web Dev with Internet Explorer
Untying the Knots of Web Dev with Internet Explorer
 

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Recently uploaded (20)

VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 

DrupalCamp Ghent 2014 - Developing Drupal 7 with Drupal 8 in mind

  • 1. Develop a Drupal 7 project with Drupal 8 in mind Joeri van Dooren
  • 2. WHOAMI Who Am I Joeri van Dooren Technical Coach @ SAGA Consulting Group @Ozmodiar https://www.drupal.org/u/ozmodiar
  • 4. Context • Long life span • A lot of custom code • A lot of developers • Drupal 8 vs Drupal 7
  • 5. Challenges • Migration of custom code to D8 • External libraries • “Big project syndrome”
  • 7. Setup The problems… • Unreadable • Unmaintainable • Not testable (enough) • Not upgradable Vanilla Drupal 7 Object Oriented Code
  • 8. Setup Vanilla Drupal 7 What have we done? • xautoload module • Drupal 8 class structure Object Oriented Code
  • 10. Setup The problems… • Always re-instantiating classes • Not very maintainable • Not the D8 way Vanilla Drupal 7 Object Oriented Code Dependency Injection
  • 11. Setup Vanilla Drupal 7 Object Oriented Code Dependency Injection What have we done?
  • 13. Setup This is better, but… • Still not very readable • Not flexible enough • More D8 style, but… • D8 has a better solution Vanilla Drupal 7 Object Oriented Code Dependency Injection Container
  • 14. Vanilla Drupal 7 Setup Object Oriented Code Dependency Injection Container What have we done? • Custom module • Symfony Container • D8 uses that too! • Copy paste library • xautoload module
  • 16. Setup This is way better but… • Bad library maintenance • D8 has a better solution! Vanilla Drupal 7 Object Oriented Code Dependency Injection Container Dependency Manager
  • 17. Vanilla Drupal 7 Setup Object Oriented Code Dependency Injection Container Dependency Manager What have we done? • Introduced Composer • Better library management • Libraries not in VCS • Drupal 8 uses that too!
  • 18. Composer • Package Manager • Packagist.org or other VCS • composer.json • Vendor folder • Autoloading
  • 20. Setup Vanilla Drupal 7 Object Oriented Code Dependency Injection Container Dependency Manager
  • 21. Achievements • Easy external libraries • More Drupal 8 compliant • Object Oriented • Module structure • DI with Symfony Container • Less steep learning curve for D8 module dev
  • 22. Extra advantages • Readability • Maintainability • Extensibility • Easy debugging • Better testing • We got off the island (in D7!)
  • 23. Points of attention • Developers need a new mindset • Work around D7 limitations • Different code reviews
  • 24. The next level • Run your own Packagist (or Satis) • Write your own interfaces to improve code reviews • Write modules as libraries with a Drupal module as adapter
  • 25. More info Getting started http://www.saga.be/dic Extras http://youtu.be/GF0EWdsPfZ4 (dependency Injection) https://getcomposer.org http://symfony.com/doc/current/book/service_container.html
  • 26. Want to know more? Visit SAGA at our booth
  • 27. Want to know more? Tomorrow, because now:

Editor's Notes

  1. - Inactivity…
  2. 5 business units IT projects -> custom projects in Drupal for tourist organisations Online Communication -> websites in Drupal (and other technologies)
  3. Big project More than a year ago
  4. -
  5. Maintainability: Classname veranderen = overal aanpassen door heel de code
  6. Maintainability: Classname veranderen = overal aanpassen door heel de code
  7. - Put very simple: Box full of references to classes that contain business logic, refered to as “services”.
  8. Todo overwegen nadelen voor voordelen