I have a question about singleton classes. Suppose, I have a rest api based application and in that application i have created a databases connection class as singleton class. So, wanted to know, when ever a http request comes to fetch the user profile from the db. then on every request it creates a new instance or it uses the same instance for the database. if every time it create a new instance then what is the benefit of singleton class.
Aucun commentaire:
Enregistrer un commentaire