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

FLUX based clean architecure

FLUX based clean architecure

Luca "Unsigned" Bruzzone

April 07, 2016
Tweet

Transcript

  1. FLUX based clean architecture
    Luca Bruzzone
    @unsign3d
    Android developer @ Tandù
    Notes:
    Why u no just MVP/MVC?
    No real rules on events
    No real rules on business rules
    Limited modularity for use cases
    Notes:

    View full-size slide

  2. Notes:
    WHY FLUX
    Strict rules on events
    Models has their own states
    Better support for use cases
    Single flow of data
    Notes:

    View full-size slide

  3. Notes:
    WHY FLUX
    Events are detached from data
    Events are empty classes
    Data are detached from views
    Dispatcher just work
    It's nothing new, is just pub/sub
    agent messaging
    Notes:

    View full-size slide

  4. Notes:
    USE CASES, NOT LAYERS
    Write modules that do one
    thing and do it well
    Modules are indipendents from
    each others
    Notes:

    View full-size slide

  5. Notes:
    unsign3d/cleancodeapp
    data_layer module handles
    retriving of data
    res divided by use cases
    modules for use cases
    Notes:

    View full-size slide

  6. unsign3d/cleancodeapp
    Each app module contains
    Activities
    Adapters and ViewHolders
    Controllers
    Stores
    Notes:
    Notes:

    View full-size slide

  7. Bonus tips
    Use RxJava and RxAndroid
    Don't use setters on models
    Use resource separation
    Unit test everything
    Avoid AsyncTasks
    Avoid singletons, register obj
    on Application class
    Notes:
    Thanks
    Tandù
    Scale.ws
    lgvalle/android-flux-todo-app
    fernandocejas.com
    Notes:

    View full-size slide