Skip to content

Instantly share code, notes, and snippets.

@aturon
Last active June 16, 2016 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aturon/909e28d6ce4912bd60d70faab4a8b04d to your computer and use it in GitHub Desktop.
Save aturon/909e28d6ce4912bd60d70faab4a8b04d to your computer and use it in GitHub Desktop.

Traits

  • Interfaces

    • Goal #1: Implement price for Factory
    • Goal #2: Implement total_price using the trait
    • Time: 10 minutes
  • Defaults

    • Goal #1: Implement total_price, this time as a default method
    • Goal #2: Implement price for Factory (just reuse the solution from previous)
    • Time: 5 minutes
  • Layering

    • Goal: Get main to compile by adding implementation(s) of Print
    • Time: 10 minutes

Threading

  • Basics
    • Goal: join the threads and print out the store with the best price
    • Extra credit #1: use channels instead
    • Extra credit #2: or, instead of channels, use a mutex to compute the best price in the parallel threads themselves
    • Time: 10 minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment