Salesforce Blogs

Abhinav Gupta Abhinav Gupta Abhinav Gupta Abhinav Gupta

Apex Implementing Singleton Design Pattern

Singleton is pretty popular and one of the most simple design patterns. On many occasions, we want an Apex class to have a single instance only. Fortunately, it's possible and pretty easy with Apex. There can be different strategies to implement singleton in Apex (inspired by my Java days learning). Before that, the following are the prerequisites to make a class Singleton.

Read More