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

Keeping Rails on track

Keeping Rails on track

Patterns and tools to add structure to growing rails applications.
I touch upon using good OOPs patterns, the trailblazer project and Component-Based Rails Applications.

Presented as a lightning talk at RubyConf Taiwan 2016

Rahul Rajeev

December 02, 2016
Tweet

More Decks by Rahul Rajeev

Other Decks in Programming

Transcript

  1. Whats wrong? • God objects • Business logic split across

    models and controllers • Non standard patterns • Code structure doesn't reflect the domain
  2. 3 Patterns to the Rescue 1. Plain Old Ruby Objects

    (POROs) / ActiveModels 2. The Trailblazer Project 3. Component Based Rails Applications (CBRA)
  3. Types of non-ActiveRecord objects • Value Objects • Service Objects

    • Form Objects • Query Objects • View Objects • Policy Objects • Decorators
  4. Rails Plugins/Engines $ rails plugin new components/app_component --full --mountable gem

    "app_component" , path : "components/app_component" Gemfile mount AppComponent::Engine , at : "/" Routes