Giter VIP home page Giter VIP logo

videos's Introduction

Code For The Imposter's Handbook Videos, Seasons 1 and 2

This is the code for the "CS Basics" video series, otherwise known as "The Imposter Video Series". They started out as individual offerings but in late 2020 I combined them into a single video set which you can see more of right here.

If you have any issues with the code or videos, feel free to leave an issue!

videos's People

Contributors

robconery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

videos's Issues

Bridge pattern question

A bit on confusion on my end working through the Bridge pattern. Hopefully someone can point me to where I'm going wrong.

The initial problem comes from wanting to formalize data access without implementing the API in every adapter. So

class SalesRepository{
  // constructor and other stuff
  getCart(key){
    return this.db.cart.get(key);
  };
}

means we have to give every adapter a cart with get functionality, which could be difficult to maintain. So far so good.

The CartRetrieval bridge comes to the rescue, allowing us to house the get logic in one place and add the bridge to our adapters, like so:

const CartRetrieval = (db) => {
  return {
    get: (id) => console.log(`Getting from ${db.name}`),
  }
}

class PgAdapter{
  constructor(){
    this.name = "Postgres Adapter";
    this.cart = CartRetrieval(this);
  };
  // Other stuff
}

So here is my confusion: The body of our bridge's get method is just a dummy console.log that is meant to stand in the place of the logic needed to get a particular cart.

But each database may require a different logic to perform that get, right? How does the get method in the CartRetrievalknow which to use? Would we switch on the db type passed in, supplying a different strategy depending on the adapter? Should the bridge delegate back to the adapter, in which case we're back to each adapter needing to implement the API?

Thanks in advance for any help!

Typos

Just a heads up there are a couple of typos in your readme text. Hanbook and east - should be Handbook and easy. Other than that great work on these videos!

This is the code for the 16 video walkthroughs in the Imposter's Hanbook. If you want to follow along, you'll need to have Node installed (6+) and, optionally, Elixir if you want to do the functional programming stuff (which you should!).

I do all of the samples within the Atom text editor using the Script Runner plugin, which is east to find and install.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.