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

NYC Android meetup May 2019

NYC Android meetup May 2019

How our architecture allows new joiners to start contributing since day one

Rui Gonçalo

May 22, 2019
Tweet

More Decks by Rui Gonçalo

Other Decks in Programming

Transcript

  1. Domain Interactor Repository interface RetrieveInteractor<in Params, Data> : Interactor {

    fun retrieveBehaviorStream(params: Params): Observable<Data> } retrieveBehaviorStream(Params) : Observable<Data>
  2. Domain Interactor Repository interface SendSingleInteractor<in Params, Result> : Interactor {

    fun sendSingle(params: Params): Single<Result> } sendSingle(Params) : Single<Result>
  3. 2FA method: Transaction Authentication Number (TAN) How do traditional banks

    usually handle authentication for money transfers?
  4. 2FA method: Pairing How does N26 handle authentication for money

    transfers? - generates a pair of public/private keys - used to verify the request was done by the correct user (mobile device) - seamless experience
  5. Presentation Domain Data interactor .retrieveBehaviorStream() .subscribe { post PhoneOrCode }

    repository .retrieveBehaviorStream() Observable<S> store .getBehaviorStream() Observable<Option<S>>
  6. Presentation Domain Data interactor .retrieveBehaviorStream() .subscribe { post PhoneOrCode }

    repository .retrieveBehaviorStream() Observable<S> store .getBehaviorStream() Observable<Option<S>>
  7. Presentation Domain Data interactor .refreshCompletable() .subscribe() retrieveBehaviorStream() .subscribe { post

    PhoneOrCode } repository .refreshCompletable() Observable<S> fetchSingle() .flatMapCompletable { store.put() } — store .getBehaviorStream() Observable<Option<S>>
  8. Presentation Domain Data interactor .refreshCompletable() .subscribe() retrieveBehaviorStream() .subscribe { post

    Code } repository .refreshCompletable() Observable<S> fetchSingle() .flatMapCompletable { store.put() } — store .getBehaviorStream() Observable<Option<S>>
  9. Presentation Domain Data countdown(d): compareTimestamps() .flatMap{ intervalRange() } Observable<Int> interactor

    .retrieveBehaviorStream() .flatMap { countdown(d) } .subscribe { Enable or Disable(seconds) } timestamp
  10. Presentation Domain Data interactor .retrieveBehaviorStream() .flatMap { countdown(d) } .subscribe

    { Enable or Disable(seconds) } countdown(d): compareTimestamps() .flatMap{ intervalRange() } Observable<Int> timestamp
  11. Presentation Domain Data interactor .sendCompletable(code) .subscribe() { success }, {

    error } service.sendCompletable Completable generateKeys() .flatMap repository .sendCompletable(k , c) Completable
  12. Presentation Domain Data interactor .sendCompletable(code) .subscribe() { success }, {

    error } generateKeys() .flatMap repository .sendCompletable(k , c) Completable service.sendCompletable Completable
  13. How our architecture allows new joiners to start contributing since

    day one - Implement Interactors according to the actions you’ll need: e.g. RetrievePairingData, SendCompletePairing - Implement Repository to make use of the reactive store to provide data to the interactors e.g. PairingRepository - Implement ViewModel with LiveData that reflects the view state e.g. PairingViewModel
  14. How our architecture allows new joiners to start contributing since

    day one - Clean architecture is a solid standard - Very well defined set of interactors with clear meaning - Easy to unit test (gives you more confidence)
  15. More about the architecture Lucia Payo @ Droidcon NY 2017

    Lucia Payo @ Droidcon Berlin 2017 https://www.youtube.com/watch?v=16wPp91kyuE https://www.youtube.com/watch?v=foaKMruUBXc
  16. N26 is hiring Senior Android Engineer - US (2019) https://grnh.se/2293a6ff1

    Or see Mitch, Rui, or Franc to learn more about opportunities!