the rails engine that could
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
The Rails Engine That
Could!!! Chooo Chooo!!!
Andy Maleh - Grouptiva
Problem
Difficulty reusing functionality cutting across:
Models
Views
Controllers
Assets (JS, CSS, Images)
Duplication across all web application layers.
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
Example
Common DomainRails
Engine
Recruiting System
Rails App
Athlete Profiles
Rails App
Client System
Rails App
Search PageRails
Engine
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
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)
More Info
http://edgeapi.rubyonrails.org/classes/Rails/Engine.html
http://andymaleh.blogspot.com