Building a framework agnostic API

Download Building a framework agnostic API

Post on 23-Jan-2018

215 views

Category:

Software

4 download

Embed Size (px)

TRANSCRIPT

<ul><li><p>Building a framework agnostic API</p><p>David Manners@mannersd</p></li><li><p>How to un-Magento your Magento code/developers</p><p>David Manners@mannersd</p></li><li><p>Disclaimers</p><p> Not for all, Not perfect, Will not code for you! Love to build in blocks,</p></li><li><p>Are you sitting comfortably</p></li><li><p>Are you sitting comfortably</p><p> Magento 1 EOL, New customer, Lots of integrations, Migration possible,</p></li><li><p>ERP API Magento</p></li><li><p>How do you build this?</p></li><li><p>What on earth is a store?</p></li><li><p>Interface everything!</p></li><li><p>Interface everything</p><p> Take your domain and enforce your properties, Tell frameworks how to interact with your domain,</p></li><li><p>Domain Objects</p></li><li><p>A middleware</p></li><li><p>A middleware</p><p> Pick one you like! Take request, Give response, SIMPLES!</p></li><li><p>Response/Request parsing</p></li><li><p>Build a bridge</p></li><li><p>The results!</p></li><li><p>The results!</p><p> Ready to go with M1, Ready to switch to M2, Happy Customer? Happy Developers?</p></li><li><p>All that glitters is not gold</p></li><li><p>Build from the interfaces</p></li><li><p>Store Interface</p><p>interface StoreInterface{ public function getIdentifier(); public function getCode(); public function getName(); public function getActive();}</p></li><li><p>StoreRepositoryInterface</p><p>interface StoreRepositoryInterface{ public function find(array $ids = []); public function save(StoreInterface $store);}</p></li><li><p>ExporterInterface</p><p>interface ExporterInterface{ public function setIdentifier(array $identifier = []); public function execute();}</p></li><li><p>ImporterInterface</p><p>interface ImporterInterface{ public function execute();}</p></li><li><p>Bridge Interface</p><p>interface BridgeInterface{ public function getPageRepository();}</p></li><li><p>Build from the interfaces</p><p> implement ExporterInterface implement ImporterInterface implement StoreInterface</p></li><li><p>Build from the interfaces (M1/M2)</p><p> Implement BridgeInterface, Implement StoreRepositoryInterface</p></li><li><p>Let Magento do Magento</p></li><li><p>Do one thing well</p></li><li><p>Free your developers</p></li><li><p>Enjoy coding again</p></li><li><p>Can I see it?</p><p> https://github.com/sitewards/setup https://github.com/sitewards/setup-mage2 https://github.com/sitewards/setup-mage1</p><p>https://github.com/sitewards/setuphttps://github.com/sitewards/setup-mage2https://github.com/sitewards/setup-mage1</p></li><li><p>Building a framework agnostic API</p><p>David Manners@mannersd</p></li></ul>