SlideShare uma empresa Scribd logo
1 de 46
Key Insights into
Development Design
Patterns for Magento 2
CTO @ GiftsDirect, TheIrishStore
Max Pronko
Today’s Presentation Includes
• Design Patterns and Magento 2
• Aspect Oriented Programming
• Questions and Answers
Design Patterns
What is Design Pattern?
describes a problem which occurs over and over again,
and then describes the core of the solution to that
problem, without ever doing it the same way twice
“
- Christopher Alexander
Composite pattern is used to treat a group of objects in
similar way as a single object uniformly
Composite Pattern
Composite Diagram
BuilderInterface
Common
implements
AddressCreditCard Composite
1
*
MagentoPaymentGateway
BuilderComposite Example
class BuilderComposite implements BuilderInterface
{
/** @var BuilderInterface[] */
private $builders;
public function __construct($builders) {
$this->builders = $builders;
}
public function build(array $buildSubject) {
$result = [];
foreach ($this->builders as $builder) {
$result = array_merge_recursive($result, $builder->build($buildSubject));
}
return $result;
}
}
CompositeBuilder Declaration
<config>
<virtualType name="CaptureBuilderComposite" type="MagentoPaymentGatewayRequestBuilderComposite">
<arguments>
<argument name="builders" xsi:type="array">
<item name="common" xsi:type="object">PronkoPaymentGatewayCommonBuilder</item>
<item name=“credit_card" xsi:type="object">PronkoPaymentGatewayCreditCardBuilder</item>
<item name="address" xsi:type="object">PronkoPaymentGatewayAddressBuilder</item>
</argument>
</arguments>
</virtualType>
</config>
File: PronkoPaymentetcdi.xml
Strategy lets the algorithm vary independently from the
clients that use it
Strategy Pattern
Strategy Pattern Diagram
BuilderInterface
CaptureBuilder
implements
PartialBuilder
CaptureStrategy
GatewayCommand
implements
calls
uses
MagentoPaymentGateway
Strategy Pattern
class CaptureStrategy implements BuilderInterface {
/** @var BuilderInterface */
protected $partial;
/** @var BuilderInterface */
protected $capture;
public function build(array $buildSubject) {
$condition = //set condition
if ($condition) {
return $this->partial->build($buildSubject);
}
return $this->capture->build($buildSubject);
}
}
Define an interface for creating an object, but let
subclasses decide which class to instantiate. Factory
Method lets a class defer instantiation to subclasses
Factory Method Pattern
Factory Method Pattern Diagram
TransferFactory
implements
TransferFactoryInterfaceGatewayCommand
uses
create()
MagentoPaymentGatewayCommand
Transfer
creates
Transfer Factory Example
namespace MagentoBraintreeGatewayHttp;
class TransferFactory implements TransferFactoryInterface
{
private $transferBuilder;
public function __construct(TransferBuilder $transferBuilder) {
$this->transferBuilder = $transferBuilder;
}
public function create(array $request) {
return $this->transferBuilder
->setBody($request)
->build();
}
}
Transfer Factory Example
namespace MagentoBraintreeGatewayHttp;
class TransferFactory implements TransferFactoryInterface
{
private $transferBuilder;
public function __construct(TransferBuilder $transferBuilder) {
$this->transferBuilder = $transferBuilder;
}
public function create(array $request) {
return $this->transferBuilder
->setBody($request)
->build();
}
}
class GatewayCommand implements CommandInterface {
public function execute(array $commandSubject) {
$transferO = $this->transferFactory->create(
$this->requestBuilder->build($commandSubject)
);
$response = $this->client->placeRequest($transferO)
// … code
}
}
Define a one-to-many dependency between objects so
that when one object changes state, all its dependents
are notified and updated automatically
Observer Pattern
Observer Pattern Diagram
Manager Config
implements
ObserverInterface
ManagerInterfaceAdapter
dispatch()
getObservers()
execute()
events.xml
PaymentObserver
implements
MagentoPayment
Dispatching an event
use MagentoFrameworkEventManagerInterface;
class Adapter implements MethodInterface {
/** @var ManagerInterface */
protected $eventManager;
public function assignData(MagentoFrameworkDataObject $data) {
$this->eventManager->dispatch(
'payment_method_assign_data_' . $this->getCode(),
[
AbstractDataAssignObserver::METHOD_CODE => $this,
AbstractDataAssignObserver::MODEL_CODE => $this->getInfoInstance(),
AbstractDataAssignObserver::DATA_CODE => $data
]
);
return $this;
}
}
Observer Configuration
<config>
<event name=“payment_method_assign_data_custom">
<observer name="custom_gateway_data_assign" instance="PronkoPaymentObserverDataAssignObserver" />
</event>
</config>
File: PronkoPaymentetcevents.xml
Observer Implementation
namespace PronkoPaymentObserver;
use MagentoFrameworkEventObserver;
use MagentoPaymentObserverAbstractDataAssignObserver;
class DataAssignObserver extends AbstractDataAssignObserver
{
public function execute(Observer $observer)
{
$data = $this->readDataArgument($observer);
$additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);
$payment = $observer->getPaymentModel();
$payment->setCcLast4(substr($additionalData->getData('cc_number'), -4));
}
}
Typical implementation of Dependency Manager. Enables
Inversion of Control support for Magento 2
Object Manager
Object Manager
• Dependency Manager
• Instantiates classes
• Creates objects
• Provides shared objects pool
• Supports lazy Initialisation
• __construct() method injection
Object Manager Implementation
Singleton
Builder
Abstract Factory
Factory Method
Decorator
Value Object
Composite
Strategy
CQRS
Dependency Injection
…
Object Manager Diagram
ObjectManagerInterface
ObjectManager
App/ObjectManager
ObjectManagerFactory App/Bootstrap
[Object]
uses
creates
configures
uses
[Object]
[Object]
MagentoFrameworkObjectManager
Object Manager Usage
Good
• Factory
• Builder
• Proxy
• Application
• generated classes
Bad
• Data Objects
• Business Objects
• Action Controllers
• Mage::getModel like calls
• Blocks
Attach additional responsibilities to an object dynamically.
Decorators provide a flexible alternative to subclassing for
extending functionality
Decorator Pattern
Decorator Pattern Diagram
FactoryInterface
DynamicProduction
implements
AbstractFactory
DynamicDeveloper
ProfilerFactoryDecorator
1
1
MagentoFrameworkObjectManager
Compiled
extends
namespace MagentoFrameworkAppObjectManagerEnvironment;
abstract class AbstractEnvironment implements EnvironmentInterface {
protected function decorate($arguments){
if (isset($arguments['MAGE_PROFILER']) && $arguments['MAGE_PROFILER'] == 2) {
$this->factory = new FactoryDecorator(
$this->factory,
Log::getInstance()
);
}
}
}
Decorator: Profiler Factory
namespace MagentoFrameworkAppObjectManagerEnvironment;
abstract class AbstractEnvironment implements EnvironmentInterface {
protected function decorate($arguments){
if (isset($arguments['MAGE_PROFILER']) && $arguments['MAGE_PROFILER'] == 2) {
$this->factory = new FactoryDecorator(
$this->factory,
Log::getInstance()
);
}
}
}
Decorator: Profiler Factory
class DecoratorFactory implements FactoryInterface {}
class CompiledFactory implements FactoryInterface {}
A proxy is a class functioning as an interface to something
else. It is used for resource consuming objects
Proxy Pattern
Proxy Pattern Diagram
NoninterceptableInterface
AreaList/Proxy
MagentoFrameworkApp
AreaList
implements
extends
Proxy Pattern Declaration
<config>
<type name="MagentoFrameworkConfigScope">
<arguments>
<argument name="areaList" xsi:type="object">MagentoFrameworkAppAreaListProxy</argument>
</arguments>
</type>
</config>
File: app/etc/di.xml
Aspect Oriented Programming
a programming paradigm that aims to increase modularity
by allowing the separation of cross-cutting concerns. The
goal is to achieve loose coupling
Aspect Oriented Programming
AOP Cross Cutting Concerns
Security
Logging
Monitoring
Catalog Sales
Checkout …
Magento AOP Example
Client
PluginPlugin Target
Interceptor
Plugin
Invoke Method
Result
Interception Pipeline
ObjectManager
Result
Invoke
get Result
Types of a Plugin
Method
Before After
Around
Affects input
method argument
Modifies behaviour
Affects method
return value
Check Module Status Plugin
After
Around
namespace MagentoFrameworkModulePlugin;
class DbStatusValidator
{
public function aroundDispatch(
MagentoFrameworkAppFrontController $subject,
Closure $proceed,
MagentoFrameworkAppRequestInterface $request
) {
if (!$this->cache->load('db_is_up_to_date')) {
$errors = $this->dbVersionInfo->getDbVersionErrors();
if ($errors) {
// throw exception
} else {
$this->cache->save('true', 'db_is_up_to_date');
}
}
return $proceed($request);
}
}
Invalidate Cache Plugin
After
Around
namespace MagentoWebapiSecurityModelPlugin;
class CacheInvalidator
{
public function afterAfterSave(
MagentoFrameworkAppConfigValue $subject,
MagentoFrameworkAppConfigValue $result
) {
if (condition) {
$this->cacheTypeList->invalidate(MagentoWebapiModelCacheTypeWebapi::TYPE_IDENTIFIER);
}
return $result;
}
}
Password Security Check Plugin
After
Around
namespace MagentoSecurityModelPlugin;
class AccountManagement
{
public function beforeInitiatePasswordReset(
AccountManagementOriginal $accountManagement,
$email,
$template,
$websiteId = null
) {
$this->securityManager->performSecurityCheck(
PasswordResetRequestEvent::CUSTOMER_PASSWORD_RESET_REQUEST,
$email
);
return [$email, $template, $websiteId];
}
}
Declaring Plugin
After
File: MagentoSecurityetcdi.xml
<config>
<type name="MagentoCustomerModelAccountManagement">
<plugin name="security_check_customer_password_reset_attempt" type="MagentoSecurityModelPluginAccountManag
</type>
</config>
Interception
Limitations
• Final methods / classes
• Static class and __construct() methods
• Virtual types
Benefits
• Public methods
• Auto-generated Decorators
• Flexible approach
• NoninterceptableInterface
Summary
• Solve problems using Design Patterns
• Don’t overuse Design Patterns
• Build your code on abstractions (interfaces)
• Look inside Magento 2 for good practices
Ask Me Anything
Thank you
www.maxpronko.com
max_pronko

Mais conteúdo relacionado

Mais procurados

Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners Varun Raj
 
우아한테크세미나-우아한멀티모듈
우아한테크세미나-우아한멀티모듈우아한테크세미나-우아한멀티모듈
우아한테크세미나-우아한멀티모듈용근 권
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootMikalai Alimenkou
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignYoung-Ho Cho
 
Hidden Secrets of Magento Price Rules
Hidden Secrets of Magento Price RulesHidden Secrets of Magento Price Rules
Hidden Secrets of Magento Price RulesIvan Chepurnyi
 
ITIL V3 and the Unified Service Model
ITIL V3 and the Unified Service ModelITIL V3 and the Unified Service Model
ITIL V3 and the Unified Service ModelDavid Messineo
 
DDD와 이벤트소싱
DDD와 이벤트소싱DDD와 이벤트소싱
DDD와 이벤트소싱Suhyeon Jo
 
Grafonnet, grafana dashboards as code
Grafonnet, grafana dashboards as codeGrafonnet, grafana dashboards as code
Grafonnet, grafana dashboards as codeJulien Pivotto
 
Introduction à spring boot
Introduction à spring bootIntroduction à spring boot
Introduction à spring bootAntoine Rey
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Mathew Beane
 
Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo Cheah Eng Soon
 
SharePoint Folders vs. Metadata Best Practices
SharePoint Folders vs. Metadata Best PracticesSharePoint Folders vs. Metadata Best Practices
SharePoint Folders vs. Metadata Best PracticesChris Woodill
 
Successful Content Management Through Taxonomy And Metadata Design
Successful Content Management Through Taxonomy And Metadata DesignSuccessful Content Management Through Taxonomy And Metadata Design
Successful Content Management Through Taxonomy And Metadata Designsarakirsten
 
Amazon Web Services 101 (Korean)
Amazon Web Services 101 (Korean)Amazon Web Services 101 (Korean)
Amazon Web Services 101 (Korean)Amazon Web Services
 

Mais procurados (20)

Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
우아한테크세미나-우아한멀티모듈
우아한테크세미나-우아한멀티모듈우아한테크세미나-우아한멀티모듈
우아한테크세미나-우아한멀티모듈
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
React js
React jsReact js
React js
 
Hidden Secrets of Magento Price Rules
Hidden Secrets of Magento Price RulesHidden Secrets of Magento Price Rules
Hidden Secrets of Magento Price Rules
 
Unit 4
Unit 4Unit 4
Unit 4
 
ITIL V3 and the Unified Service Model
ITIL V3 and the Unified Service ModelITIL V3 and the Unified Service Model
ITIL V3 and the Unified Service Model
 
DDD와 이벤트소싱
DDD와 이벤트소싱DDD와 이벤트소싱
DDD와 이벤트소싱
 
Grafonnet, grafana dashboards as code
Grafonnet, grafana dashboards as codeGrafonnet, grafana dashboards as code
Grafonnet, grafana dashboards as code
 
Introduction à spring boot
Introduction à spring bootIntroduction à spring boot
Introduction à spring boot
 
Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2Madison PHP - Getting Started with Magento 2
Madison PHP - Getting Started with Magento 2
 
Google cloud platform
Google cloud platformGoogle cloud platform
Google cloud platform
 
Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo Azure Active Directory - External Identities Demo
Azure Active Directory - External Identities Demo
 
React
React React
React
 
SharePoint Folders vs. Metadata Best Practices
SharePoint Folders vs. Metadata Best PracticesSharePoint Folders vs. Metadata Best Practices
SharePoint Folders vs. Metadata Best Practices
 
Successful Content Management Through Taxonomy And Metadata Design
Successful Content Management Through Taxonomy And Metadata DesignSuccessful Content Management Through Taxonomy And Metadata Design
Successful Content Management Through Taxonomy And Metadata Design
 
Amazon Web Services 101 (Korean)
Amazon Web Services 101 (Korean)Amazon Web Services 101 (Korean)
Amazon Web Services 101 (Korean)
 
Taxonomy: Do I Need One
Taxonomy: Do I Need OneTaxonomy: Do I Need One
Taxonomy: Do I Need One
 

Semelhante a Key Insights into Development Design Patterns for Magento 2 - Magento Live UK

Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenchesLukas Smith
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
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
 
Laravel Design Patterns
Laravel Design PatternsLaravel Design Patterns
Laravel Design PatternsBobby Bouwmann
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowVrann Tulika
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf Conference
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmersAlexander Varwijk
 
PHP: 4 Design Patterns to Make Better Code
PHP: 4 Design Patterns to Make Better CodePHP: 4 Design Patterns to Make Better Code
PHP: 4 Design Patterns to Make Better CodeSWIFTotter Solutions
 
ZF2 for the ZF1 Developer
ZF2 for the ZF1 DeveloperZF2 for the ZF1 Developer
ZF2 for the ZF1 DeveloperGary Hockin
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)James Titcumb
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologyDaniel Knell
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)James Titcumb
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersKacper Gunia
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICKonstantin Kudryashov
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"GeeksLab Odessa
 
Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web servicesMichelangelo van Dam
 
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)James Titcumb
 

Semelhante a Key Insights into Development Design Patterns for Magento 2 - Magento Live UK (20)

Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
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
 
Laravel Design Patterns
Laravel Design PatternsLaravel Design Patterns
Laravel Design Patterns
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request Flow
 
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
ZFConf 2010: Zend Framework & MVC, Model Implementation (Part 2, Dependency I...
 
Multilingualism makes better programmers
Multilingualism makes better programmersMultilingualism makes better programmers
Multilingualism makes better programmers
 
PHP: 4 Design Patterns to Make Better Code
PHP: 4 Design Patterns to Make Better CodePHP: 4 Design Patterns to Make Better Code
PHP: 4 Design Patterns to Make Better Code
 
ZF2 for the ZF1 Developer
ZF2 for the ZF1 DeveloperZF2 for the ZF1 Developer
ZF2 for the ZF1 Developer
 
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP UK 2017)
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
 
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
Kicking off with Zend Expressive and Doctrine ORM (Sunshine PHP 2017)
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
 
Decoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DICDecoupling with Design Patterns and Symfony2 DIC
Decoupling with Design Patterns and Symfony2 DIC
 
Doctrine and NoSQL
Doctrine and NoSQLDoctrine and NoSQL
Doctrine and NoSQL
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"
 
Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web services
 
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
Kicking off with Zend Expressive and Doctrine ORM (PHP Srbija 2017)
 

Mais de Max Pronko

Mastering Declarative Database Schema - MageConf 2019
Mastering Declarative Database Schema - MageConf 2019Mastering Declarative Database Schema - MageConf 2019
Mastering Declarative Database Schema - MageConf 2019Max Pronko
 
Service Oriented Architecture in Magento 2
Service Oriented Architecture in Magento 2Service Oriented Architecture in Magento 2
Service Oriented Architecture in Magento 2Max Pronko
 
Checkout Customizations in Magento 2 - MageTitansMCR 2017
Checkout Customizations in Magento 2 - MageTitansMCR 2017Checkout Customizations in Magento 2 - MageTitansMCR 2017
Checkout Customizations in Magento 2 - MageTitansMCR 2017Max Pronko
 
Magento 2 Deployment Automation: from 6 hours to 15 minutes - Max Pronko
Magento 2 Deployment Automation: from 6 hours to 15 minutes - Max PronkoMagento 2 Deployment Automation: from 6 hours to 15 minutes - Max Pronko
Magento 2 Deployment Automation: from 6 hours to 15 minutes - Max PronkoMax Pronko
 
Checkout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoCheckout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoMax Pronko
 
Real use cases of performance optimization in magento 2
Real use cases of performance optimization in magento 2Real use cases of performance optimization in magento 2
Real use cases of performance optimization in magento 2Max Pronko
 
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
 
Zepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_FinalZepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_FinalMax Pronko
 

Mais de Max Pronko (8)

Mastering Declarative Database Schema - MageConf 2019
Mastering Declarative Database Schema - MageConf 2019Mastering Declarative Database Schema - MageConf 2019
Mastering Declarative Database Schema - MageConf 2019
 
Service Oriented Architecture in Magento 2
Service Oriented Architecture in Magento 2Service Oriented Architecture in Magento 2
Service Oriented Architecture in Magento 2
 
Checkout Customizations in Magento 2 - MageTitansMCR 2017
Checkout Customizations in Magento 2 - MageTitansMCR 2017Checkout Customizations in Magento 2 - MageTitansMCR 2017
Checkout Customizations in Magento 2 - MageTitansMCR 2017
 
Magento 2 Deployment Automation: from 6 hours to 15 minutes - Max Pronko
Magento 2 Deployment Automation: from 6 hours to 15 minutes - Max PronkoMagento 2 Deployment Automation: from 6 hours to 15 minutes - Max Pronko
Magento 2 Deployment Automation: from 6 hours to 15 minutes - Max Pronko
 
Checkout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoCheckout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max Pronko
 
Real use cases of performance optimization in magento 2
Real use cases of performance optimization in magento 2Real use cases of performance optimization in magento 2
Real use cases of performance optimization in 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
 
Zepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_FinalZepplin_Pronko_Magento_Festival Hall 1_Final
Zepplin_Pronko_Magento_Festival Hall 1_Final
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 

Key Insights into Development Design Patterns for Magento 2 - Magento Live UK

Notas do Editor

  1. Big changes compare to M1, everything become possible Solid architectural goals - flexibility, upgradability - time to market - scalable - service contracts - unit simplicity
  2. smalltalk book, remember almost nothing.
  3. overview of the class - Builds payment gateway request - capture or auth builders array is a builder interface as a result - prepares key value ready to convert to xml/dom/soap request
  4. Di.xml config virtual type! - idea Single responsibility later added to transport factory
  5. Magento 2 only capture request (no partial) CaptureStrategy to allow send partial request
  6. In Magento it is not always enough events
  7. auto-generated code
  8. Object Manager enables Proxy support for all objects Instantiates object only during first method call Auto-generated class Extends Original class Implements Magento\Framework\ObjectManager\NoninterceptableInterface interface Proxies all calls to original class
  9. Additional behavior to existing code (an advice) without modifying the code itself Separately specifying - "log all function calls when the function's name begins with 'set'". This allows behaviors that are not central to the business logic to be added to a program without cluttering the code core to the functionality. AOP forms a basis for aspect-oriented software development.