Singleton Design Pattern…

  • we must make the constructor of the singleton class ‘private’ in order to restrict the instantiation of the class from other classes,
  • we must create a static variable for instance and that should not take any arguments.
  • we must implement a static method to provide a global access point for the singleton object.
I will discuss about Factory Method Pattern in the next story.

--

--

--

Associate Engineer at Virtusa

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

💎Get ready for a new class!💎

Working with K8s: Shared storage scenarios

Setup SAML2 with Laravel acting as the service provider.

Implementation of Server-Sent Events and EventSource- Live Progress Indicator using React and…

Recognizing face and performing tasks.

S1E10 : Why Python is Slow Programming Language?

How to Install SSL CertificateOn Nginx Server in 3 min? 🤔

How to include images in your Flutter app

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Roshni Silva

Roshni Silva

Associate Engineer at Virtusa

More from Medium

A quick introduction

AdVic Gives Unused Computers a New Life

AdVic Gives Unused Computers New Life

Can Birds Burp? (SURPRISING Answer + Explanations!)

=> The Arrow Function