Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Whether you are using a 3rd party or custom JSON API service, integration into an existing application can be time consuming: Where do you start? How can you build an object relational model that can adapt to changes in the schema? In this talk we'll start with an existing JSON schema and build a Ruby adapter to provide a pure Ruby interface to: consume, modify and re-export that schema into JSON and XML. Help us caption & translate this video! http://amara.org/v/Fp8h/
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
The video titled 'Rapidly Mapping JSON/XML API Schemas in Ruby' features Adam Cuppy at RubyConf 2014, focusing on the integration of JSON API services into Ruby applications. Cuppy discusses the necessity of building adapters to map APIs effectively, emphasizing an approach that prioritizes flexibility and adaptability in application architecture. **Key Points Discussed:** - **Introduction to the Speaker and Company:** Adam Cuppy introduces himself as part of Zeal, a software company, and invites attendees to connect with him on social media. He mentions the importance of the content, which is available on GitHub. - **Focus on JSON and XML:** While primarily focusing on JSON, Cuppy also addresses XML and YAML, explaining that the core principle is the adaptability of data structures into Ruby objects. - **Assumed Knowledge Level:** Cuppy assumes the audience has a basic understanding of Ruby’s standard library and programming patterns like decorators. - **Building API Adapters:** He highlights the importance of creating a connection class that handles data retrieval, using the Google Civic API as a practical example. This connection manages requests using HTTP methods while keeping the application insulated from underlying details. - **Separation of Responsibilities:** Cuppy stresses the need to separate the connection from the client object, with the client functioning like a controller in Rails. The client is responsible for the logic surrounding requests and responses between the application and API connection. - **Data Handling and Coercion:** After fetching the data, he discusses transforming it for usability in the application, advocating for an instance-oriented architecture. He proposes the use of OpenStruct for handling representations of data within Ruby, promoting flexibility to accommodate changes in API structures. - **Adapting to API Changes:** The discussion includes strategies on how to accommodate potential changes within the API without major disruptions to the existing architecture. This approach involves creating structured classes that reflect API responses. - **Flexibility in Representations:** For applications dealing with multiple data formats, Cuppy mentions gems like Representable, supporting the adaptability to render data in formats like XML or YAML. - **Conclusion:** Cuppy concludes by asserting that an effective architecture is instrumental in quickly adapting to changes and debugging, thereby enhancing the usability of services like APIs. He encourages ongoing engagement with the material and resource links provided. Overall, the talk emphasizes the principles of designing adaptable Ruby applications capable of efficiently communicating with varying API schemas.
Suggest modifications
Cancel