SlideShare a Scribd company logo
1 of 25
Download to read offline
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
The daily work of a [Magento 2] developer consists of two main job types
Debugging
existing features
Creating
new features
Your code
3rd party’s
(or core) code
A B
We will focus on this
Debugging
existing features
Creating
new features
Your code
3rd party’s
(or core) code
A B
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
A SHORT HINT ON: CREATING FEATURES
You will need these thingies:
§ PHPStorm IDE
§ Vagrant (or Docker ?)
§ GIT
§ Magicento2
§ Pestle
§ MSP CodeMonkey
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
A SHORT HINT ON: CREATING FEATURES
Pestle, Magicento 2 and MSP CodeMonkey because:
§ Magento 2 requires a lot of boilerplate code
§ A typo is always lurking somewhere
§ Your time is not free
§ Magento 2 is not always DRY compliant
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
A SHORT HINT ON: CREATING FEATURES
Example of code complexity: Magento 1 vs. Magento 2
Magento 1 – DB Models:
§ Model
§ ResourceModel
§ Collection
§ Install / Upgrade scripts
§ config.xml
Magento 2 – DB Models:
§ Model
§ ResourceModel
§ Collection
§ Install / Upgrade scripts
§ Repository
§ RepositoryInterface
§ ManagementInterface
§ DataInterface
§ Dependency Injection
§ Getters / Setters in DataInterface
§ API Preferences
Total involved files: 4-5 Total involved files: 8-9
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
A SHORT HINT ON: CREATING FEATURES
MSP CodeMonkey can create a whole PSR-2 compliant DB model source code with
API, Interfaces, getters and setters. Just typing:
~$ bin/magento codemonkey:crud My_Module MyModelName my_sql_table
Magicento 2 and Pestle can create controllers, modules, plugins, observers and lots
of other coding entities in few clicks.
Your client does not always understand how complex this job is!
So make it as simple as possible for you because you will not be paid for this!
REMEMBER
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
DEBUGGING
Your code
3rd party’s
(or core) code
DEBUGGING & REVERSE ENGINEERING
are the actual 99% work of a developer
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
DEBUGGING FEATURES
Common scenario when you’re debugging your code:
§ You do not know where the broken piece of code may be.
§ It is very hard to let the client understand that debugging is part
(actually: the most) of developing, so:
§ You probably do not have any of the project’s budget left;
§ Plus, you have a very short time to fix it!
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
DEBUGGING FEATURES
Common scenario when you’re debugging 3rd party’s code:
§ You have no clue about the how the work’s engineered.
§ You still do not know where the broken piece of code is.
§ You hope the programmer who worked on that code before you did not
touch the core.
§ The programmer who created that feature is now probably on permanent
vacation and/or does not speak a single word of your language!
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
HOPE IT’S NOT A
MESS OF
SPAGHETTI CODE
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
“I’ve seen PHP code you people wouldn’t believe…”
DEBUGGING FEATURES
Debugging process can be tricky in Magento 2.
Magento 2 has lots of new ways to intercept and change the standard core behaviour...
(I mean without changing the core! Do not try this at home!)
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
Magento 1 rewriting tools
§ Rewrites
§ Routes hijacking
§ Observers
§ Layout updates
Magento 2 rewriting tools
§ Stackable preferences
§ Routes hijacking
§ Observers
§ Layout updates
§ Stackable plugins (after, before, around)
§ Extension attributes
§ Modifiers pool
DEBUGGING FEATURES
FINDING THE PIECE OF CODE YOU
NEED CAN BE OFTEN CHALLENGING
AND TIME CONSUMING.
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
DEBUGGING FEATURES
So the hard part is simply
FIND SOME PIECE OF CODE DOING SOMETHING SOMEHOW SOMEWHERE
and, once found
FIX SOMETHING BROKEN SOMEWHERE WITH
SOME THING YOU WILL DO SOMEHOW
As easy as pie… isn’t it?
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
DEBUGGING FEATURES
§ PhpStorm as IDE
§ MSP DevTools
§ To find out where the code is
§ PHP Xdebug
§ To find out what’s wrong with the code
§ GIT bisect
§ To find out when you broke it
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
DEBUGGING FEATURES: MSP DEVTOOLS
§ Magento 1 & Magento 2 support
§ Free github project
§ Chrome extension
§ Chrome inspector integration
§ PHPStorm integration
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
DEBUGGING FEATURES
MSP DevTools allows to inspect:
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
§ Blocks
§ Observers
§ Plugins
§ Preferences
§ Design
§ UI Components
§ SQL queries
§ Profiler results
§ ...
DEBUGGING FEATURES: PHP X-DEBUG
§ Suspend code execution
§ Inspect variables
§ Log results
§ Runtime variables value change
§ PHP Storm integrates it
§ You can do the same with “var_dump”, “print_r” and “echo”,
but everytime you do that, a programmer dies somewhere!
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
DEBUGGING FEATURES: GIT BISECT
A typical customer’s bug report is like:
If you manage to understand what is actually broken you can use GIT bisect.
So you just need to know:
§ what the broken features is and
§ when it was working for the last time.
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
“Yesterday all was working on the website, today nothing
works! Fix it!!11!1!!”
DEBUGGING FEATURES: GIT BISECT
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
Works like this
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING)
#mm17it	|	Riccardo	Tempesta
THANK YOU!
KEEP CALM
AND
I WILL ANSWER YOUR QUESTIONS
The right tools for the right job (or: surviving Magento 2 coding)

More Related Content

Viewers also liked

System Administration: Migliorare le performance di Magento CE
System Administration: Migliorare le performance di Magento CESystem Administration: Migliorare le performance di Magento CE
System Administration: Migliorare le performance di Magento CEMageSpecialist
 
System Administration: migliorare le performance di Magento Community Edition
System Administration: migliorare le performance di Magento Community EditionSystem Administration: migliorare le performance di Magento Community Edition
System Administration: migliorare le performance di Magento Community EditionMageSpecialist
 
Networking ICT in salsa E-commerce
Networking ICT in salsa E-commerceNetworking ICT in salsa E-commerce
Networking ICT in salsa E-commerceMageSpecialist
 
Strumenti di automazione in Magento 2
Strumenti di automazione in Magento 2Strumenti di automazione in Magento 2
Strumenti di automazione in Magento 2MageSpecialist
 
MAGENTO 2: Routing e Controllers - Paolo Vecchiocattivi
MAGENTO 2: Routing e Controllers - Paolo VecchiocattiviMAGENTO 2: Routing e Controllers - Paolo Vecchiocattivi
MAGENTO 2: Routing e Controllers - Paolo VecchiocattiviMageSpecialist
 
Meet Magento - the open source that is changing the world of commerce
Meet Magento - the open source that is changing the world of commerceMeet Magento - the open source that is changing the world of commerce
Meet Magento - the open source that is changing the world of commerceKuba Zwolinski
 
E-commerce: perché sì, perché no - Competenze per un e-commerce di successo
E-commerce: perché sì, perché no - Competenze per un e-commerce di successoE-commerce: perché sì, perché no - Competenze per un e-commerce di successo
E-commerce: perché sì, perché no - Competenze per un e-commerce di successoMageSpecialist
 
Code Generation in Magento 2
Code Generation in Magento 2Code Generation in Magento 2
Code Generation in Magento 2Sergii Shymko
 
Magento 2 Changes Overview
Magento 2 Changes OverviewMagento 2 Changes Overview
Magento 2 Changes OverviewSergii Shymko
 
Microservices Using Docker Containers for Magento 2
Microservices Using Docker Containers for Magento 2Microservices Using Docker Containers for Magento 2
Microservices Using Docker Containers for Magento 2Schogini Systems Pvt Ltd
 
Ups and Downs of Real Projects Based on Magento 2
Ups and Downs of Real Projects Based on Magento 2Ups and Downs of Real Projects Based on Magento 2
Ups and Downs of Real Projects Based on Magento 2Max Pronko
 
The journey of mastering Magento 2 for Magento 1 developers
The journey of mastering Magento 2 for Magento 1 developersThe journey of mastering Magento 2 for Magento 1 developers
The journey of mastering Magento 2 for Magento 1 developersGabriel Guarino
 
Magento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | MagenestMagento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | MagenestMagenest
 
Methods and Best Practices for High Performance eCommerce
Methods and Best Practices for High Performance eCommerceMethods and Best Practices for High Performance eCommerce
Methods and Best Practices for High Performance eCommercedmitriysoroka
 
Magento 2 Performance: Every Second Counts
Magento 2 Performance: Every Second CountsMagento 2 Performance: Every Second Counts
Magento 2 Performance: Every Second CountsJoshua Warren
 
Magento 2 Development for PHP Developers
Magento 2 Development for PHP DevelopersMagento 2 Development for PHP Developers
Magento 2 Development for PHP DevelopersJoshua Warren
 
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015Joshua Warren
 
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With ContainersHanoi MagentoMeetup
 

Viewers also liked (19)

System Administration: Migliorare le performance di Magento CE
System Administration: Migliorare le performance di Magento CESystem Administration: Migliorare le performance di Magento CE
System Administration: Migliorare le performance di Magento CE
 
Magento2 shell
Magento2 shellMagento2 shell
Magento2 shell
 
System Administration: migliorare le performance di Magento Community Edition
System Administration: migliorare le performance di Magento Community EditionSystem Administration: migliorare le performance di Magento Community Edition
System Administration: migliorare le performance di Magento Community Edition
 
Networking ICT in salsa E-commerce
Networking ICT in salsa E-commerceNetworking ICT in salsa E-commerce
Networking ICT in salsa E-commerce
 
Strumenti di automazione in Magento 2
Strumenti di automazione in Magento 2Strumenti di automazione in Magento 2
Strumenti di automazione in Magento 2
 
MAGENTO 2: Routing e Controllers - Paolo Vecchiocattivi
MAGENTO 2: Routing e Controllers - Paolo VecchiocattiviMAGENTO 2: Routing e Controllers - Paolo Vecchiocattivi
MAGENTO 2: Routing e Controllers - Paolo Vecchiocattivi
 
Meet Magento - the open source that is changing the world of commerce
Meet Magento - the open source that is changing the world of commerceMeet Magento - the open source that is changing the world of commerce
Meet Magento - the open source that is changing the world of commerce
 
E-commerce: perché sì, perché no - Competenze per un e-commerce di successo
E-commerce: perché sì, perché no - Competenze per un e-commerce di successoE-commerce: perché sì, perché no - Competenze per un e-commerce di successo
E-commerce: perché sì, perché no - Competenze per un e-commerce di successo
 
Code Generation in Magento 2
Code Generation in Magento 2Code Generation in Magento 2
Code Generation in Magento 2
 
Magento 2 Changes Overview
Magento 2 Changes OverviewMagento 2 Changes Overview
Magento 2 Changes Overview
 
Microservices Using Docker Containers for Magento 2
Microservices Using Docker Containers for Magento 2Microservices Using Docker Containers for Magento 2
Microservices Using Docker Containers for Magento 2
 
Ups and Downs of Real Projects Based on Magento 2
Ups and Downs of Real Projects Based on Magento 2Ups and Downs of Real Projects Based on Magento 2
Ups and Downs of Real Projects Based on Magento 2
 
The journey of mastering Magento 2 for Magento 1 developers
The journey of mastering Magento 2 for Magento 1 developersThe journey of mastering Magento 2 for Magento 1 developers
The journey of mastering Magento 2 for Magento 1 developers
 
Magento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | MagenestMagento 2 Theme Trainning for Beginners | Magenest
Magento 2 Theme Trainning for Beginners | Magenest
 
Methods and Best Practices for High Performance eCommerce
Methods and Best Practices for High Performance eCommerceMethods and Best Practices for High Performance eCommerce
Methods and Best Practices for High Performance eCommerce
 
Magento 2 Performance: Every Second Counts
Magento 2 Performance: Every Second CountsMagento 2 Performance: Every Second Counts
Magento 2 Performance: Every Second Counts
 
Magento 2 Development for PHP Developers
Magento 2 Development for PHP DevelopersMagento 2 Development for PHP Developers
Magento 2 Development for PHP Developers
 
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
 
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
 

Similar to The right tools for the right job (or: surviving Magento 2 coding)

Riccardo Tempesta - The right tools for the right job (or: surviving Magento ...
Riccardo Tempesta - The right tools for the right job (or: surviving Magento ...Riccardo Tempesta - The right tools for the right job (or: surviving Magento ...
Riccardo Tempesta - The right tools for the right job (or: surviving Magento ...Meet Magento Italy
 
Magento 2: New and Innovative? - php[world] 2015
Magento 2: New and Innovative? - php[world] 2015Magento 2: New and Innovative? - php[world] 2015
Magento 2: New and Innovative? - php[world] 2015David Alger
 
How to migrate from Magento 1 to Magento 2
How to migrate from Magento 1 to Magento 2How to migrate from Magento 1 to Magento 2
How to migrate from Magento 1 to Magento 2Matthias Glitzner-Zeis
 
[CB20] DeClang: Anti-hacking compiler by Mengyuan Wan
[CB20] DeClang: Anti-hacking compiler by Mengyuan Wan[CB20] DeClang: Anti-hacking compiler by Mengyuan Wan
[CB20] DeClang: Anti-hacking compiler by Mengyuan WanCODE BLUE
 
Consequences of using the Copy-Paste method in C++ programming and how to dea...
Consequences of using the Copy-Paste method in C++ programming and how to dea...Consequences of using the Copy-Paste method in C++ programming and how to dea...
Consequences of using the Copy-Paste method in C++ programming and how to dea...Andrey Karpov
 
Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1David Amend
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentAbid Malik
 
Oh the compilers you'll build
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll buildMark Stoodley
 
Make implementation of third party elements in magento 2 in 5-times easier
Make implementation of third party elements in magento 2 in 5-times easierMake implementation of third party elements in magento 2 in 5-times easier
Make implementation of third party elements in magento 2 in 5-times easierElena Kulbich
 
Migrating from Magento 1 to Magento 2 @ Magento Meetup Wien
Migrating from Magento 1 to Magento 2 @ Magento Meetup WienMigrating from Magento 1 to Magento 2 @ Magento Meetup Wien
Migrating from Magento 1 to Magento 2 @ Magento Meetup WienMatthias Glitzner-Zeis
 
Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)Will Huang
 
Code Difference Visualization by a Call Tree
Code Difference Visualization by a Call TreeCode Difference Visualization by a Call Tree
Code Difference Visualization by a Call TreeKamiya Toshihiro
 
XSS Countermeasures in Grails
XSS Countermeasures in GrailsXSS Countermeasures in Grails
XSS Countermeasures in GrailsOSOCO
 
XSS Countermeasures in Grails
XSS Countermeasures in GrailsXSS Countermeasures in Grails
XSS Countermeasures in Grailstheratpack
 
Awesome Architectures in Magento 2.3
Awesome Architectures in Magento 2.3Awesome Architectures in Magento 2.3
Awesome Architectures in Magento 2.3Riccardo Tempesta
 
Symfony2 as an api
Symfony2 as an apiSymfony2 as an api
Symfony2 as an apiKifah Abbad
 

Similar to The right tools for the right job (or: surviving Magento 2 coding) (20)

Riccardo Tempesta - The right tools for the right job (or: surviving Magento ...
Riccardo Tempesta - The right tools for the right job (or: surviving Magento ...Riccardo Tempesta - The right tools for the right job (or: surviving Magento ...
Riccardo Tempesta - The right tools for the right job (or: surviving Magento ...
 
Magento 2: New and Innovative? - php[world] 2015
Magento 2: New and Innovative? - php[world] 2015Magento 2: New and Innovative? - php[world] 2015
Magento 2: New and Innovative? - php[world] 2015
 
How to migrate from Magento 1 to Magento 2
How to migrate from Magento 1 to Magento 2How to migrate from Magento 1 to Magento 2
How to migrate from Magento 1 to Magento 2
 
[CB20] DeClang: Anti-hacking compiler by Mengyuan Wan
[CB20] DeClang: Anti-hacking compiler by Mengyuan Wan[CB20] DeClang: Anti-hacking compiler by Mengyuan Wan
[CB20] DeClang: Anti-hacking compiler by Mengyuan Wan
 
Consequences of using the Copy-Paste method in C++ programming and how to dea...
Consequences of using the Copy-Paste method in C++ programming and how to dea...Consequences of using the Copy-Paste method in C++ programming and how to dea...
Consequences of using the Copy-Paste method in C++ programming and how to dea...
 
Rebuilding our Foundation
Rebuilding our FoundationRebuilding our Foundation
Rebuilding our Foundation
 
Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1
 
IDE and Toolset For Magento Development
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
 
Oh the compilers you'll build
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll build
 
Make implementation of third party elements in magento 2 in 5-times easier
Make implementation of third party elements in magento 2 in 5-times easierMake implementation of third party elements in magento 2 in 5-times easier
Make implementation of third party elements in magento 2 in 5-times easier
 
Migrating from Magento 1 to Magento 2 @ Magento Meetup Wien
Migrating from Magento 1 to Magento 2 @ Magento Meetup WienMigrating from Magento 1 to Magento 2 @ Magento Meetup Wien
Migrating from Magento 1 to Magento 2 @ Magento Meetup Wien
 
Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)Protractor: The Hacker way (NG-MY 2019)
Protractor: The Hacker way (NG-MY 2019)
 
Code Difference Visualization by a Call Tree
Code Difference Visualization by a Call TreeCode Difference Visualization by a Call Tree
Code Difference Visualization by a Call Tree
 
XSS Countermeasures in Grails
XSS Countermeasures in GrailsXSS Countermeasures in Grails
XSS Countermeasures in Grails
 
XSS Countermeasures in Grails
XSS Countermeasures in GrailsXSS Countermeasures in Grails
XSS Countermeasures in Grails
 
XSS Countermeasures in Grails
XSS Countermeasures in GrailsXSS Countermeasures in Grails
XSS Countermeasures in Grails
 
Magento 2 development
Magento 2 developmentMagento 2 development
Magento 2 development
 
Awesome Architectures in Magento 2.3
Awesome Architectures in Magento 2.3Awesome Architectures in Magento 2.3
Awesome Architectures in Magento 2.3
 
Symfony2 as an api
Symfony2 as an apiSymfony2 as an api
Symfony2 as an api
 
Compiler tricks
Compiler tricksCompiler tricks
Compiler tricks
 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
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 CCTVshikhaohhpro
 
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..pdfPearlKirahMaeRagusta1
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
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 AidPhilip Schwarz
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
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.pdfryanfarris8
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
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
 
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
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
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
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
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 Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 

The right tools for the right job (or: surviving Magento 2 coding)

  • 1.
  • 2. THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta The daily work of a [Magento 2] developer consists of two main job types Debugging existing features Creating new features Your code 3rd party’s (or core) code A B
  • 3. We will focus on this Debugging existing features Creating new features Your code 3rd party’s (or core) code A B THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 4. A SHORT HINT ON: CREATING FEATURES You will need these thingies: § PHPStorm IDE § Vagrant (or Docker ?) § GIT § Magicento2 § Pestle § MSP CodeMonkey THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 5. A SHORT HINT ON: CREATING FEATURES Pestle, Magicento 2 and MSP CodeMonkey because: § Magento 2 requires a lot of boilerplate code § A typo is always lurking somewhere § Your time is not free § Magento 2 is not always DRY compliant THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 6. A SHORT HINT ON: CREATING FEATURES Example of code complexity: Magento 1 vs. Magento 2 Magento 1 – DB Models: § Model § ResourceModel § Collection § Install / Upgrade scripts § config.xml Magento 2 – DB Models: § Model § ResourceModel § Collection § Install / Upgrade scripts § Repository § RepositoryInterface § ManagementInterface § DataInterface § Dependency Injection § Getters / Setters in DataInterface § API Preferences Total involved files: 4-5 Total involved files: 8-9 THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 7. A SHORT HINT ON: CREATING FEATURES MSP CodeMonkey can create a whole PSR-2 compliant DB model source code with API, Interfaces, getters and setters. Just typing: ~$ bin/magento codemonkey:crud My_Module MyModelName my_sql_table Magicento 2 and Pestle can create controllers, modules, plugins, observers and lots of other coding entities in few clicks. Your client does not always understand how complex this job is! So make it as simple as possible for you because you will not be paid for this! REMEMBER THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 8. DEBUGGING Your code 3rd party’s (or core) code DEBUGGING & REVERSE ENGINEERING are the actual 99% work of a developer THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 9. DEBUGGING FEATURES Common scenario when you’re debugging your code: § You do not know where the broken piece of code may be. § It is very hard to let the client understand that debugging is part (actually: the most) of developing, so: § You probably do not have any of the project’s budget left; § Plus, you have a very short time to fix it! THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 10. DEBUGGING FEATURES Common scenario when you’re debugging 3rd party’s code: § You have no clue about the how the work’s engineered. § You still do not know where the broken piece of code is. § You hope the programmer who worked on that code before you did not touch the core. § The programmer who created that feature is now probably on permanent vacation and/or does not speak a single word of your language! THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 11. HOPE IT’S NOT A MESS OF SPAGHETTI CODE THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta “I’ve seen PHP code you people wouldn’t believe…”
  • 12. DEBUGGING FEATURES Debugging process can be tricky in Magento 2. Magento 2 has lots of new ways to intercept and change the standard core behaviour... (I mean without changing the core! Do not try this at home!) THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta Magento 1 rewriting tools § Rewrites § Routes hijacking § Observers § Layout updates Magento 2 rewriting tools § Stackable preferences § Routes hijacking § Observers § Layout updates § Stackable plugins (after, before, around) § Extension attributes § Modifiers pool
  • 13. DEBUGGING FEATURES FINDING THE PIECE OF CODE YOU NEED CAN BE OFTEN CHALLENGING AND TIME CONSUMING. THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 14. DEBUGGING FEATURES So the hard part is simply FIND SOME PIECE OF CODE DOING SOMETHING SOMEHOW SOMEWHERE and, once found FIX SOMETHING BROKEN SOMEWHERE WITH SOME THING YOU WILL DO SOMEHOW As easy as pie… isn’t it? THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 15. DEBUGGING FEATURES § PhpStorm as IDE § MSP DevTools § To find out where the code is § PHP Xdebug § To find out what’s wrong with the code § GIT bisect § To find out when you broke it THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 16. DEBUGGING FEATURES: MSP DEVTOOLS § Magento 1 & Magento 2 support § Free github project § Chrome extension § Chrome inspector integration § PHPStorm integration THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 17. DEBUGGING FEATURES MSP DevTools allows to inspect: THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta § Blocks § Observers § Plugins § Preferences § Design § UI Components § SQL queries § Profiler results § ...
  • 18. DEBUGGING FEATURES: PHP X-DEBUG § Suspend code execution § Inspect variables § Log results § Runtime variables value change § PHP Storm integrates it § You can do the same with “var_dump”, “print_r” and “echo”, but everytime you do that, a programmer dies somewhere! THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 19.
  • 20. DEBUGGING FEATURES: GIT BISECT A typical customer’s bug report is like: If you manage to understand what is actually broken you can use GIT bisect. So you just need to know: § what the broken features is and § when it was working for the last time. THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta “Yesterday all was working on the website, today nothing works! Fix it!!11!1!!”
  • 21. DEBUGGING FEATURES: GIT BISECT THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta Works like this
  • 22.
  • 23. THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta
  • 24. THE RIGHT TOOLS FOR THE RIGHT JOB (OR: SURVIVING MAGENTO 2 CODING) #mm17it | Riccardo Tempesta THANK YOU! KEEP CALM AND I WILL ANSWER YOUR QUESTIONS