top of page
Search

Keeping it Dynamic

  • Writer: John Mitropoulos
    John Mitropoulos
  • Sep 21, 2021
  • 2 min read

These past couple months I've been putting together a relatively large project for my portfolio. This project requires constant information updates, and to run these updates I have to use incoming data from several external API services.


It isn't my first build utilizing APIs, but I'm also maintaining a back-end for this application (in Rails) that will have to use the incoming information for keeping my database current. This adds a whole extra layer to the process - the data in my back-end needs to make use of the API information prior to the moment a user takes any action at all (views a new page, makes a transaction, etc). Now the API data isn't just in my view files, its a part of my actual controller code.


Once I got past the point of successfully incorporating all the API data in my controllers, I had the web application up and running smoothly for a couple of days. Then, on the third day, a crash. Turns out one of the API services I'm using changes their data ordering constantly based on a ranking system.


At first I was pulling my hair out...how could I go back and change all the code I had written the past few days? And how will I know if it will be relevant several days from now if this API is dynamic in ordering?


This ended up being a huge learning point for me, as I had to step back and remember something I learned during my time at Flatiron: abstract your code. I was getting too specific; if I could further abstract the code I had for the dynamic API data, it wouldn't matter how often they changed their ordering.


I spent another day or two reworking my controller code and figured out an efficient solution. It was my first taste of having to deal with a dynamic API, and now I'll be ready for the next time it comes up.


 
 
 

Comments


  • Instagram
  • LinkedIn

©2020 by John Theo Mitropoulos

bottom of page