Tag Archives: design pattern

(JavaScript) JavaScript Command Pattern

The Command pattern aims to encapsulate method invocation, requests or operations into a single object and gives you the ability to both parameterize and pass method calls around that can be executed at your discretion. In addition, it enables you to decouple objects invoking the action from the objects which implement them, giving you a [...]

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

(JavaScript) JavaScript Observer Pattern

The Observer pattern is more popularly known these days as the Publish/Subscribe pattern. It is a design pattern which allows an object (known as a subscriber) to watch another object (the publisher), where we provide a means for the subscriber and pub-lisher form a listen and broadcast relationship. Popular JavaScript libraries such as dojo, jQuery [...]

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

(JavaScript) Javascript Module Pattern

The module pattern was originally defined as a way to provide both private and public encapsulation for classes in conventional software engineering. In JavaScript, the module pattern is used to further emulate the concept of classes in such a way that we’re able to include both public/private methods and variables inside a single object, thus [...]

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

State design pattern in C#

The state pattern is a software design pattern to represent the state of an object. It allows an object to alter its behavior when its state changes. It shows a similarity to the strategy pattern.

Posted in C# | Also tagged , , , , , , , , , , , , | Leave a comment