the rails engine that could

7
The Rails Engine That Could!!! Chooo Chooo!!! Andy Maleh - Grouptiva

Upload: andymaleh

Post on 12-May-2015

1.515 views

Category:

Technology


3 download

DESCRIPTION

That talk covered a successful utilization of Rails Engines in Rails 3 to modularize MVC features as reusable components. These components provide the best of both worlds, DRY reusable and easy to maintain code that is also extensible and customizable in every way necessary.

TRANSCRIPT

Page 1: The Rails Engine That Could

The Rails Engine That

Could!!! Chooo Chooo!!!

Andy Maleh - Grouptiva

Page 2: The Rails Engine That Could

Problem

Difficulty reusing functionality cutting across:

Models

Views

Controllers

Assets (JS, CSS, Images)

Duplication across all web application layers.

Page 3: The Rails Engine That Could

Solution

Break common behavior into Rails Engines

Customize models/controllers/helpers in each project where needed by reopening classes

Customize Rails views in each project as needed by overriding templates

Link to Rails Engines in Gemfile via Git repo

Page 4: The Rails Engine That Could

Example

Common DomainRails

Engine

Recruiting System

Rails App

Athlete Profiles

Rails App

Client System

Rails App

Search PageRails

Engine

Page 5: The Rails Engine That Could

Benefits

Code reuse and productivity

Easier more organized maintainability

Minimize ripple effect when making changes

Project tests run faster by offloading some to Rails engines

Page 6: The Rails Engine That Could

Cost

Overhead in establishing a new Rails Engine gem project

More complexity

Have to upgrade ref numbers in Gemfile on every change (could be offset by symlinking)