Andrew Krawchyk
3/14/15
General Assembly
Patterns are reusable templates for developing solutions to common problems
Helps keep related code encapsulated in one namespace
When developing larger applications, organizing code can quickly become a problem.
Graph
|_ App
|_ Drawing
|_ Utils
Notifier
|_ App
|_ Messaging
|_ Scheduling
|_ Utils
App
|_ Graph
|_ Notifier
|_ Utils
Used as an abstraction for specifying how browsers should model HTML for the vendors that implement them
Tree like structure, starts at the root, HTML
Allows developers access to all the nodes in the document in order to manipulate them
There is an enormous amount of events that can be listened to: https://developer.mozilla.org/en-US/docs/Web/Events
When events occur, all listeners are notified of the event
Listeners can be removed from nodes
el.removeEventListener(eventName, eventHandler);
var outer = document.getElementById('outer'); outer.addEventListener('click', function(event) { var target = event.target; console.log(target.id); console.log(event); });
Flyweight Pattern