When you want to ensure that a class has only one instance and provide a global point of access to that instance.
api/designPattern/getSingleton api/designPattern/updateSingleton
Resource Sharing
Database Connection
When you need to ensure that a class has only one instance and provide a global point of access to it.
When you want to delegate the responsibility of instantiating objects to a factory class, providing an interface for creating instances of a class.
api/designPattern/drawShape
The Factory Pattern allows you to introduce new types of objects or classes without changing the client code. Clients only interact with the factory interface, making it easy to extend or modify the system with minimal impact.
cryptoFactory that creates different types of crypto(TRX,BSC)
File name with Factory use to declare object based on client code's input Folder name with FactoryBlueprint use to store the object blueprint
When you want to delegate the responsibility of object instantiation to a factory class, providing an interface for creating instances of a class.