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

Server Driven UI Workflow

Server Driven UI Workflow

Video: https://youtu.be/eHGFpRj_3Vk

Deploying an Android app to the play store always contains some cost in it. Furthermore the user isn't always keen to download (again) our latest versioned app. How about doubling the cost of development with the iOS app into account (or Web)?
At Square, we came up with a system in which the server owns the workflow of the client. This means the client doesn't know before hand which screen, which image or text it's gonna show next.

In this talk, we'll:

- Know why Square ended up choosing this system.
- Discover how we built it.
- Look at the challenges, the pros and cons of such an architecture.
- Talk about how we want to alter it for the future.

Attendees to this talk will be expose to solutions for problems every company is facing but don't address.

Benoît Quenaudon

April 24, 2019
Tweet

More Decks by Benoît Quenaudon

Other Decks in Programming

Transcript

  1. A

  2. A

  3. A

  4. A

  5. A

  6. A

  7. A

  8. A

  9. A

  10. A

  11. A

  12. A

  13. A

  14. A

  15. A

  16. A

  17. A

  18. message IdentityVerificationBlocker { optional bool requires_birthdate = 1; optional bool

    requires_full_ssn = 2; optional bool requires_last_four_ssn = 3; optional bool requires_full_name = 4; optional bool requires_address = 5; }
  19. Server sends back ExecuteContractResponse if (response is ExecuteContractResponse) { return

    R.layout.status_result_view; } Pass ExecuteContractResponse#statusResult to the view
  20. Server sends back ExecuteContractResponse if (response is ExecuteContractResponse) { return

    R.layout.status_result_view; } Pass ExecuteContractResponse#statusResult to the view
  21. Server sends back ExecuteContractResponse if (response is ExecuteContractResponse) { return

    R.layout.status_result_view; } Pass ExecuteContractResponse#statusResult to the view
  22. B C D message StatusResult {a enum Icon {b SUCCESS

    = 1; PENDING = 2; FAILURE = 3; ACTION_REQUIRED = 4; NONE = 5; }c optionaloIcon icon = 1; }d
  23. a C D message StatusResult {a enum Icon {b SUCCESS

    = 1; PENDING = 2; FAILURE = 3; ACTION_REQUIRED = 4; NONE = 5; }c optionaloIcon icon = 1; optionalostring text = 2; }d
  24. B a C message StatusResult {a enum Icon {b SUCCESS

    = 1; PENDING = 2; FAILURE = 3; ACTION_REQUIRED = 4; NONE = 5; }c optionaloIcon icon = 1; optionalostring text = 2; optionaloStatusResultButton primary_button = 3; optionaloStatusResultButton secondary_button = 4; }d
  25. B a C message StatusResult {a enum Icon {b SUCCESS

    = 1; PENDING = 2; FAILURE = 3; ACTION_REQUIRED = 4; NONE = 5; }c optionaloIcon icon = 1; optionalostring text = 2; optionaloStatusResultButton primary_button = 3; optionaloStatusResultButton secondary_button = 4; }d message StatusResultButton { enumoButtonAction { HOME_SCREENz=z1; LINK_CARDz=z2; OPEN_URLz=z3; } optionalnButtonAction actionz=z1; optionalnstring textz=z2; optionalnstring urlz=z3; }
  26. B a D message StatusResult {a enum Icon {b SUCCESS

    = 1; PENDING = 2; FAILURE = 3; ACTION_REQUIRED = 4; NONE = 5; }c optionaloIcon icon = 1; optionalostring text = 2; optionaloStatusResultButton primary_button = 3; optionaloStatusResultButton secondary_button = 4; optionalostring promo_textw=w5; }d
  27. message StatusResult {a enum Icon {b SUCCESS = 1; PENDING

    = 2; FAILURE = 3; ACTION_REQUIRED = 4; NONE = 5; }c optionaloIcon icon = 1; optionalostring text = 2; optionaloStatusResultButton primary_button = 3; optionaloStatusResultButton secondary_button = 4; optionalostring promo_textw=w5; }d
  28. message FormBlocker { oneof Element { ButtonElement button_element = 1;

    LocalImageElement local_image_element = 2; RemoteImageElement remote_image_element = 3; MoneyElement money_element = 4; SpacerElement spacer_element = 5; TextElement text_element = 6; CustomizedCardElement customized_card_element = 7; AddressElement address_element = 9; TextInputElement text_input_element = 10; OptionPickerElement option_picker_element = 11; DetailRowElement detail_row_element = 12; CurrencyConversionFlagsElement currency_conversion_flags_element = 13; } repeated Element elements = 1; optional BlockerAction primary_action = 2; optional BlockerAction secondary_action = 3; } ButtonElement LocalImageElement RemoteImageElement MoneyElement SpacerElement TextElement CustomizedCardElement AddressElement TextInputElement OptionPickerElement DetailRowElement CurrencyConversionFlagsElement
  29. message FormBlocker { oneof Element { ButtonElement button_element = 1;

    LocalImageElement local_image_element = 2; RemoteImageElement remote_image_element = 3; MoneyElement money_element = 4; SpacerElement spacer_element = 5; TextElement text_element = 6; CustomizedCardElement customized_card_element = 7; AddressElement address_element = 9; TextInputElement text_input_element = 10; OptionPickerElement option_picker_element = 11; DetailRowElement detail_row_element = 12; CurrencyConversionFlagsElement currency_conversion_flags_element = 13; } repeated Element elements = 1; optional BlockerAction primary_action = 2; optional BlockerAction secondary_action = 3; }
  30. • Force update • Redirect to Web App • Smoke&Mirror

    usage of old blockers • Use fallback blocker • Don't send blocker - skip it
  31. • Real logic lives in only one platform • Lot

    of features/fixes don't involve clients at all • Client logic is simple - to some degree • Changes available without client updates