[LRUG] [ANN] Refactoring REST...searching for an abstraction

Luke Redpath contact at lukeredpath.co.uk
Fri Feb 9 04:44:40 PST 2007


> Luke, have you seen the acts_as_resource plugin I wrote for models?
> Essentially it allows you to specify how a resource is nested in the
> model, and that makes it possible to write a generic 'fetch_resources'
> method for the controller side that will populate a set of
> appropriately named instance variables, the goal being to have have a
> slimline, inheritable resource controller.

Hi Piers - no I hadn't seen it. I've taken a brief look at it is a  
bit different from my approach - personally I feel that models should  
know nothing about resources or how they are being exposed to the  
outside world and that this is solely the controllers job. I also  
prefer to avoid inheritance unless absolutely necessary ;)

My main aim was to remove the repetition in controllers that resulted  
from the normalised approach that RESTful resources brings.

Cheers
Luke


>
> Looks like you've been attacking the problem from the other direction.
>
> -- 
> Piers Cawley <pdcawley at bofh.org.uk>
> http://www.bofh.org.uk/
> _______________________________________________
> chat mailing list
> chat at lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org




More information about the Chat mailing list