Evil Geniuses

A podcast that peeks into the dark underbelly of code. Hosted by Meredith Edwards and Emmanuel Genard. Software Developers at Stride Consulting in New York City.

This project is maintained by stride-nyc

Video Service Refactor: Part 3

Talking Points

Humble Object, Youtube Gateway

I find that a good way to think about this is Eric Evans’s notion of Bounded Context. YouTube organizes its data according to its context, while I want to organize mine according to a different one. Code that combines two bounded contexts gets convoluted because it’s mixing two separate vocabularies together.

Martin VideoService YoutubeConnection YoutubeGateway Video
  init’d with: nothing
methods:
video_list
init’d with: nothing
methods:
list_videos(ids)
init’d with: responseJson
methods:
item(id)
init’d with: aHash
methods:
to_h, youtube_id, enrich_with_youtube(youtube_item)
Emmanuel VideoService YoutubeVideoClient VideoRepo
  init’d with: video_repo, video_client
methods:
video_list, monthlyViews(views, publishing_date)
init’d with: nothing
methods
video_stats(youtube_ids)
init’d with: nothing
methods:
videos