Table of Contents
Course IntroductionWill Sentance introduces the ideology of the course, what makes a great software engineer, Codesmith, and how to get the most out of what is taught.
Object Oriented ParadigmWill gives an overview of what will be taught and then answers why a paradigm, or way of organizing code, exists at all.
Creating an ObjectWill starts by establishing objects as the best method to encapsulate data and functionality.
Object dot NotationsThe basic way to assign data to an existing object is introduced.
Object.createWill uses Object.create to start a conversation about the DRY principle.
Creating Objects with FunctionsWill diagrams solution 1, a function that returns an object when initiated. It's then explained why the solution wouldn't work in practice.
Prototype & new
Avoid Duplication with PrototypeWill introduces the next problem to be solved, which is refactoring the previous solution into one that uses object.create to create objects, but still has access to the functionality.
Prototype WalkthroughWill diagrams solution 2 using Object.create and prototype chaining with input from the audience.
new & this KeywordsWill introduces the `new` keyword and what it automates in object creation, but also how it instantiates the need to refer to it.
Functions are Objects & FunctionsWill maps out the object that gets attached to each instantiated function, and what it contains.
new Keyword & Share Functions with prototypeWill diagrams solution 3 using the new keyword and prototype chaining with input from the audience.
Review of newWill speaks to the benefits and disadvantages that solution 3 has, and topics covered later are foreshadowed.
Scope & this
Calling Prototype MethodsWill refactors solution 3 to include the implicit parameter, this. As the solution is diagramed, attention is given to when this is useful, and how scope comes into play.
this Keyword Scoping IssuesThe UserCreator.prototype.increment function is refactored further, and this poses an interesting problem with scope.
Solving Scope with Arrow FunctionsWill diagrams how arrow functions bypass the issue introduced in the previous section.
Default Prototype Chain
Function.prototype and Array.prototypeWIll diagrams the prototype chain when calling a method on a function.
Pair Programming OOJSWill directs students to the practice problems and sets up pair programming.
Subclassing with Factory Functions
Create object with Factory FunctionSolution 3 is further refactored to implement classes. Will traverses the code with the audience.
Create a Sub-Factory FunctionWill sets up the next bit of code and explains how this code is interacting with the code that was written in the previous segment. Object.setPrototypeOf is utilized to set the __proto__ of a function to achieve the functionality that we need.
Creating an object with a Sub-Factory FunctionWill continues to diagram the solution and demonstrates how the sub-factory function affects the functionality of an object that is instantiated.
Prototype LookupWill concludes this solution by diagramming a prototype lookup by an object that was previously instantiated.
Subclass ReviewWill reviews what was learned up until now in the course, and looks towards the call and apply functions that will be introduced to control the assignment of the this keyword.
Call and ApplyWIll demonstrates how to manually set the value of the this keyword inside of a function.
Subclassing with new and call
Create an Object with newWill diagrams a refactored solution that provides the store of automatically linked functions by utilizing the new keyword.
Creating a Subclass with a ConstructorWIll diagrams a solution that uses the new keyword, but then also uses a prototype chain to grant an object access to certain classes, while another doesn't.
Using a call Method in a ConstructorBy passing our newPaidUser object (`this`) to userCreator, Will demonstrates how this can refer to a context that is one level up from the current scope.
Assigning Properties to InstanceWill diagrams how instantiating a paidUser object using the new keyword would create a new context to consider.
Prototype TracingWill traces the diagramed solution using called functions on the instantiated paidUser, ensuring that functions are specific to the paid user type, but are available to all users.
Subclassing with class, extends & super
Create an Object with a classWIll diagrams a user object that is instantiated using the new keyword. No functions are copied on it, but they are still available for use.
Creating a Subclass with extendsWill introduces the extends, and diagrams what it offers to the refactored code.
Creating an object with a subclassThe last execution context of the course is instantiated, and a paidUser is created using the new keyword. Will also briefly covers reflect.construct(), which acts like the new keyword, but as a function.
Using super in a subclass constructorWill arrives at the final solution, where a paidUser1 has access to paidUser functionality, and user functionality. The paidUser1 also has the properties of a regular user by using the regular userCreator.