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

Controllers suck.

Controllers suck.

An alternative for controllers inspired by "Hexagonal Rails".

Video :
http://vimeo.com/47242186

Damian Le Nouaille

August 07, 2012
Tweet

More Decks by Damian Le Nouaille

Other Decks in Programming

Transcript

  1. @damln
    @damln
    www.dln.name
    Damian Le Nouaille

    View Slide

  2. Controllers, sucks.

    View Slide

  3. MVC and the WEB
    ‣ JavaScript 12764686 MV* Frameworks
    ‣ All is not WEB
    ‣ Server Side is now complex
    ‣Architecture over frameworks

    View Slide

  4. MVC
    Hey show
    me that
    Can he
    see porn ?
    NO ! He’s old.
    Nope.

    View Slide

  5. CAN you ZOOM ?
    ‣ Route parameters
    ‣ To a “Controller”
    ‣ Check params (security)
    ‣Do a transaction (ask Model)
    ‣Render something, depends
    on the transaction
    ‣Dance
    ‣Make a better world
    ‣Hang out with girls
    HTTP
    LOGIC
    WHAT YOU EXPECT

    View Slide

  6. Add photos
    with tags
    photos.save()
    Ok, done.
    photos
    Better
    “Hey, something
    want to add
    photos”
    Yes it’s done, you
    can render.

    View Slide

  7. photos.save()
    Ok, done.
    Why ?
    “Hey, something
    want to add
    photos”
    Yes it’s done, you
    can render.
    HTTP
    Workers
    Command line
    Cats

    View Slide

  8. Can you do that,
    in Rails ?
    YES
    DEMO

    View Slide