Many of you might have different perspectives of traits in Scala. They can be viewed not only as interfaces in other languages, but also as classes with only parameter-less constructors.
Trait parameters
The Scala programming language is quite dynamic and has evolved quickly throughout the years. According to the language creators, the Dotty project is the future of Scala and it is a place where passing parameters to traits and many other features are being tested and implemented. The main idea behind it is language simplification, and more information can be found at http://dotty.epfl.ch and https://scala-lang.org/blog/2017/05/31/first-dotty-milestone-release.html.
The Scala programming language is quite dynamic and has evolved quickly throughout the years. According to the language creators, the Dotty project is the future of Scala and it is a place where passing parameters to traits and many other features are being tested and implemented. The main idea behind it is language simplification, and more information can be found at http://dotty.epfl.ch and https://scala-lang.org/blog/2017/05/31/first-dotty-milestone-release.html.
In the following few sections, we will see the traits from different points of view and try to give you some ideas about how they can be used.