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

Network Layer Abstraction

Eeb061c8b2816b771920da1b3e7904a3?s=47 Swift India
February 29, 2020

Network Layer Abstraction

Eeb061c8b2816b771920da1b3e7904a3?s=128

Swift India

February 29, 2020
Tweet

Transcript

  1. Rakesh Chander - Comviva Technologies NETWORK LAYER ABSTRACTION • Interceptors

    • Validators • Dependency Injection
  2. Rakesh Chander - Comviva Technologies Problem Statement – Common Request

    / Response operations – Serialization / Deserialization – Bearer Token Management – End to End Encryption – Testable Code
  3. Rakesh Chander - Comviva Technologies Unfolding – Common code templates

    & patterns – Generics – Abstraction – Over-riding behavior – Dependency Injection
  4. Rakesh Chander - Comviva Technologies Interceptors ▪ Interceptors are a

    powerful mechanism that can pre-process or post-process a request
  5. Rakesh Chander - Comviva Technologies Interceptors (Request Header Definition)

  6. Rakesh Chander - Comviva Technologies Interceptors (Request Body Definition)

  7. Rakesh Chander - Comviva Technologies Interceptors (Response Body Definition)

  8. Rakesh Chander - Comviva Technologies Interceptors (Usage)

  9. Rakesh Chander - Comviva Technologies Validators ▪ Serialization / Deserialization

    ▪ Fallback Mechanism ▪ Common Error Generation ▪ Bearer Token Management
  10. Rakesh Chander - Comviva Technologies Adoption ▪ API call can

    be declared using structs, its simple ▪ Implement Protocols for required Request Type viz GET, POST, PUT, DELETE etc
  11. Rakesh Chander - Comviva Technologies Adoption (Overriding defaults)

  12. Rakesh Chander - Comviva Technologies Adoption (Execution)

  13. Rakesh Chander - Comviva Technologies Conclusion ▪ Increased Productivity ▪

    Lesser error scenarios
  14. Rakesh Chander - Comviva Technologies Dependency Injection ▪ Multiple Network

    Clients ▪ Unit Tests
  15. Rakesh Chander - Comviva Technologies Dependency Injection (Network Client Implementation)

  16. Rakesh Chander - Comviva Technologies Dependency Injection (Network Client Mock)

  17. Rakesh Chander - Comviva Technologies Summary Scalable, Maintainable, Reusable &

    Testable Interceptors – Wrappers, Parsers, End to End Encryption Validators – Serialization/ Deserialization, Fallback Response DAO, Token Management
  18. Rakesh Chander - Comviva Technologies Try It Out! ▪ https://github.com/rakeshchander/RCNetworkClient