- Where do we need this module pattern?
- What is its significance?
In singleton design pattern, let’s say we have requirement like we have very less sources and those sources we do not want to keep creating multiple times. We just want to have only one instance throughout the app, in those scenarios we do singleton design pattern on server side. We make sure whenever somebody ask for instance it has to call some method in the object.
When we need a single instance of an object throughout our app we do not need to create a class and then instantiate it, instead we can use Module pattern. It has many benefits over other pattern types like regular JS class and prototype Pattern. In our video tutorial we will see how we can create a class with private function. This video will answer most of the important question like
- Can we write static function in a class?
Please visit our video tutorial to get your answers, snapshot of session below: