I'm in an argument with a developer I'm working with. We're developing
an app with no API and quite a bit of AJAX. He wants to use restful
controllers everywhere. This annoys me. Right now we have one page
that is referencing 4 different restful controllers with views and
partials all over the place. To me it makes more sense to put all the
actions you need for one page into one controller so it's coherent and
easy to debug. I think it could just be that his nazi perspective on
mapping controllers directly to models could be the problem... I've
read some different stuff about restful, but I haven't been able to
find anything that's a simple clear explanation of WHEN and WHY to use
them?
Sounds like your colleague has collapsed two ideas into one. REST isn't
the same thing as CRUD, although having your CRUD-centric controllers
and actions be RESTful is popoular in the Rails community.
Luke, I'm your father, Give in to the Rest side of the force ..
I heard this same kind of argument at a Restful session at Railsconf
on Saturday at the guy that was arguing your point was generally
declared to be half horse and half donkey, if that answers the last
question. There is never a complete right and wrong and Rest can be
done poorly, but using Rest is always more correct than what you are
suggesting. It's change, It's painful. You are not used to it. You are
resisting the correct thing. Your argument is similar to arguing
against OO because it is new and painful.
Get over it, go with Rest, Learn about it and do it correctly.
I hope you're responding to the original post, not my reply.
If not, I wasn't arguing against REST. I was pointing out that people
often assume that REST and CRUD-centricity are the same thing.
What I assumed to be implicit in my post, but perhaps should have made
explicit, is that REST always makes a great deal of sense, but
CRUD-centricity does not.