Real World Fun with ActiveResource

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Real World Fun with ActiveResource - Presentation Transcript

    1. Real World Fun with ActiveResource Rob Caporetto
    2. Topics ActiveResource: A brief overview Limitations ActiveResource architecture & usage Demo Time Testing
    3. The Is & Is Nots of ActiveResource
    4. What ActiveResource Is An ORM for RESTful* Web Services Provides an ActiveRecord like way of accessing resources
    5. What ActiveResource is Not ActiveRecord for Web Services
    6. Limitations No ActiveRecord Style Validations Use hyperactiveresource or write your own Values Not Always Present hyperactiveresource allows these to be defined Ensure attributes are included on the server end
    7. More Limitations Deserialisation Performance Look at faster_from_xml plugin Class Level connections Giles Bowkett’s Dapper Resource
    8. Real World ActiveResource
    9. The Server Rails Application with exposes Resources Uses ActiveRecord to talk to the DB Needs to support .xml format for resources Can support HTTP Basic Authentication if required
    10. The Client Normal Rails Application* Models use ActiveResource::Base
    11. Model Code class Person < ActiveResource::Base self.site = \"http://api.people.com:3000/\" self.username = “api” self.password = “api” end
    12. Doing Calls person = Person.find(1) person.first_name = “John” person.last_name = “Smith” person.save other_person = Person.new other_person.first_name = “Bill” other_person.last_name = “Jones” other_person.save
    13. A Demo...
    14. Testing ActiveResource uses HttpMock in its Test Suite Uses stubbed HTTP requests Returns instantiated ActiveResource models
    15. Test Code
    16. Links HyperactiveResource github.com/lukegalea/hyperactiveresource/ faster_from_xml http://fasterfromxml.rubyforge.org/ Dapper Resource http://rubyforge.org/projects/dapper-resource/
    17. More Links More on using http_mock in tests seangeo.blogspot.com/2007/09/testing- activeresource.html giantrobots.thoughtbot.com/2007/2/2/ activeresource-and-testing

    + Rob CRob C, 2 years ago

    custom

    948 views, 0 favs, 0 embeds more stats

    Presentation I presented at the Melbourne Ruby User more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 948
      • 948 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 10
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories