Where do you all think the web service client code (for a REST service)
access fit in a Rails App?
Models are what Controllers call and should probably do so now also even
though its Non-Active Record.
However, Models use the web service REST Access code to get XML and
parse it to give ActiveRecord style responses to controller.
Where should the Net:Http connection style requests be made--
in lib or initializer requiring lib or as create as a new plugin?
Where does the parsing of XML code happen-- in Model Itself?
Is the Rails Helper directory directed more towards views helpful here?
Getting it done could be easy to do everything in controller. However,
want to make it more well designed and scaleable from future
perspective. Hence, above code layout questions.
I guess ActiveResource is restrictive if you don't have control on the
WebService API.
Net::Http is most flexible but no parsing done for you.
Httparty seems nice. It uses Crack gem for XML parsing, that is better
than Rexml and Hpricot in terms of parsing I think. Of course, libxml is
the fastest but this good too.
In the end, use depending on what works for you based on your
requirements.
I guess ActiveResource is restrictive if you don't have control on the
WebService API.
Net::Http is most flexible but no parsing done for you.
Httparty seems nice. It uses Crack gem for XML parsing, that is better
than Rexml and Hpricot in terms of parsing I think. Of course, libxml is
the fastest but this good too.
In the end, use depending on what works for you based on your
requirements.
And yes, Httparty uses Net:Http under the hood, so you know it is
reliable for the basic calls....