Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A practice for rapidly building API by using Ze...

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

A practice for rapidly building API by using Zend Framework

Avatar for Kelvin

Kelvin

June 16, 2014

Other Decks in Technology

Transcript

  1. Challenge for building API • API is not considered at

    the beginning. • Had to write a lot of codes for API when needed (Duplicate business layer) • Hard to maintain both API and Web GUI
  2. • CRUD : – http://www.site.com/api/order/get/?id=<id> – http://www.site.com/api/order/new/ – http://www.site.com/api/order/update/?id=<id> –

    http://www.site.com/api/order/delete/?id=<id> • HTTP GET/POST • JSON data format • Authentication by ID and Token API Design
  3. • Array is input data format of service module •

    API and GUI transfer array to service module with same structure • API is using JSON data format • API authentication is implemented in custom action’s preDispatch function Key Points
  4. • Easy to implement API • Less codes for API

    • Decouple Web GUI with Business Layer. • No need to make changes twice for API and GUI Advantage