[LRUG] Objects and on Hexagonal Rails

Tim Craft mail at timcraft.com
Tue Jul 23 07:27:49 PDT 2013


> So my question is: Should you strike a balance? If so, how do you
> strike a good balance? What has been your experience of introducing
> these techniques bit-by-bit?

I've had success with using a hybrid approach on a greenfield project.
Specifically: moving input validation to form objects (cf.
http://github.com/timcraft/formeze), using immutable "dumb" models,
and encapsulating persistence logic within service objects/classes.
Ended up completely dropping ActiveRecord (in favour of Sequel), and
using Rails mostly for actionpack/actionmailer.

Would not recommend doing this with newbie Rails developers. It helps
to have a good understanding of the benefits/tradeoffs with the
different techniques/patterns, and the pain points of the traditional
approaches (i.e. fat controllers, or fat ActiveRecord models).

Cheers,
Tim



More information about the Chat mailing list