+ All Categories
Home > Technology > The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

Date post: 20-Feb-2017
Category:
Upload: atwix
View: 596 times
Download: 1 times
Share this document with a friend
30
Transcript
Page 1: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole
Page 2: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

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

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

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
Page 6: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

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
Page 8: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

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

Twig on Her Majesty’s Secret Service

Page 10: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

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

Define the service call configuration

Page 12: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

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

Data from service call can be used in layout

Page 14: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

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

Configurable dropdown options

• via service call

• via constants

• via configuration

Page 16: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

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

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

Input Data is defined in XML Schema

IDL Input Schema

Page 19: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

Expected Output is defined in XML Schema

IDL Output Schema

Page 20: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

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

Webhook Config

Page 22: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

Webhook Listener

Page 23: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

Parsing Event Data

Page 24: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

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

• 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

What was that <subscriber> tag all about?

Callback Subscriber

Page 27: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

Shipping Endpoint

Input defined in the IDL

Page 28: The Future of Magento Extensibility | Imagine 2013 Technology | Christopher O’Toole

{

"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

It Works!


Recommended