3 ms·
I haven't used kotlin. How does it help it? So the kicker in imperative OO for composition is that the class you are composing has some state / instance vars.
by AtlasBarfed 2y ago
I haven't used kotlin. How does it help it?
So the kicker in imperative OO for composition is that the class you are composing has some state / instance vars.
How do you include methods that can view/update those instance vars?
Sure it's easy to compose with static/pure functions.
Do you enclose the instance vars in holder classes and pass those holders to the composition implementation class in it's method signature?
In the end, inheritance or composition is about constructing a class /struct/whatever with a given set of expected signatures with some ideally documented guidance on any intricacies.