Scala, Scala Programming, Programming, Design Patterns, Singleton Design Pattern.
code for this implementation is the following. object EC2Con { val id: Int = 1 def connect: String = s"singleton EC2 connection with session id ${id} stablished" } object SimpleClient extends App { System.out.println(EC2Con.connect) } This is a simple implementation that comes out of the box by