1- singleton design pattern and its rule.

2- way to make singleton thread-safe

3- implementation in Kotlin without object keyword and the magic of object

3- how to Call Kotlin object Singleton in java class

4- Kotlin object property.

5- tricky ways to handle singleton when need to pass args to param

6- when it is not recommended to use object ?

7- android real example you do in your app (retrofit and sharedPref)

The singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system.


use this Design pattern when application wants to have one and only one instance of any class, in all possible scenarios without any exceptional condition.

#go4 #design-patterns #kotlin #android #singleton

Singleton Design Pattern With Kotlin
1.85 GEEK