Tag Archives: design pattern

Dependency Injection in NodeJS


via Dependency Injection in Node.js | RisingStack.

Dependency injection is a software Design Pattern in which one or more dependencies (or services) are injected, or passed by reference, into a dependent object.

Mastering the Module Pattern


via Mastering the Module Pattern.

I’m a massive fan of JavaScript’s Module Pattern and I’d like to share some use cases and differences in the pattern, and why they’re important. The Module Pattern is what we’d call a “design pattern”, and it’s extremely useful for a vast amount of reasons. My main attraction to the Module Pattern (and it’s variant, the Revealing Module Pattern) are because it makes scoping a breeze, and doesn’t overcomplicate JavaScript design.

It also keeps things very simple and easy to read and use, uses Objects in a very nice way, and doesn’t bloat your code with repetitive this and prototype declarations. I thought I’d share some insight as to the awesome parts of the Module, and how you can master it and it’s variants and features.

[JavaScript framework wars] May the force be with you


Before reading this post, just let you know that it could be very long post. If you don’t like to read, just scrolling down to the end of post because I put the stuff for evaluating JavaScript frameworks there. Using it to make the decision for your own with your own risk or read the […]

https://dothanhlam.wordpress.com/2015/07/05/javascript-framework-wars-may-the-force-be-with-you/

IIFE : Immediately-invoked function expression


Popular Javascript design pattern, pronounced “iffy“. There are couple of ways to do it;  (difference in using parenthesis) (function() { // Code Here alert(“Hello iffy”); })(); (function() { // Code Here alert(“Hello iffy”); }()); Passing values to iffy: (function(a,b) { // Code Here alert(a+” “+b); }(‘Hello’,’iffy’));

https://nikhilmachcha.wordpress.com/2015/08/12/iife-immediately-invoked-function-expression/