James and I pair-programmed most of ActivePresenter on our way to Rubyfringe. He’s put the finishing touches while on the beach and has an announcement up on his blog.
My first encounter with Presenters was rather confusing - it wasn’t clear to me then that this pattern is overkill for the simpler scenario of saving two related objects. In such cases, validates_associated will do just fine or you can check out attribute_fu.
When those approaches can’t handle your problem - either because you have multiple objects or something other than a parent/child relation - it can really make your code much clearer and keep controllers skinny.
While James and I had a clear idea of what we wanted this library to do, we ended up spending a fair amount of time erasing and re-coding parts of the code until they felt right. One chunk of code got re-written 4 times before we felt it would be easy to read - which we hope you do.
0 comments ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment