This document will serve as a reference for using patterns in JavaScript and C#, initially I will just be defining the pattern as I know and have researched and then a JS vs C# example.
Design Patterns: Elements of Reusable Object-Oriented Software http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/ref=tmm_hrd_swatch_0?_encoding=UTF8&qid=&sr=
http://www.amazon.com/Pattern-Language-Buildings-Construction-Environmental/dp/0195019199 A Pattern Language: Towns, Buildings, Construction (Center for Environmental Structure)
###(New instances and object, creationism)
Explain fully the idea behind this category of patterns, why we place them in this category, what we should be thinking about when we want to use this category.
- Think C#/Java constructors. Gives us the ability to create something, set defaults, do pre and post creation tasks. BTW in JavaScript the constructor exists, but we will need to do things slightly different.
http://www.c-sharpcorner.com/UploadFile/5d932c/javascript-factory-pattern/
- Extracted and enclosed Group of like methods or a service.
- Factory: A factory that creates objects that derive from a particular base class.
- Abstract factory: A factory that creates other factories, and these factories in turn create objects derived from base classes. You do this because you often don't just want to create a single object (as with Factory method) - rather, you want to create a collection of related objects.
http://robdodson.me/javascript-design-patterns-singleton/
- Ensure a class has only one instance and provide a global point of access to it.
- The Singleton Pattern limits the number of instances of a particular object to just one. This single instance is called the singleton. Singletons are useful in situations where system-wide actions need to be coordinated from a single central place. Singletons reduce the need for global variables which is particularly important in JavaScript because it limits namespace pollution and associated risk of name collisions. The Module pattern (see our JavaScript + jQuery Design Pattern Framework) is JavaScript's manifestation of the Singleton pattern.
Several other patterns, such as, Factory, Prototype, and Façade are frequently implemented as Singletons when only one instance is needed.
###(Definition at a glance) Explain fully the idea behind this category of patterns, why we place them in this category, what we should be thinking about when we want to use this category and why it matters in the wholae damn thing of things, this text needs to be Replaced ok
###(Definition at a glance) Explain fully the idea behind this category of patterns, why we place them in this category, what we should be thinking about when we want to use this category and why it matters in the wholae damn thing of things, this text needs to be Replaced ok