Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Back to forgotten roots

Mariusz Gil
February 26, 2017

Back to forgotten roots

Slides from my "Back to the roots" talk, performed at Boilings Frogs 2017, the software craftsmanship conference.

Mariusz Gil

February 26, 2017
Tweet

More Decks by Mariusz Gil

Other Decks in Programming

Transcript

  1. HoW

  2. interface ItemProvider { ... } interface ItemFilter { ... }

    class MostPopular implements ItemProvider { ... } class RecentlyPopular implements ItemProvider { ... } class Random implements ItemProvider { ... } class Promoted implements ItemProvider { ... } class CollaborativeFiltering implements ItemProvider { ... } class Clicked implements ItemFilter { ... } class Capping implements ItemFilter { ... } class Outdated implements ItemFilter { ... } class SimilarNameDuplication implements ItemFilter { ... } class RecommenderService { ... public function generate($limit = 5) { $items = $provider->get($limit * 2); foreach ($this->filters as $filter) { $items = $filter->filter($items); } if ($items->length() < $limit) { $items = $items->add($refill->get($limit)); } return $items->unique()->limit($limit); } }
  3. WhY