$30 off During Our Annual Pro Sale. View Details »

GET STARTED WITH COMPONENT-BASED RAILS APPLICATIONS! @ Rocky Mountain Ruby 2015

shagemann
September 23, 2015

GET STARTED WITH COMPONENT-BASED RAILS APPLICATIONS! @ Rocky Mountain Ruby 2015

Same title - different content! This time co-presented with Jeff Taggart @jetaggart.

Component-based Rails helps you regain control over your sprawling Rails application. It helps you structure your new Rails application in a way that it will stay more manageable longer. It helps you think completely differently about writing applications - not just in Ruby and Rails!

This session will help you pass the initial hurdle of getting started with component-based Rails. While there is nothing really new, there is a lot that is just a little different. We will go over those differences so your start with component-based Rails is a smooth one.

shagemann

September 23, 2015
Tweet

More Decks by shagemann

Other Decks in Technology

Transcript

  1. Rails Components
    @ RMR 2015
    Stephan Hagemann, Jeff Taggart
    @shageman, @jetaggart

    View Slide

  2. Agenda
    1. Who are you? And why components?
    2. What are components?
    3. The structure of your app
    4. Real life example: The structure of P2Bi
    5. The first refactor
    @shageman, @jetaggart

    View Slide

  3. Who are you?
    Why components?
    @shageman, @jetaggart

    View Slide

  4. Jeff… Stephan...
    @shageman, @jetaggart

    View Slide

  5. What are
    components?
    @shageman, @jetaggart

    View Slide

  6. https://github.com/barinek/uservices
    @shageman, @jetaggart

    View Slide

  7. a context
    explicit
    dependencies
    @shageman, @jetaggart

    View Slide

  8. Creating an application based on
    components creates constraints that will
    improve the overall maintainability of
    your app
    @shageman, @jetaggart

    View Slide

  9. Creating an application based on
    components creates conversations that
    will improve the overall maintainability of
    your app
    @shageman, @jetaggart

    View Slide

  10. The structure of your
    app
    @shageman, @jetaggart

    View Slide

  11. @shageman, @jetaggart

    View Slide

  12. @shageman, @jetaggart

    View Slide

  13. @shageman, @jetaggart

    View Slide

  14. @shageman, @jetaggart

    View Slide

  15. Architecture Sketching Exercise
    @shageman, @jetaggart

    View Slide

  16. Real life example: The
    structure of P2Bi
    @shageman, @jetaggart

    View Slide

  17. View Slide

  18. JEFF: ARCHITECTURE DIAGRAM
    @shageman, @jetaggart

    View Slide

  19. @shageman, @jetaggart

    View Slide

  20. Discussion of P2B Code
    @shageman, @jetaggart

    View Slide

  21. The first refactor
    @shageman, @jetaggart

    View Slide

  22. For this example application, your imaginary client, who
    has limitless time and budget (unlike clients in the real
    world), wants you to develop a ticket-tracking
    application to track the company’s numerous
    projects.
    @shageman, @jetaggart
    https://github.com/rubysherpas/r4ia_examples

    View Slide

  23. github.com/shageman/r4ia_examples
    gist.github.com/shageman/
    89d869ef8539f78312b0
    @shageman, @jetaggart

    View Slide

  24. Pros and Cons of persistence extraction
    ● mechanical refactoring (i.e., fast)
    ● shows entanglement of model layer
    ● works on every app
    ● scriptable
    ● creates a sample and pattern
    ● It does (not yet) create a meaningful
    “domain component”
    @shageman, @jetaggart

    View Slide

  25. Discussion of extraction script
    @shageman, @jetaggart

    View Slide

  26. Extraction exercise for everyone’s apps
    @shageman, @jetaggart

    View Slide

  27. Wrapping up
    @shageman, @jetaggart

    View Slide

  28. Working on it…
    50% off:
    leanpub.com/cbra/c/rmr15
    @shageman, @jetaggart

    View Slide

  29. http://cbra.info
    Link collection about CBRA
    @shageman, @jetaggart

    View Slide

  30. Check out:
    http://lotusrb.org/
    Lotus MVC
    @shageman, @jetaggart

    View Slide

  31. Thanks!
    @shageman, @jetaggart

    View Slide