This material should come after revealing module pattern and definitely before MVC. Students should already be familiar with requiring external modules and exporting modules.
This material usually takes 1 full day to introduce and up to a week's worth of exercises and reinforcement.
Students will have one of three levels of understanding about each topic upon completion of this module.
- grok: fully understand the topic in order to replicate code, communicate, and explain concepts without referring to any notes.
- explain: understand enough about the topic to describe concepts without referring to notes.
- know about: understand enough to look up further documentation when asked about the subject.
- Students should fully grok "Defining Classes."
- Students should know how to define Classes in ES5.
- Students should know how to define Classes in ES6.
- Students should fully grok "Instantiating Objects."
- Students should know how to instantiate objects from classes in ES5.
- Students should know about properties and methods.
- Students should know how to define properties on Classes in ES5:
- Students can demonstrate that they are able to identify properties
- Students can explain the difference between properties and variables
- Students should know how to define methods on Classes in ES5:
- Students can demonstrate that they are able to identify methods
- Students can explain the difference between methods and functions
- Students should know how to define static properties on Classes in ES5:
- Students can demonstrate identifying static properties
- Students can differntiate static vs.instance properties
- Students can explain the difference between static properties and instance properties
- Students should know how to define static methods on Classes in ES5:
- Students can demonstrate identifying static methods
- Students can differntiate static vs.instance methods
- Students can explain the difference between static methods and instance methods
- Students should know how to define properties on Classes in ES6:
- Students can demonstrate identifying properties
- Students can explain the difference between properties and variables
- Students should know how to define methods on Classes in ES6:
- Students can demonstrate identifying methods
- Students can explain the difference between methods and functions
- Students should know how to define static methods on Classes in ES6:
- Students can demonstrate identifying static methods
- Students can differentiate static vs.instance methods -Students can explain the difference between static methods and instance methods
- Students should fully grok "Class Inheritence".
- Students should know how to define Classes in ES6.
- Students should know how to instantiate objects from classes in ES6.
- Students should know how to properly extend Classes with Subclass definitions.
- Students should know that Subclasses inherit methods from it's Superclass.
- Students should know that Subclasses inherit properties from it's Superclass when the super constructor is invoked.
- A student should be able to whiteboard a diagram of Class relationships including UML notation for properties and methods.
- Students should be able to explain "Encapsulation."
- Recommend: Whiteboard Example to explain "Encapsulation."
- Students should be able to explain "Access Modifiers."
- Recommend: Whiteboard Example to explain "Access Modifiers."
- Students should be able to explain "Accessors."
- Recommend: Whiteboard Example to explain "Accessors."
- Students should be able to explain "Interfaces."
- Recommend: Whiteboard Example to explain "Interfaces."
- Students should know about "Polymorphism."
- Recommend: Whiteboard Example to explain "Polymorphism."
- Students should know about "Multiple Inheritence."
- Recommend: Whiteboard Example to explain "Multiple Inheritence."
- Students should be able to explain advantages of adopting an Object Oriented pattern.
- Students should be able to determine when Object Oriented patterns are suitable.
The following format is meant to be a guideline for effective delivery. Instructors can present material in another way if it is more effective for the students.
- Introduce OOP (whiteboard a diagram)
- Start with the fundamentals of classes and instances.
- Recommend: Whiteboard an example of a blueprint of a house and an actual house.
- Focus on class definition and object instantiation.
- Create clear distinction between functions vs. methods, and properties vs. variables.
- Demonstrate real-world "OOP" examples.
- Introduce inheritance using real-world whiteboard examples.
- Recommend: Whiteboard an "Animal Kingdom" example.
- Start with the fundamentals of classes and instances.
- Present ES6 OOP Slideshow: http://slides.com/theremix/es6-oop
- Assign Kingdom of OOP: https://github.com/devleague/Kingdom-of-OOP
- Present Prototypes in Javascript: http://slides.com/jasonsewell/prototypes-in-javascript @Jon - this was added in.
- Assign JS Constructors: https://github.com/DevLeague/js-constructors
- Assign JS Zombies: https://github.com/DevLeague/js-zombies
- Check in with students and their understanding of Constructors, Inheritence, and Super calls (talk)
- Verify that students have met the minimum required understanding before moving on.
- Link: http://slides.com/theremix/es6-oop
- Time Needed to Present: < 30 minutes
- Type: Slideshow
- Link: http://slides.com/jasonsewell/prototypes-in-javascript
- Time Needed to Present: < 30 minutes
- Type: Slideshow
- Concepts Covered: prototypes
- Notes: this goes with the JS Constructors exercise.
The following exercises and projects state an average time alotted. A session is about 3 hours. There are 3 sessions in a day: (1) After the morning challenge up to lunch, (2) after lunch up to dinner, (3) after dinner until the end of class.
- Repository: https://github.com/DevLeague/Kingdom-of-OOP
- Average Time Alotted: 2 sessions
- Individual or Group: Individual Exercise
- Completed Example: http://TODO
- Concepts Practiced: ES6 Constructors, ES6 Instance Properties, Inheritance, ES6 Super Call, Constructor Arguments, and Exporting and Importing Modules
- Repository: https://github.com/DevLeague/js-constructors
- Average Time Alotted: 3 sessions
- Individual or Group: Pair Exercise
- Completed Example: http://TODO
- Concepts Practiced: Defining ES5 Classes, Prototypical Inheritance, ES5 Instance Properties, and ES5 Instance Methods
- Repository: https://github.com/DevLeague/js-zombies
- Average Time Alotted: 2 sessions
- Individual or Group: Individual Exercise
- Completed Example: http://TODO
- Concepts Practiced: Defining ES5 Classes, Prototypical Inheritance, ES5 Instance Properties, and ES5 Instance Methods
- Link: http://javascriptissexy.com/oop-in-javascript-what-you-need-to-know/
- Concepts: something, something, and something
- Notes: Write why this resource is included.
- Link: http://eloquentjavascript.net/1st_edition/chapter8.html
- Concepts: something, something, and something
- Notes: Write why this resource is included.
- Link: http://javascript.info/tutorial/oop
- Concepts: something, something, and something
- Notes: Write why this resource is included.
- Link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript
- Concepts: something, something, and something
- Notes: Write why this resource is included.
- Link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
- Concepts: something, something, and something
- Notes: Write why this resource is included.
- Link: http://www.crockford.com/javascript/inheritance.html
- Concepts: classical inheritance
- Notes: Write why this resource is included.
Instructor Notes would go here as comments, as a reflection of teaching the topic.
Notes:
To clean this up: