the future of magento extensibility | imagine 2013 technology | christopher o’toole
TRANSCRIPT
![Page 1: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/1.jpg)
![Page 2: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/2.jpg)
Insert photo of speaker
here
891 pixels h x 688 pixels w
New Presentation
Tier in Magento
Eugene Tulika
Software Engineer
Magento
![Page 3: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/3.jpg)
Insert photo of speaker
here
891 pixels h x 688 pixels w
Service IDL
Webhooks
Software Engineer
Magento
Christopher O’Toole
![Page 4: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/4.jpg)
Rethinking the extensions framework in Magento
• Efficient, secure, easy to use
• Focus: Upgradability and Compatibility
• We are introducing new concepts and gathering feedback to
refine the ideas
![Page 5: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/5.jpg)
![Page 6: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/6.jpg)
Services
• Encapsulates the access to the business logic
• Provides access to the data needed in templates
• Have well defined interfaces, which allows exposing the
logic via API
• Keeps access to business logic consistent for all clients:
SOAP, internal, etc
![Page 7: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/7.jpg)
![Page 8: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/8.jpg)
Twig templates
• Template is populated with data
• Restricts view layer from complex business logic and data
access scenarios
• Focused on data rendering
• Development of templates become easier without risk of
changing the business logic
• Allows building a secure view layer
• Automatic output encoding
• Magento provides custom functions and filters to access the
layout functionality within a template
No more SQL queries in Templates!
![Page 9: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/9.jpg)
Twig on Her Majesty’s Secret Service
![Page 10: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/10.jpg)
Access to the Service from view
Services
Configura
ble
Serv
ice C
alls
Presentation tier Business logic
![Page 11: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/11.jpg)
Define the service call configuration
![Page 12: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/12.jpg)
Make a reference to the service call from the layout
Display service data in the Twig
![Page 13: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/13.jpg)
Data from service call can be used in layout
![Page 14: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/14.jpg)
Blocks encapsulation
• Just generic blocks are needed
• Each block has its own data
• Parent block doesn’t share data with child
• Layout elements can be easily repositioned
![Page 15: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/15.jpg)
Configurable dropdown options
• via service call
• via constants
• via configuration
![Page 16: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/16.jpg)
Service?
• Interface to Business logic
• PHP Code
• Remote Endpoint
IDL will be a combination
of PHP annotations
and external schemas
Service IDL
![Page 17: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/17.jpg)
The PHP function receives an
associative array reflecting the
structure described by the annotation
IDL Annotations
![Page 18: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/18.jpg)
Input Data is defined in XML Schema
IDL Input Schema
![Page 19: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/19.jpg)
Expected Output is defined in XML Schema
IDL Output Schema
![Page 20: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/20.jpg)
Webhooks
What?
– Like Event Observers over HTTP
– Eliminates need for polling
– Supports real-time data integrations
– Asynchronous
![Page 21: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/21.jpg)
Webhook Config
![Page 22: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/22.jpg)
Webhook Listener
![Page 23: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/23.jpg)
Parsing Event Data
![Page 24: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/24.jpg)
Extension points where callback
results influence Magento behavior
(synchronous)
Callback Extension Points
![Page 25: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/25.jpg)
• Define your shipping config
• Use the provided callback service
Shipping Extension Config
![Page 26: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/26.jpg)
What was that <subscriber> tag all about?
Callback Subscriber
![Page 27: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/27.jpg)
Shipping Endpoint
Input defined in the IDL
![Page 28: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/28.jpg)
{
"shippingMethods": [
{
"carrier": “acme",
"carrierTitle": “ACME Shipping",
"method": "ground",
"methodTitle": “ACME Ground",
"price": 3.75
}
]
}
Endpoint Response
![Page 29: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/29.jpg)
It Works!
![Page 30: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole](https://reader031.vdocuments.site/reader031/viewer/2022022200/58aa03391a28abec248b65b1/html5/thumbnails/30.jpg)
Feedback
Initial Impressions
Questions
Comments
Source
https://github.com/magento/magento2
Documentation
http://magento.github.io/magento2-developer-docs/
Feedback
https://getsatisfaction.com/magento-2-prerelease
Eugene Tulika
Twitter: @vrann
Christopher O’Toole
Twitter: @frostmagus