Save 37% off PRO during our Black Friday Sale! »

JavaScript API Proxy Pattern

JavaScript API Proxy Pattern

The presentation describes what is API proxy pattern, the problem it solves and how to implement it. It also showcases how it makes testing easier and the future of ES6 Proxies.

1ecd28bc47e222fdbe77ab1b73248d0d?s=128

Allan Chua

March 13, 2019
Tweet

Transcript

  1. API Proxy Pattern: Reusable and Mockable API Calls Allan A.

    Chua https://www.pogsdotnet.com
  2. https://bit.ly/2HhiRVv GITHUB DEMO LINK

  3. https://bit.ly/2TH1mDM Slide Deck Link

  4. • What is Proxy Design Pattern • Problems it solves

    • How to implement • How to improve • How it makes testing easy • The Future Agenda
  5. • Provide a surrogate or placeholder for another object to

    control access to it. • Use an extra level of indirection to support distributed, controlled, or intelligent access. • Add a wrapper and delegation to protect the real component from undue complexity. What is Proxy Pattern
  6. How it Looks Like Object Consumer Proxy Encapsulates access management

  7. How it Looks Like

  8. How it Looks Like

  9. Why its perfect for API Calls API Consumer Proxy Encapsulates

    protocol and framework used to call API
  10. Bad API Reuse Consumer A Consumer B Consumer C API

    A API B API A API B API B
  11. Good API Reuse Consumer A Consumer B Consumer C API

    B API A Proxy A Proxy B
  12. Easy and Predictable Testing Consumer A API A Proxy A

    Mock Proxy Consumer Testing
  13. ES6 Proxies

  14. None