design patterns in scala

Self type Annotations in Cake Pattern

Reading Time: 2 minutes Self type annotations/references allows you to redefine this and is a way to declare the dependencies required by a component. Using a trait mixin, you can inject various implementations of dependencies In layman terms, Self type annotations/references are to ensure that the class can not be instantiated without mixing in the trait explicitly specified in the notation and its members can be used in the Continue Reading