Tag Archives: pattern

(JavaScript) JavaScript Basic Decorator Pattern

In this section we’re going to explore the decorator – a structural design pattern that promotes code reuse and is a flexible alternative to subclassing. This pattern is also useful for modifying existing systems where you may wish to add additional features to objects without the need to change the underlying code that uses them. [...]

Posted in JavaScript | Also tagged , , , , , | Leave a comment

(JavaScript) JavaScript Factory Pattern

The Factory Pattern suggests defining an interface for creating an object where you allow the subclasses to decide which class to instantiate. This pattern handles the problem by defining a completely separate method for the creation of objects and which sub-classes are able to override so they can specify the ‘type’ of factory product that [...]

Posted in JavaScript | Also tagged , , , , | Leave a comment

(JavaScript) JavaScript Mediator Pattern

In software engineering, a mediator is a behavioral design pattern that allows us to expose a unified interface through which the different parts of a system may communicate. If it appears a system may have too many direct relationships between modules (colleagues), it may be time to have a central point of control that modules [...]

Posted in JavaScript | Also tagged , , , , , | Leave a comment

(JavaScript) Fresh JavaScript file (With namespaced, closured module pattern)

A JavaScript starter with a namespace and closure

Posted in JavaScript | Also tagged , , , , , | Leave a comment