Design patterns are advanced object-oriented solutions to commonly occurring software problems. Patterns are about reusable designs and interactions of objects. Each pattern has a name and becomes part of a vocabulary when discussing complex design solutions.
What is Modular Pattern?
The module pattern is a common JavaScript coding pattern. It’s generally well understood, but there are a number of advanced uses that have not gotten a lot of attention. In this article, I’ll review the basics and cover some truly remarkable advanced topics, including one which I think is original.
One limitation of the module pattern so far is that the entire module must be in one file.
Example Code:
Basic Structure:
(function(){// Code goes here})();
var MODULE = (function () { var my = {}, privateVariable = 1;