learned something
Mar. 24th, 2019 07:32 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
if your class is not a function of its constructor parameters (like, e.g., case class is), don't introduce these parameters at all. Make them members. Use a factory to build your class.
Then you can turn them into traits, and compose them freely. That's just one advantage.
The other advantage is that you won't need to reassign parameter values to members that are already declared in traits.
In short, careful with constructors. You may not need them. Scala is not C++, you know.