Object Oriented Programming with JavaScript

Summary

Object oriented programming (OOP) is at the heart of most software development. Though JavaScript is a bit unusual in its approach to OOP, it is nevertheless an OOP language. In this course, we'll work on demystifying OOP and how to code in an OO fashion. We'll look at how JavaScript's functions are first class objects, and how that gives us the ability to use callbacks, function expressions, and initially invoked function expressions. We'll also explore the extremely important concept of execution context, dealing with context loss, and how to bind functions to specific context objects. We'll cover the cornerstone concepts of OOP as the apply to JavaScript, namely prototypal inheritance, encapsulation, and polymorphism You'll be challenged to debug and design several non-trivial OO programs. After this course, you should know and understand objects, properties, methods, prototypal inheritance, factory functions, constructors, ES6 classes, and the OLOO pattern, as well as many other basic OO concepts.

Major Topics

  • What are objects
  • How inheritance works in JavaScript
  • How JavaScript deals with multiple inheritance
  • Object properties and methods
  • Working with object oriented code
  • Design considerations when working with OOP
  • Function expressions
  • Higher Order Functions
  • The Global Object
  • Execution Context and dealing with context loss
  • Factory Functions
  • Object Prototypes
  • Constructors
  • Classes
  • Projects and Exercises

Phase

Programming and Back-end Development

Prerequisites

Detailed Syllabus

Object Oriented Programming

  • What is OOP?
  • Encapsulation
  • Creating objects
  • Collaborator objects
  • Object factories
  • Build an OO Rock, Paper, Scissors game
  • Rock, Paper, Scissors bonus features
  • Coding tips
  • CRC cards
  • RPS bonus features
  • Practice problems

Functions and Execution Context

  • Function expressions
  • Higher order functions
  • The global object
  • Implicit and explicit execution context
  • Hard binding functions with contexts
  • Dealing with context loss
  • Practice problems

Object Creation and Code Reuse Patterns

  • Object prototypes
  • Object creation with prototypes
  • Constructors
  • Constructors with prototypes
  • Sub-typing with constructors and prototypes
  • Built-in constructors
  • ES6 classes
  • Rewriting OO Rock, Paper, Scissors game with constructors and classes
  • Code reuse with mixins
  • Polymorphism

More Object Oriented Programming

  • Build an OO Tic Tac Toe game with classes
  • Build an OO Tic Tac Toe game with constructors and prototypes
  • Build an OO Tic Tac Toe game with OLOO
  • Build an OO Tic Tac Toe game bonus features
  • Build an OO 21 game any way you please

Assessment

  • Assessment Format
  • Study Guides
  • The Exam
  • The Interview
  • Feedback