As some wise man says it is good to have most logic in models not in controllers (I don’t even mention view as place for logic). Good said. But I think this is not always possible.
Lets take Facebook application in consideration. RFacebook gem (and Facebook authorization system in general) is based on HTTP session. So when You make any query to Facebook You need have access to fbsession object. As far as I know, there is no easy way to access to current HTTP session (on top which fbsession is built) from model level. As a result I don’t see possibility to build keep this schema (skinny controller, fat model) when You need retrieve any data from Facebook to make model work as needed.
In some cases You could store some data from retrieved from Facebook in own DB and then You could do operations with them without access to HTTP session. But storing most of data provided by FQL You need say in Yours application terms of service (this is how I understand Facebook’s storable attribute).
And is worth to duplicate Facebook database in order to keep up schema?
Leave a Reply