In #swiftlang if our model are struct but we need inheritance, is it better to migrate to classes or to use composition?
Conversation
A code snippet being better than a thousand words: gist.github.com/AliSoftware/9e so what's the best approach?
1
3
Composition.
1
1
1
1
1
Thx for your insight. So in my GIST (updated) the best approach is solution 3 right? to still keep encapsulation
1
Replying to
Replying to
So my solution 2… doesn't it bother you that it exposes the inheritance and you need to use car.vehicle.model then?
1
Show replies


