Scala, Scala Programming, Programming, Design Patterns, Singleton Design Pattern.
has been explained the singleton pattern ensures that only one instance of a class exists, which can provide performance advantages. Nevertheless the singleton object sometimes is used with a mutable state as a replacement for techniques like partial function application or dependency injection,