ie, is it possible in the super class init block get access to values that the child class has overriden?
h
Hanno
04/27/2021, 7:49 PM
The answer to that particular question is no. But you can simply make the property a constructor param in the abstract superclass instead of an abstract property. Possible for your use case?
k
Karlo Lozovina
04/27/2021, 7:52 PM
thanks for the into! yeah, I might go with a constructor param for now, or maybe just a plain function to init the class if the number of parameters get's large...
h
Hanno
04/28/2021, 5:44 AM
Instead of init Blocks it is often better to not span a hierarchy if not necessary and make constructors private and use a factory. Especially when its sth like logging which is unrelated to the construction of the instance itself