SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
Design patterns in
Magento
MVC - Model View Controller
3
• Division into 3 main parts
of the application:
• Model - represents the
application logic
• View - describes how to
display data within the
user interface
• Controller - accepts input
from the user, updates the
model and refreshes the
view
MVC
MVC
MVC in MVC
The view layer in Magento itself
implements the MVC pattern.
M - blocks
V - templates.phtml
C – layouts (.xml files)
MVC in MVC
In xml files we define the blocks, which
are part of the view for a given controller
action and assign the appropriate
template to the main block
present the data obtained from the
block
load and render the layout
download data from the model layer, process it
and send to the template
Modularity
8
• Patterns orders grouping
of individual functions in
the project into modules
• Modules should not
require other modules for
proper operation
• Patterns define the
directory structure within
the parent module
directory
Modularity
9
• Magento autoloader has
pre-established search
priorities
• Subdirectory structure is
not only a matter of
convention.
• Magento class name
reflects its path
• The individual components
of the Module must be
explicitly declared the
module configuration file
Modularity in Magento
code pools
Subdirectory structure
in the module’s main
directory
1
A short digression - Autoloader
Code pools are added in a pre-
defined order
set up php of our path of attaching files
registering the autoloader
1
A short digression - Autoloader
The autoloader is called upon class instantiation, unless there is already an object of a
given class in the memory - the file is already attached
note that this is not a built-in
implementation of __autoload () method
Attach the desired file
Factory method in
Magento
1
Factory method in Magento
by the way - Singleton pattern in Magento

1
Factory method in Magento
1
What's under the hood?
we can also create a
class object by giving
its name
1
What's under the hood?
.....
divide the string of characters
first, look for overwritten classes
1
What's under the hood?
Magento adds a ‘mage' prefix as a
namespace
Registry
Registry
It allows you to place
objects and data in the global
pool, allowing access to them
from anywhere in the code
2
Registry
If you call a method with graceful parameter set to true,
you can avoid the occurence of an exception informing
you that there is a value under the given key
if at a given index there is an object that has a
destructor, use it
Event/Observer
2
Event/Observer
The extension code for the
Magento core is located
entirely in the Observer
class
2
How can you add your own observer?
events node
name of the event
module name/class name
name of the calling method at
the event
unique observer ID
2
Event/Observer
calls the appropriate method
2
Event/Observer
Object $area represents certain parts of
the application (frontend, global, admin,
adminhtml)
download the configuration of events for
each part of the application
iterate through all observers for a given
part of the application
Assign a taable of observers to a table of
events under the key of an event name
that they are observing
2
Event/Observer
for each of the observers we try to call its
event operating procedures
assign the observer the
arguments transferred in the
event call
the function calling the observer’s method
call the method by transferring the observer’s
object with the arguments submitted earlier
Front controller
Front controller
It is the entrance gate for all
requests directed at the
running applications..
It consists of two parts:
• web handler - parses the
URL and determines which
controller is to be created
• command dispatch -
creates a controller and
forwards the request
2
Magento Front controller
our candidate 
3
The front controller is designed to
accept a request and decide what
to do with it. Does it all really
happen in the index.php file?
Is that so?
3
What's under the hood?
What have we here?
Get front controller
Call
Call
3
What's under the hood?
Iterate through router info table
containing the name of the router class
and its place of operation (frontend,
admin)
add the created router to the variable
_routers by the method addRouter (). We
will use them in the near future
also a default router is created and added
3
What's under the hood?
Use the completed _routers table
We adapt the request to the router. Match is a
method of the abstract class
Mage_Core_Controller_Varien_Router_Abstract,
so each router defines its own body of this
method
In the match() method, check if the request matches
the address of the router and, if so, transfer the request
to the target module controller
Send an answer to the http client
Prototype
Prototype
The Prototype pattern is a kind
of extension of the abstract
factory pattern. Since it hasn’t
been discussed, it will be briefly
described below
A short digression – abstract facory
It defines a set of factory classes that inherit
from the abstract parent class (factory), which
specialize in creating groups of objects from
one family.
3
It all becomes clear
Prototype
It is a variation of abstract
factory pattern
It helps to limit the number of
factories by creating a generic
factory which is sent the types
of objects to be produced
Prototype
3
Prototyp w Magento
4
the facory method is called and
we transfer a product object as a
parameter
Prototyp w Magento
4
download type id transferred in the
product parameter
from the type table and corresponding names of
model classes we download the one correct for
our product
concretize object type of a product and set up the
product to operate on
There are more design
patterns in Magento, I
strongly encourage you
to explore them 
Thank you for attention
Contact
sales@divante.co

Contenu connexe

Tendances

Etsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureEtsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureDan McKinley
 
Service Oriented Architecture in Magento 2
Service Oriented Architecture in Magento 2Service Oriented Architecture in Magento 2
Service Oriented Architecture in Magento 2Max Pronko
 
Introduzione a Git (ITA - 2017)
Introduzione a Git (ITA - 2017)Introduzione a Git (ITA - 2017)
Introduzione a Git (ITA - 2017)Valerio Radice
 
DMsuite Static & Dynamic Data Masking Overview
DMsuite Static & Dynamic Data Masking OverviewDMsuite Static & Dynamic Data Masking Overview
DMsuite Static & Dynamic Data Masking OverviewAxis Technology, LLC
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAshokkumar T A
 
Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Noa Harel
 
Cassandra Virtual Node talk
Cassandra Virtual Node talkCassandra Virtual Node talk
Cassandra Virtual Node talkPatrick McFadin
 
Git hub ppt presentation
Git hub ppt presentationGit hub ppt presentation
Git hub ppt presentationAyanaRukasar
 
Understanding the nodejs event loop
Understanding the nodejs event loopUnderstanding the nodejs event loop
Understanding the nodejs event loopSaurabh Kumar
 
Laravel Routing and Query Building
Laravel   Routing and Query BuildingLaravel   Routing and Query Building
Laravel Routing and Query BuildingMindfire Solutions
 
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...Building the Future Together: AtoM3, Governance, and the Sustainability of Op...
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...Artefactual Systems - AtoM
 
The Future Of Web Frameworks
The Future Of Web FrameworksThe Future Of Web Frameworks
The Future Of Web FrameworksMatt Raible
 
A New CLI for Spring Developer Productivity
A New CLI for Spring Developer ProductivityA New CLI for Spring Developer Productivity
A New CLI for Spring Developer ProductivityVMware Tanzu
 

Tendances (20)

AtoM Implementations
AtoM ImplementationsAtoM Implementations
AtoM Implementations
 
Etsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureEtsy Activity Feeds Architecture
Etsy Activity Feeds Architecture
 
Service Oriented Architecture in Magento 2
Service Oriented Architecture in Magento 2Service Oriented Architecture in Magento 2
Service Oriented Architecture in Magento 2
 
Introduzione a Git (ITA - 2017)
Introduzione a Git (ITA - 2017)Introduzione a Git (ITA - 2017)
Introduzione a Git (ITA - 2017)
 
DMsuite Static & Dynamic Data Masking Overview
DMsuite Static & Dynamic Data Masking OverviewDMsuite Static & Dynamic Data Masking Overview
DMsuite Static & Dynamic Data Masking Overview
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricks
 
Introducing GitLab (September 2018)
Introducing GitLab (September 2018)Introducing GitLab (September 2018)
Introducing GitLab (September 2018)
 
GitHub Presentation
GitHub PresentationGitHub Presentation
GitHub Presentation
 
DATADOG TIPS #1
DATADOG TIPS #1DATADOG TIPS #1
DATADOG TIPS #1
 
Cassandra Virtual Node talk
Cassandra Virtual Node talkCassandra Virtual Node talk
Cassandra Virtual Node talk
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Git hub ppt presentation
Git hub ppt presentationGit hub ppt presentation
Git hub ppt presentation
 
Understanding the nodejs event loop
Understanding the nodejs event loopUnderstanding the nodejs event loop
Understanding the nodejs event loop
 
Laravel Routing and Query Building
Laravel   Routing and Query BuildingLaravel   Routing and Query Building
Laravel Routing and Query Building
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 
Bitbucket
BitbucketBitbucket
Bitbucket
 
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...Building the Future Together: AtoM3, Governance, and the Sustainability of Op...
Building the Future Together: AtoM3, Governance, and the Sustainability of Op...
 
The Future Of Web Frameworks
The Future Of Web FrameworksThe Future Of Web Frameworks
The Future Of Web Frameworks
 
A New CLI for Spring Developer Productivity
A New CLI for Spring Developer ProductivityA New CLI for Spring Developer Productivity
A New CLI for Spring Developer Productivity
 
Apache Airflow
Apache AirflowApache Airflow
Apache Airflow
 

En vedette

Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)Divante
 
Surprising failure factors when implementing eCommerce and Omnichannel eBusiness
Surprising failure factors when implementing eCommerce and Omnichannel eBusinessSurprising failure factors when implementing eCommerce and Omnichannel eBusiness
Surprising failure factors when implementing eCommerce and Omnichannel eBusinessDivante
 
Omnichannel Customer Experience
Omnichannel Customer ExperienceOmnichannel Customer Experience
Omnichannel Customer ExperienceDivante
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 WorkflowsRyan Street
 
2017 ecommerce design trends
2017 ecommerce design trends2017 ecommerce design trends
2017 ecommerce design trendsAbhishek Vaid
 
How to Install Magento 2 [Latest Version]
How to Install Magento 2 [Latest Version]How to Install Magento 2 [Latest Version]
How to Install Magento 2 [Latest Version]M-Connect Media
 
20 Tips to Improve Sales on your Ecommerce Site
20 Tips to Improve Sales on your Ecommerce Site20 Tips to Improve Sales on your Ecommerce Site
20 Tips to Improve Sales on your Ecommerce SiteJosh Levine
 
E-Commerce Technology
E-Commerce TechnologyE-Commerce Technology
E-Commerce TechnologyDivante
 
Magento implementation - by Divante.co
Magento implementation - by Divante.coMagento implementation - by Divante.co
Magento implementation - by Divante.coDivante
 
E-Commerce Case Studies
E-Commerce Case StudiesE-Commerce Case Studies
E-Commerce Case StudiesDivante
 
2017 Social Media & Content Marketing Predictions from 70 Marketing Leaders
2017 Social Media & Content Marketing Predictions from 70 Marketing Leaders 2017 Social Media & Content Marketing Predictions from 70 Marketing Leaders
2017 Social Media & Content Marketing Predictions from 70 Marketing Leaders Bryan Kramer
 
E-commerce Trends from 2015 to 2016 by Divante
E-commerce Trends from 2015 to 2016 by DivanteE-commerce Trends from 2015 to 2016 by Divante
E-commerce Trends from 2015 to 2016 by DivanteDivante
 
Digital marketing Trends 2017
Digital marketing Trends 2017Digital marketing Trends 2017
Digital marketing Trends 2017Infocrest
 
SEO for Ecommerce: A Comprehensive Guide
SEO for Ecommerce: A Comprehensive GuideSEO for Ecommerce: A Comprehensive Guide
SEO for Ecommerce: A Comprehensive GuideAdam Audette
 
Digital Marketing Trends 2017
Digital Marketing Trends 2017Digital Marketing Trends 2017
Digital Marketing Trends 2017Webrepublic
 
Social Media Trends 2017
Social Media Trends 2017Social Media Trends 2017
Social Media Trends 2017Chris Baker
 
Digital Trends in 2017: Making Business Impact in a Changing World
Digital Trends in 2017: Making Business Impact in a Changing WorldDigital Trends in 2017: Making Business Impact in a Changing World
Digital Trends in 2017: Making Business Impact in a Changing WorldEdelman
 
PHP Basic and Fundamental Questions and Answers with Detail Explanation
PHP Basic and Fundamental Questions and Answers with Detail ExplanationPHP Basic and Fundamental Questions and Answers with Detail Explanation
PHP Basic and Fundamental Questions and Answers with Detail ExplanationAbdul Rahman Sherzad
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Stephan Schmidt
 
OroPlatform and OroCRM from a developer's perspective
OroPlatform and OroCRM from a developer's perspectiveOroPlatform and OroCRM from a developer's perspective
OroPlatform and OroCRM from a developer's perspectiveYevhen Shyshkin
 

En vedette (20)

Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)Magento scalability from the trenches (Meet Magento Sweden 2016)
Magento scalability from the trenches (Meet Magento Sweden 2016)
 
Surprising failure factors when implementing eCommerce and Omnichannel eBusiness
Surprising failure factors when implementing eCommerce and Omnichannel eBusinessSurprising failure factors when implementing eCommerce and Omnichannel eBusiness
Surprising failure factors when implementing eCommerce and Omnichannel eBusiness
 
Omnichannel Customer Experience
Omnichannel Customer ExperienceOmnichannel Customer Experience
Omnichannel Customer Experience
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
 
2017 ecommerce design trends
2017 ecommerce design trends2017 ecommerce design trends
2017 ecommerce design trends
 
How to Install Magento 2 [Latest Version]
How to Install Magento 2 [Latest Version]How to Install Magento 2 [Latest Version]
How to Install Magento 2 [Latest Version]
 
20 Tips to Improve Sales on your Ecommerce Site
20 Tips to Improve Sales on your Ecommerce Site20 Tips to Improve Sales on your Ecommerce Site
20 Tips to Improve Sales on your Ecommerce Site
 
E-Commerce Technology
E-Commerce TechnologyE-Commerce Technology
E-Commerce Technology
 
Magento implementation - by Divante.co
Magento implementation - by Divante.coMagento implementation - by Divante.co
Magento implementation - by Divante.co
 
E-Commerce Case Studies
E-Commerce Case StudiesE-Commerce Case Studies
E-Commerce Case Studies
 
2017 Social Media & Content Marketing Predictions from 70 Marketing Leaders
2017 Social Media & Content Marketing Predictions from 70 Marketing Leaders 2017 Social Media & Content Marketing Predictions from 70 Marketing Leaders
2017 Social Media & Content Marketing Predictions from 70 Marketing Leaders
 
E-commerce Trends from 2015 to 2016 by Divante
E-commerce Trends from 2015 to 2016 by DivanteE-commerce Trends from 2015 to 2016 by Divante
E-commerce Trends from 2015 to 2016 by Divante
 
Digital marketing Trends 2017
Digital marketing Trends 2017Digital marketing Trends 2017
Digital marketing Trends 2017
 
SEO for Ecommerce: A Comprehensive Guide
SEO for Ecommerce: A Comprehensive GuideSEO for Ecommerce: A Comprehensive Guide
SEO for Ecommerce: A Comprehensive Guide
 
Digital Marketing Trends 2017
Digital Marketing Trends 2017Digital Marketing Trends 2017
Digital Marketing Trends 2017
 
Social Media Trends 2017
Social Media Trends 2017Social Media Trends 2017
Social Media Trends 2017
 
Digital Trends in 2017: Making Business Impact in a Changing World
Digital Trends in 2017: Making Business Impact in a Changing WorldDigital Trends in 2017: Making Business Impact in a Changing World
Digital Trends in 2017: Making Business Impact in a Changing World
 
PHP Basic and Fundamental Questions and Answers with Detail Explanation
PHP Basic and Fundamental Questions and Answers with Detail ExplanationPHP Basic and Fundamental Questions and Answers with Detail Explanation
PHP Basic and Fundamental Questions and Answers with Detail Explanation
 
Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5Go OO! - Real-life Design Patterns in PHP 5
Go OO! - Real-life Design Patterns in PHP 5
 
OroPlatform and OroCRM from a developer's perspective
OroPlatform and OroCRM from a developer's perspectiveOroPlatform and OroCRM from a developer's perspective
OroPlatform and OroCRM from a developer's perspective
 

Similaire à Design patterns in Magento

Repository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity FrameworkRepository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity FrameworkAkhil Mittal
 
ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]Mohamed Abdeen
 
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveDataAndroid MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveDataWaheed Nazir
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desaijinaldesailive
 
Master a Cloud Native Standard - MicroProfile.pptx
Master a Cloud Native Standard - MicroProfile.pptxMaster a Cloud Native Standard - MicroProfile.pptx
Master a Cloud Native Standard - MicroProfile.pptxEmilyJiang23
 
Resolve dependency of dependencies using Inversion of Control and dependency ...
Resolve dependency of dependencies using Inversion of Control and dependency ...Resolve dependency of dependencies using Inversion of Control and dependency ...
Resolve dependency of dependencies using Inversion of Control and dependency ...Akhil Mittal
 
Nt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNicole Gomez
 
systemverilog-interview-questions.docx
systemverilog-interview-questions.docxsystemverilog-interview-questions.docx
systemverilog-interview-questions.docxssuser1c8ca21
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCJohn Lewis
 
Net framework session03
Net framework session03Net framework session03
Net framework session03Vivek chan
 
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad NicheTech Com. Solutions Pvt. Ltd.
 
What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2Santosh Singh Paliwal
 
Building enterprise web applications with spring 3
Building enterprise web applications with spring 3Building enterprise web applications with spring 3
Building enterprise web applications with spring 3Abdelmonaim Remani
 

Similaire à Design patterns in Magento (20)

Repository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity FrameworkRepository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity Framework
 
ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]ASP.Net MVC 4 [Part - 2]
ASP.Net MVC 4 [Part - 2]
 
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveDataAndroid MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
Android MVVM architecture using Kotlin, Dagger2, LiveData, MediatorLiveData
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desai
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
 
Struts N E W
Struts N E WStruts N E W
Struts N E W
 
Master a Cloud Native Standard - MicroProfile.pptx
Master a Cloud Native Standard - MicroProfile.pptxMaster a Cloud Native Standard - MicroProfile.pptx
Master a Cloud Native Standard - MicroProfile.pptx
 
Resolve dependency of dependencies using Inversion of Control and dependency ...
Resolve dependency of dependencies using Inversion of Control and dependency ...Resolve dependency of dependencies using Inversion of Control and dependency ...
Resolve dependency of dependencies using Inversion of Control and dependency ...
 
Struts
StrutsStruts
Struts
 
Unit 2
Unit 2Unit 2
Unit 2
 
Nt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language Analysis
 
systemverilog-interview-questions.docx
systemverilog-interview-questions.docxsystemverilog-interview-questions.docx
systemverilog-interview-questions.docx
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVC
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
 
Unit 1
Unit  1Unit  1
Unit 1
 
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
 
What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2
 
MVC
MVCMVC
MVC
 
Building enterprise web applications with spring 3
Building enterprise web applications with spring 3Building enterprise web applications with spring 3
Building enterprise web applications with spring 3
 

Plus de Divante

The eCommerce Platforms in the Global Setup
The eCommerce Platforms in the Global Setup	The eCommerce Platforms in the Global Setup
The eCommerce Platforms in the Global Setup Divante
 
eCommerce Trends 2020
eCommerce Trends 2020eCommerce Trends 2020
eCommerce Trends 2020Divante
 
Async & Bulk REST API new possibilities of communication between systems
Async & Bulk REST API new possibilities of communication  between systemsAsync & Bulk REST API new possibilities of communication  between systems
Async & Bulk REST API new possibilities of communication between systemsDivante
 
Magento Functional Testing Framework a way to seriously write automated tests...
Magento Functional Testing Framework a way to seriously write automated tests...Magento Functional Testing Framework a way to seriously write automated tests...
Magento Functional Testing Framework a way to seriously write automated tests...Divante
 
Die Top 10 Progressive Web Apps in der Modernbranche
Die Top 10 Progressive Web Apps in der ModernbrancheDie Top 10 Progressive Web Apps in der Modernbranche
Die Top 10 Progressive Web Apps in der ModernbrancheDivante
 
progressive web apps - pwa as a game changer for e-commerce - meet magento i...
 progressive web apps - pwa as a game changer for e-commerce - meet magento i... progressive web apps - pwa as a game changer for e-commerce - meet magento i...
progressive web apps - pwa as a game changer for e-commerce - meet magento i...Divante
 
Customer churn - how to stop it?
Customer churn - how to stop it?Customer churn - how to stop it?
Customer churn - how to stop it?Divante
 
eCommerce trends 2019 by Divante.co
eCommerce trends 2019 by Divante.coeCommerce trends 2019 by Divante.co
eCommerce trends 2019 by Divante.coDivante
 
How to create a Vue Storefront theme
How to create a Vue Storefront themeHow to create a Vue Storefront theme
How to create a Vue Storefront themeDivante
 
Game changer for e-commerce - Vue Storefront - open source pwa
Game changer for e-commerce - Vue Storefront - open source pwa Game changer for e-commerce - Vue Storefront - open source pwa
Game changer for e-commerce - Vue Storefront - open source pwa Divante
 
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechVue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechDivante
 
How to successfully onboard end-clients to a B2B Platform - Magento Imagine ...
How to successfully onboard  end-clients to a B2B Platform - Magento Imagine ...How to successfully onboard  end-clients to a B2B Platform - Magento Imagine ...
How to successfully onboard end-clients to a B2B Platform - Magento Imagine ...Divante
 
eCommerce trends from 2017 to 2018 by Divante.co
eCommerce trends from 2017 to 2018 by Divante.coeCommerce trends from 2017 to 2018 by Divante.co
eCommerce trends from 2017 to 2018 by Divante.coDivante
 
Designing for PWA (Progressive Web Apps)
Designing for PWA (Progressive Web Apps)Designing for PWA (Progressive Web Apps)
Designing for PWA (Progressive Web Apps)Divante
 
Why is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosWhy is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosDivante
 
vue-storefront - PWA eCommerce for Magento2 MM17NYC presentation
vue-storefront - PWA eCommerce for Magento2 MM17NYC presentationvue-storefront - PWA eCommerce for Magento2 MM17NYC presentation
vue-storefront - PWA eCommerce for Magento2 MM17NYC presentationDivante
 
Pimcore Overview - Pimcore5
Pimcore Overview - Pimcore5Pimcore Overview - Pimcore5
Pimcore Overview - Pimcore5Divante
 
Pimcore E-Commerce Framework - Pimcore5
Pimcore E-Commerce Framework - Pimcore5Pimcore E-Commerce Framework - Pimcore5
Pimcore E-Commerce Framework - Pimcore5Divante
 
The biggest stores on Magento
The biggest stores on MagentoThe biggest stores on Magento
The biggest stores on MagentoDivante
 
B2B Commerce - how to become successful
B2B Commerce - how to become successfulB2B Commerce - how to become successful
B2B Commerce - how to become successfulDivante
 

Plus de Divante (20)

The eCommerce Platforms in the Global Setup
The eCommerce Platforms in the Global Setup	The eCommerce Platforms in the Global Setup
The eCommerce Platforms in the Global Setup
 
eCommerce Trends 2020
eCommerce Trends 2020eCommerce Trends 2020
eCommerce Trends 2020
 
Async & Bulk REST API new possibilities of communication between systems
Async & Bulk REST API new possibilities of communication  between systemsAsync & Bulk REST API new possibilities of communication  between systems
Async & Bulk REST API new possibilities of communication between systems
 
Magento Functional Testing Framework a way to seriously write automated tests...
Magento Functional Testing Framework a way to seriously write automated tests...Magento Functional Testing Framework a way to seriously write automated tests...
Magento Functional Testing Framework a way to seriously write automated tests...
 
Die Top 10 Progressive Web Apps in der Modernbranche
Die Top 10 Progressive Web Apps in der ModernbrancheDie Top 10 Progressive Web Apps in der Modernbranche
Die Top 10 Progressive Web Apps in der Modernbranche
 
progressive web apps - pwa as a game changer for e-commerce - meet magento i...
 progressive web apps - pwa as a game changer for e-commerce - meet magento i... progressive web apps - pwa as a game changer for e-commerce - meet magento i...
progressive web apps - pwa as a game changer for e-commerce - meet magento i...
 
Customer churn - how to stop it?
Customer churn - how to stop it?Customer churn - how to stop it?
Customer churn - how to stop it?
 
eCommerce trends 2019 by Divante.co
eCommerce trends 2019 by Divante.coeCommerce trends 2019 by Divante.co
eCommerce trends 2019 by Divante.co
 
How to create a Vue Storefront theme
How to create a Vue Storefront themeHow to create a Vue Storefront theme
How to create a Vue Storefront theme
 
Game changer for e-commerce - Vue Storefront - open source pwa
Game changer for e-commerce - Vue Storefront - open source pwa Game changer for e-commerce - Vue Storefront - open source pwa
Game changer for e-commerce - Vue Storefront - open source pwa
 
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechVue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
 
How to successfully onboard end-clients to a B2B Platform - Magento Imagine ...
How to successfully onboard  end-clients to a B2B Platform - Magento Imagine ...How to successfully onboard  end-clients to a B2B Platform - Magento Imagine ...
How to successfully onboard end-clients to a B2B Platform - Magento Imagine ...
 
eCommerce trends from 2017 to 2018 by Divante.co
eCommerce trends from 2017 to 2018 by Divante.coeCommerce trends from 2017 to 2018 by Divante.co
eCommerce trends from 2017 to 2018 by Divante.co
 
Designing for PWA (Progressive Web Apps)
Designing for PWA (Progressive Web Apps)Designing for PWA (Progressive Web Apps)
Designing for PWA (Progressive Web Apps)
 
Why is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosWhy is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenarios
 
vue-storefront - PWA eCommerce for Magento2 MM17NYC presentation
vue-storefront - PWA eCommerce for Magento2 MM17NYC presentationvue-storefront - PWA eCommerce for Magento2 MM17NYC presentation
vue-storefront - PWA eCommerce for Magento2 MM17NYC presentation
 
Pimcore Overview - Pimcore5
Pimcore Overview - Pimcore5Pimcore Overview - Pimcore5
Pimcore Overview - Pimcore5
 
Pimcore E-Commerce Framework - Pimcore5
Pimcore E-Commerce Framework - Pimcore5Pimcore E-Commerce Framework - Pimcore5
Pimcore E-Commerce Framework - Pimcore5
 
The biggest stores on Magento
The biggest stores on MagentoThe biggest stores on Magento
The biggest stores on Magento
 
B2B Commerce - how to become successful
B2B Commerce - how to become successfulB2B Commerce - how to become successful
B2B Commerce - how to become successful
 

Dernier

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Dernier (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Design patterns in Magento

  • 2. MVC - Model View Controller
  • 3. 3 • Division into 3 main parts of the application: • Model - represents the application logic • View - describes how to display data within the user interface • Controller - accepts input from the user, updates the model and refreshes the view MVC
  • 4. MVC
  • 5. MVC in MVC The view layer in Magento itself implements the MVC pattern. M - blocks V - templates.phtml C – layouts (.xml files)
  • 6. MVC in MVC In xml files we define the blocks, which are part of the view for a given controller action and assign the appropriate template to the main block present the data obtained from the block load and render the layout download data from the model layer, process it and send to the template
  • 8. 8 • Patterns orders grouping of individual functions in the project into modules • Modules should not require other modules for proper operation • Patterns define the directory structure within the parent module directory Modularity
  • 9. 9 • Magento autoloader has pre-established search priorities • Subdirectory structure is not only a matter of convention. • Magento class name reflects its path • The individual components of the Module must be explicitly declared the module configuration file Modularity in Magento code pools Subdirectory structure in the module’s main directory
  • 10. 1 A short digression - Autoloader Code pools are added in a pre- defined order set up php of our path of attaching files registering the autoloader
  • 11. 1 A short digression - Autoloader The autoloader is called upon class instantiation, unless there is already an object of a given class in the memory - the file is already attached note that this is not a built-in implementation of __autoload () method Attach the desired file
  • 13. 1 Factory method in Magento by the way - Singleton pattern in Magento 
  • 15. 1 What's under the hood? we can also create a class object by giving its name
  • 16. 1 What's under the hood? ..... divide the string of characters first, look for overwritten classes
  • 17. 1 What's under the hood? Magento adds a ‘mage' prefix as a namespace
  • 19. Registry It allows you to place objects and data in the global pool, allowing access to them from anywhere in the code
  • 20. 2 Registry If you call a method with graceful parameter set to true, you can avoid the occurence of an exception informing you that there is a value under the given key if at a given index there is an object that has a destructor, use it
  • 22. 2 Event/Observer The extension code for the Magento core is located entirely in the Observer class
  • 23. 2 How can you add your own observer? events node name of the event module name/class name name of the calling method at the event unique observer ID
  • 25. 2 Event/Observer Object $area represents certain parts of the application (frontend, global, admin, adminhtml) download the configuration of events for each part of the application iterate through all observers for a given part of the application Assign a taable of observers to a table of events under the key of an event name that they are observing
  • 26. 2 Event/Observer for each of the observers we try to call its event operating procedures assign the observer the arguments transferred in the event call the function calling the observer’s method call the method by transferring the observer’s object with the arguments submitted earlier
  • 28. Front controller It is the entrance gate for all requests directed at the running applications.. It consists of two parts: • web handler - parses the URL and determines which controller is to be created • command dispatch - creates a controller and forwards the request
  • 30. 3 The front controller is designed to accept a request and decide what to do with it. Does it all really happen in the index.php file? Is that so?
  • 31. 3 What's under the hood? What have we here? Get front controller Call Call
  • 32. 3 What's under the hood? Iterate through router info table containing the name of the router class and its place of operation (frontend, admin) add the created router to the variable _routers by the method addRouter (). We will use them in the near future also a default router is created and added
  • 33. 3 What's under the hood? Use the completed _routers table We adapt the request to the router. Match is a method of the abstract class Mage_Core_Controller_Varien_Router_Abstract, so each router defines its own body of this method In the match() method, check if the request matches the address of the router and, if so, transfer the request to the target module controller Send an answer to the http client
  • 35. Prototype The Prototype pattern is a kind of extension of the abstract factory pattern. Since it hasn’t been discussed, it will be briefly described below
  • 36. A short digression – abstract facory It defines a set of factory classes that inherit from the abstract parent class (factory), which specialize in creating groups of objects from one family.
  • 38. Prototype It is a variation of abstract factory pattern It helps to limit the number of factories by creating a generic factory which is sent the types of objects to be produced
  • 40. Prototyp w Magento 4 the facory method is called and we transfer a product object as a parameter
  • 41. Prototyp w Magento 4 download type id transferred in the product parameter from the type table and corresponding names of model classes we download the one correct for our product concretize object type of a product and set up the product to operate on
  • 42. There are more design patterns in Magento, I strongly encourage you to explore them 
  • 43. Thank you for attention Contact sales@divante.co