SlideShare a Scribd company logo
1 of 36
Download to read offline
INTRO TO MAGENTO 2
LET’S BUILD A MODULE!
INTRO TO MAGENTO 2
WHAT IS MAGENTO?
▸ Magento is an Open Source E-commerce platform that is
available in two editions
▸ Community - Free to use, somewhat limited feature set
▸ Enterprise - Licensed on a sales volume basis, has more
advanced features out of the box
▸ Both editions are completely extendable/modify-able
MAGENTO
SOME COOL FACTS:
COMPOSER
INSTALLATION AND UPDATES
ARE ALL AUTOMATICALLY
PULLED FROM MAGENTO’S REPO
CLIbin/magento
INTRO TO MAGENTO 2 SWAGGER IS INCLUDED!
INSTALLATION
INTRO TO MAGENTO2
INSTALLATION
Source: http://devdocs.magento.com/guides/v2.1/install-gde/prereq/integrator_install_ce.html
Or…. Install into your own environment with Composer!
Admin Interface
DESIGN PATTERNS
& PRINCIPLES
INTRO TO MAGENTO 2
OUT WITH THE MVC, IN WITH THE MVVM!
▸ Model - handles all CRUD operations using Resource
Models and Collections
▸ View - template files that interact with a View Model ONLY
▸ View Model - A block object that will do any
programmatic reading of the CRUD models, request
objects, external systems, etc.
INTRO TO MAGENTO 2
SOLID PRINCIPLES
▸ S - Single Responsibility Principle
▸ A class should have one, and only one, reason to change.
▸ O - Open Closed Principle
▸ You should be able to extend a classes behavior, without modifying it.
▸ L - Liskov Substitution Principle
▸ Derived classes must be substitutable for their base classes.
▸ I - Interface Segregation Principle
▸ Make fine grained interfaces that are client specific.
▸ D - Dependency Inversion Principle
▸ Depend on abstractions, not on concretions.
INTRO TO MAGENTO 2
DEPENDENCY INJECTION PRINCIPLE
▸ Magento 2 uses dependency injection as an alternative to
the Magento 1.x Mage class. Dependency injection is the
concept of the external environment injecting
dependencies for an object instead of that object
manually creating them internally.
INTRO TO MAGENTO 2
DEPENDENCY INVERSION PRINCIPLE
▸ a coding principle that stipulates you use abstractions to
reduce code dependencies. This means that high level
classes should use the interface of a low level class instead
of working with it directly.
▸ The di.xml file maps an interface dependency to a
preferred implementation class.
Source: http://devdocs.magento.com/guides/v2.1/architecture/archi_perspectives/arch_diagrams.html
Architecture Diagram
MODULAR
ARCHITECTURE!
EVERYTHING IS NOW A MODULE.
BLOCKS, TEMPLATES,
& LAYOUTS
What does M2’s layout
structure look like anyway?
Containers Blocks/Templates
Source: http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/layouts/layout-overview.html
Layout Tree:
M2 with template hints enabled:
EXECUTION FLOW
EXECUTION FLOW
▸ Index.php
▸ Bootstrap
▸ Bootstrap::run()
▸ App
▸ App::launch()
▸ Routing
▸ FrontController::dispatch()
▸ Router::match()
▸ Controller Processing
▸ Controller::execute()
▸ Rendering
▸ View::loadLayout()
▸ View::renderLayout()
▸ Flushing Output
▸ Response::sendResponse()
▸ Four Steps
▸ Index.php calls bootstrap
▸ Bootstrap finds and calls
controller
▸ Response is loaded and
rendered
▸ Response is sent to response
object
INTRO TO MAGENTO 2
TOOLING
▸ PHPStorm
▸ Commerce Bug
▸ https://store.pulsestorm.net/products/commerce-bug-3
▸ Magicento2
▸ http://magicento.com/
FURTHER STUDY AND RESOURCES
▸ Magento DevDocs
▸ http://devdocs.magento.com/
▸ Magento Code Samples
▸ https://github.com/magento/magento2-samples
▸ Alan Storm’s Blog
▸ http://alanstorm.com/
▸ Alan Kent’s Blog
▸ https://alankent.me/
▸ Twitter Hashtag
▸ #realmagento
LET’S BUILD OUR
MODULE!
http://github.com/davidstillson/magento2-PricePerMonth

More Related Content

Similar to Intro to Magento 2: Let's build a Module!

Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2
Alessandro Molina
 
Prism Tech Ed India
Prism Tech Ed IndiaPrism Tech Ed India
Prism Tech Ed India
rsnarayanan
 

Similar to Intro to Magento 2: Let's build a Module! (20)

12 Amazing Features of Magento 2
12 Amazing Features of Magento 212 Amazing Features of Magento 2
12 Amazing Features of Magento 2
 
Architectural Design Pattern: Android
Architectural Design Pattern: AndroidArchitectural Design Pattern: Android
Architectural Design Pattern: Android
 
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai..."Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
 
PureMVC
PureMVCPureMVC
PureMVC
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with Rails
 
Architecture and Analytical Study of Magento
Architecture and Analytical Study of MagentoArchitecture and Analytical Study of Magento
Architecture and Analytical Study of Magento
 
Android Dagger 2
Android  Dagger 2Android  Dagger 2
Android Dagger 2
 
Aop, Metaprogramming and codegeneration with PHP
Aop, Metaprogramming and codegeneration with PHPAop, Metaprogramming and codegeneration with PHP
Aop, Metaprogramming and codegeneration with PHP
 
#7 - Client-side web apps, MVC and jQuery
#7 - Client-side web apps, MVC and jQuery#7 - Client-side web apps, MVC and jQuery
#7 - Client-side web apps, MVC and jQuery
 
Code One 2018 maven
Code One 2018   mavenCode One 2018   maven
Code One 2018 maven
 
Visusual basic
Visusual basicVisusual basic
Visusual basic
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2Rapid Prototyping with TurboGears2
Rapid Prototyping with TurboGears2
 
Composite Application Library, Prism v2
Composite Application Library, Prism v2Composite Application Library, Prism v2
Composite Application Library, Prism v2
 
Scaling frontend applications with micro-frontends Presentation.pdf
Scaling frontend applications with micro-frontends Presentation.pdfScaling frontend applications with micro-frontends Presentation.pdf
Scaling frontend applications with micro-frontends Presentation.pdf
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 
[Android] DI in multimodule application
[Android] DI in multimodule application[Android] DI in multimodule application
[Android] DI in multimodule application
 
Prism Tech Ed India
Prism Tech Ed IndiaPrism Tech Ed India
Prism Tech Ed India
 
реалии использования Mv в i os разработке
реалии использования Mv в i os разработкереалии использования Mv в i os разработке
реалии использования Mv в i os разработке
 
Mage Titans 2016 - Object(ivly) Thinking
Mage Titans 2016 - Object(ivly) ThinkingMage Titans 2016 - Object(ivly) Thinking
Mage Titans 2016 - Object(ivly) Thinking
 

Recently uploaded

Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
ChloeMeadows1
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
lolsDocherty
 

Recently uploaded (17)

Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's Guide
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirts
 
Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdf
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
 
I’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 ShirtI’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 Shirt
 
Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdf
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirts
 
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
 
Free scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsFree scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirts
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of apps
 
GOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdfGOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdf
 

Intro to Magento 2: Let's build a Module!