If I have a base class in Scala such as:
class Base(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int = 1, g: Int = 2) {}
I want multiple classes to inherit from this base class, but I want to add arguments onto that list. Is there an efficient way to do this, without carrying around the massive argument list of the base class?
To make matters more complicated, the base classes may or may not redefine the optional parameters (f and g). Hypothetically:
class Child1(f: Int, h: Int, i: Int) extends Base(a,b,c,d,e,f)
And it of course would be something like
new Child1(a=1, b=2, c=3, d=4, e=5, f=6, g=7, h=8, i=9)
Is there a good way to do this in Scala? (I thought about passing a map through each constructors that defines the arguments, but then there's no compile-time checking of whether required parameters exist, and it relies on developers checking documentation to see what they should include. What if a key is misspelled? etc...)