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

Other Decks in Programming

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 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 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 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 Slide

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

    View Slide

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

    View 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 Slide